17 #include <meta/meta.hpp>
164 template <
field ...fs>
175 static constexpr
size_t index_of(
field f)
177 for (
size_t i = 0; i <
sizeof...(fs); ++i)
178 if (as_array[i] == f)
184 static constexpr
bool contains(
field f)
186 return index_of(f) != npos;
189 static_assert([] () constexpr
191 for (
size_t i = 0; i < as_array.
size(); ++i)
192 for (
size_t j = i + 1; j < as_array.
size(); ++j)
193 if (as_array[i] == as_array[j])
197 } (),
"You may not include a field twice into fields<>.");
224 template <
typename field_types,
typename field_
ids>
225 struct record : detail::transfer_template_args_onto_t<field_types, std::tuple>
229 template <
typename t>
231 requires requires (t & v) { v.
clear(); }
233 static constexpr
void clear_element(t & v) noexcept(noexcept(v.clear()))
239 template <
typename t>
240 static constexpr
void clear_element(t & v) noexcept(noexcept(std::declval<t &>() = t{}))
246 static constexpr
auto expander = [] (
auto & ...args) { (clear_element(args), ...); };
250 using base_type = detail::transfer_template_args_onto_t<field_types, std::tuple>;
263 using base_type::base_type;
267 "You must give as many IDs as types to seqan3::record.");
286 template <
typename field_types,
typename field_
ids>
287 struct tuple_size<
seqan3::record<field_types, field_ids>>
290 static constexpr
size_t value = tuple_size_v<typename seqan3::record<field_types, field_ids>::base_type>;
298 template <
size_t elem_no,
typename field_types,
typename field_
ids>
299 struct tuple_element<elem_no,
seqan3::record<field_types, field_ids>>
302 using type = std::tuple_element_t<elem_no, typename seqan3::record<field_types, field_ids>::base_type>;
317 template <field f,
typename field_types,
typename field_
ids>
320 static_assert(
field_ids::contains(f),
"The record does not contain the field you wish to retrieve.");
321 return std::get<field_ids::index_of(f)>(r);
325 template <field f,
typename field_types,
typename field_
ids>
328 static_assert(
field_ids::contains(f),
"The record does not contain the field you wish to retrieve.");
329 return std::get<field_ids::index_of(f)>(r);
333 template <field f,
typename field_types,
typename field_
ids>
336 static_assert(
field_ids::contains(f),
"The record does not contain the field you wish to retrieve.");
337 return std::get<field_ids::index_of(f)>(
std::move(r));
341 template <field f,
typename field_types,
typename field_
ids>
344 static_assert(
field_ids::contains(f),
"The record does not contain the field you wish to retrieve.");
345 return std::get<field_ids::index_of(f)>(
std::move(r));
field
An enumerator for the fields used in file formats.
Definition: record.hpp:65
@ energy
Energy of a folded sequence, represented by one float number.
@ comment
Comment field of arbitrary content, usually a string.
@ CIGAR
Please use the field name in lower case.
@ structure
Fixed interactions, usually a string of structure alphabet characters.
@ bpp
Base pair probability matrix of interactions, usually a matrix of float numbers.
@ FLAG
Please use the field name in lower case.
@ REF_SEQ
Please use the field name in lower case.
@ OFFSET
Please use the field name in lower case.
@ react
Reactivity values of the sequence characters given in a vector of float numbers.
@ flag
The alignment flag (bit information), uint16_t value.
@ USER_DEFINED_6
Please use the field name in lower case.
@ TAGS
Please use the field name in lower case.
@ react_err
Reactivity error values given in a vector corresponding to REACT.
@ QUAL
Please use the field name in lower case.
@ USER_DEFINED_8
Please use the field name in lower case.
@ MATE
Please use the field name in lower case.
@ ref_offset
Sequence (REF_SEQ) relative start position (0-based), unsigned value.
@ ref_seq
The (reference) "sequence" information, usually a range of nucleotides or amino acids.
@ SEQ
Please use the field name in lower case.
@ alignment
The (pairwise) alignment stored in an seqan3::alignment object.
@ cigar
The cigar vector (std::vector<seqan3::cigar>) representing the alignment in SAM/BAM format.
@ mapq
The mapping quality of the SEQ alignment, usually a ohred-scaled score.
@ user_defined_2
Identifier for user defined file formats and specialisations.
@ user_defined_5
Identifier for user defined file formats and specialisations.
@ STRUCTURE
Please use the field name in lower case.
@ USER_DEFINED_2
Please use the field name in lower case.
@ REACT_ERR
Please use the field name in lower case.
@ bit_score
The bit score (statistical significance indicator), unsigned value.
@ user_defined_0
Identifier for user defined file formats and specialisations.
@ user_defined_8
Identifier for user defined file formats and specialisations.
@ STRUCTURED_SEQ
Please use the field name in lower case.
@ user_defined_3
Identifier for user defined file formats and specialisations.
@ offset
Sequence (SEQ) relative start position (0-based), unsigned value.
@ MAPQ
Please use the field name in lower case.
@ mate
The mate pair information given as a std::tuple of reference name, offset and template length.
@ SEQ_QUAL
Please use the field name in lower case.
@ header_ptr
A pointer to the seqan3::alignment_file_header object storing header information.
@ user_defined_7
Identifier for user defined file formats and specialisations.
@ user_defined_4
Identifier for user defined file formats and specialisations.
@ ENERGY
Please use the field name in lower case.
@ ref_id
The identifier of the (reference) sequence that SEQ was aligned to.
@ BIT_SCORE
Please use the field name in lower case.
@ REACT
Please use the field name in lower case.
@ structured_seq
Sequence and fixed interactions combined in one range.
@ ALIGNMENT
Please use the field name in lower case.
@ HEADER_PTR
Please use the field name in lower case.
@ evalue
The e-value (length normalized bit score), double value.
@ ID
Please use the field name in lower case.
@ id
The identifier, usually a string.
@ USER_DEFINED_1
Please use the field name in lower case.
@ REF_OFFSET
Please use the field name in lower case.
@ user_defined_6
Identifier for user defined file formats and specialisations.
@ USER_DEFINED_3
Please use the field name in lower case.
@ seq_qual
Sequence and qualities combined in one range.
@ tags
The optional tags in the SAM format, stored in a dictionary.
@ user_defined_1
Identifier for user defined file formats and specialisations.
@ user_defined_9
Identifier for user defined file formats and specialisations.
@ seq
The "sequence", usually a range of nucleotides or amino acids.
@ USER_DEFINED_9
Please use the field name in lower case.
@ USER_DEFINED_5
Please use the field name in lower case.
@ USER_DEFINED_7
Please use the field name in lower case.
@ qual
The qualities, usually in phred-score notation.
@ BPP
Please use the field name in lower case.
@ COMMENT
Please use the field name in lower case.
@ EVALUE
Please use the field name in lower case.
@ REF_ID
Please use the field name in lower case.
@ USER_DEFINED_4
Please use the field name in lower case.
@ USER_DEFINED_0
Please use the field name in lower case.
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:116
constexpr bool contains
Whether a type occurs in a pack or not.
Definition: traits.hpp:193
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:68
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.
A class template that holds a choice of seqan3::field.
Definition: record.hpp:166
The class template that file records are based on; behaves like an std::tuple.
Definition: record.hpp:226
auto & get(record< field_types, field_ids > &r)
Free function get() for seqan3::record based on seqan3::field.
Definition: record.hpp:318
auto && get(record< field_types, field_ids > &&r)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: record.hpp:334
record(record &&)=default
Defaulted.
record & operator=(record &&)=default
Defaulted.
void clear() noexcept(noexcept(std::apply(expander, std::declval< record & >())))
Clears containers that provide .clear() and (re-)initialises all other elements with = {}.
Definition: record.hpp:270
~record()=default
Defaulted.
detail::transfer_template_args_onto_t< field_types, std::tuple > base_type
A specialisation of std::tuple.
Definition: record.hpp:250
auto const & get(record< field_types, field_ids > const &r)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: record.hpp:326
record & operator=(record const &)=default
Defaulted.
record()=default
Defaulted.
auto const && get(record< field_types, field_ids > const &&r)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: record.hpp:342
record(record const &)=default
Defaulted.
std::tuple_element_t< elem_no, typename seqan3::record< field_types, field_ids >::base_type > type
The member type. Delegates to same type on base_type.
Definition: record.hpp:302
Provides seqan3::type_list and auxiliary type traits.
Provides seqan3::type_list.