SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
sequence_file/record.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <seqan3/io/record.hpp>
13
14namespace seqan3
15{
24template <typename field_types, typename field_ids>
25class sequence_record : public record<field_types, field_ids>
26{
29
31 using tuple_base_t = typename base_t::base_type;
32
34 template <field f>
35 using field_constant = typename base_t::template field_constant<f>;
36
37 using base_t::get_impl;
38
39public:
43 sequence_record() = default;
44 sequence_record(sequence_record const &) = default;
48 ~sequence_record() = default;
49
51 using base_t::base_t;
53
55 decltype(auto) id() &&
56 {
57 return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t &&>(*this));
58 }
60 decltype(auto) id() const &&
61 {
62 return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t const &&>(*this));
63 }
65 decltype(auto) id() &
66 {
67 return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t &>(*this));
68 }
70 decltype(auto) id() const &
71 {
72 return get_impl(field_constant<seqan3::field::id>{}, static_cast<tuple_base_t const &>(*this));
73 }
74
76 decltype(auto) sequence() &&
77 {
78 return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t &&>(*this));
79 }
81 decltype(auto) sequence() const &&
82 {
83 return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t const &&>(*this));
84 }
86 decltype(auto) sequence() &
87 {
88 return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t &>(*this));
89 }
91 decltype(auto) sequence() const &
92 {
93 return get_impl(field_constant<seqan3::field::seq>{}, static_cast<tuple_base_t const &>(*this));
94 }
95
97 decltype(auto) base_qualities() &&
98 {
99 return get_impl(field_constant<seqan3::field::qual>{}, static_cast<tuple_base_t &&>(*this));
100 }
102 decltype(auto) base_qualities() const &&
103 {
104 return get_impl(field_constant<seqan3::field::qual>{}, static_cast<tuple_base_t const &&>(*this));
105 }
107 decltype(auto) base_qualities() &
108 {
109 return get_impl(field_constant<seqan3::field::qual>{}, static_cast<tuple_base_t &>(*this));
110 }
112 decltype(auto) base_qualities() const &
113 {
114 return get_impl(field_constant<seqan3::field::qual>{}, static_cast<tuple_base_t const &>(*this));
115 }
116};
117} // namespace seqan3
118
119namespace std
120{
121
127template <typename field_types, typename field_ids>
128struct tuple_size<seqan3::sequence_record<field_types, field_ids>> :
129 tuple_size<typename seqan3::sequence_record<field_types, field_ids>::base_type>
130{};
131
137template <size_t elem_no, typename field_types, typename field_ids>
138struct tuple_element<elem_no, seqan3::sequence_record<field_types, field_ids>> :
139 tuple_element<elem_no, typename seqan3::sequence_record<field_types, field_ids>::base_type>
140{};
141
142} // namespace std
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:79
The record type of seqan3::sequence_file_input.
Definition sequence_file/record.hpp:26
decltype(auto) base_qualities() &
The qualities, usually in Phred score notation.
Definition sequence_file/record.hpp:107
decltype(auto) sequence() const &&
The "sequence", usually a range of nucleotides or amino acids.
Definition sequence_file/record.hpp:81
sequence_record()=default
Defaulted.
decltype(auto) sequence() const &
The "sequence", usually a range of nucleotides or amino acids.
Definition sequence_file/record.hpp:91
decltype(auto) base_qualities() const &&
The qualities, usually in Phred score notation.
Definition sequence_file/record.hpp:102
sequence_record(sequence_record const &)=default
Defaulted.
decltype(auto) sequence() &&
The "sequence", usually a range of nucleotides or amino acids.
Definition sequence_file/record.hpp:76
~sequence_record()=default
Defaulted.
sequence_record & operator=(sequence_record const &)=default
Defaulted.
decltype(auto) base_qualities() &&
The qualities, usually in Phred score notation.
Definition sequence_file/record.hpp:97
sequence_record & operator=(sequence_record &&)=default
Defaulted.
decltype(auto) sequence() &
The "sequence", usually a range of nucleotides or amino acids.
Definition sequence_file/record.hpp:86
decltype(auto) base_qualities() const &
The qualities, usually in Phred score notation.
Definition sequence_file/record.hpp:112
sequence_record(sequence_record &&)=default
Defaulted.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.
Provides the seqan3::record template and the seqan3::field enum.
The class template that file records are based on; behaves like a std::tuple.
Definition record.hpp:190
detail::transfer_template_args_onto_t< field_types, std::tuple > base_type
A specialisation of std::tuple.
Definition record.hpp:193
Hide me