44 #include <meta/meta.hpp> 135 template <
field ...fs>
140 static constexpr std::array<
field,
sizeof...(fs)> as_array{fs...};
143 static constexpr
size_t npos = std::numeric_limits<size_t>::max();
146 static constexpr
size_t index_of(field f)
148 for (
size_t i = 0; i <
sizeof...(fs); ++i)
149 if (as_array[i] == f)
155 static constexpr
bool contains(field f)
157 return index_of(f) != npos;
160 static_assert([] () constexpr
162 for (
size_t i = 0; i < as_array.size(); ++i)
163 for (
size_t j = i + 1; j < as_array.size(); ++j)
164 if (as_array[i] == as_array[j])
168 } (),
"You may not include a field twice into fields<>.");
207 template <
typename field_types,
typename field_
ids>
208 struct record : detail::transfer_template_args_onto_t<field_types, std::tuple>
212 using base_type = detail::transfer_template_args_onto_t<field_types, std::tuple>;
225 using base_type::base_type;
229 "You must give as many IDs as types to seqan3::record.");
238 template <
size_t ...Is>
239 constexpr
void clear_impl(
base_type & tup, std::integer_sequence<size_t, Is...>
const &)
241 ((std::get<Is>(tup) = {}), ...);
253 template <
typename field_types,
typename field_
ids>
254 struct tuple_size<
seqan3::record<field_types, field_ids>>
257 static constexpr
size_t value = tuple_size_v<typename seqan3::record<field_types, field_ids>::base_type>;
263 template <
size_t elem_no,
typename field_types,
typename field_
ids>
264 struct tuple_element<elem_no,
seqan3::record<field_types, field_ids>>
267 using type = std::tuple_element_t<elem_no, typename seqan3::record<field_types, field_ids>::base_type>;
280 template <field f,
typename field_types,
typename field_
ids>
281 auto &
get(record<field_types, field_ids> & r)
283 static_assert(field_ids::contains(f),
"The record does not contain the field you wish to retrieve.");
284 return std::get<field_ids::index_of(f)>(r);
287 template <field f,
typename field_types,
typename field_
ids>
288 auto const &
get(record<field_types, field_ids>
const & r)
290 static_assert(field_ids::contains(f),
"The record does not contain the field you wish to retrieve.");
291 return std::get<field_ids::index_of(f)>(r);
294 template <field f,
typename field_types,
typename field_
ids>
295 auto &&
get(record<field_types, field_ids> && r)
297 static_assert(field_ids::contains(f),
"The record does not contain the field you wish to retrieve.");
298 return std::get<field_ids::index_of(f)>(std::move(r));
301 template <field f,
typename field_types,
typename field_
ids>
302 auto const &&
get(record<field_types, field_ids>
const && r)
304 static_assert(field_ids::contains(f),
"The record does not contain the field you wish to retrieve.");
305 return std::get<field_ids::index_of(f)>(std::move(r));
The (reference) "sequence" information, usually a range of nucleotides or amino acids.
The "sequence", usually a range of nucleotides or amino acids.
Sequence and fixed interactions combined in one range.
Energy of a folded sequence, represented by one float number.
The (pairwise) alignment stored in an seqan3::alignment object.
The alignment flag (bit information), uint16_t value.
The class template that file records are based on; behaves like an std::tuple.
Definition: record.hpp:208
Provides seqan3::type_list and auxiliary metafunctions.
Comment field of arbitrary content, usually a string.
Identifier for user defined file formats and specialisations.
SeqAn specific customisations in the standard namespace.
Definition: align_result.hpp:221
Identifier for user defined file formats and specialisations.
::ranges::size size
Alias for ranges::size. Obtains the size of a range whose size can be calculated in constant time...
Definition: ranges:195
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
Identifier for user defined file formats and specialisations.
The qualities, usually in phred-score notation.
The e-value (length normalized bit score), double value.
Base pair probability matrix of interactions, usually a matrix of float numbers.
Sequence (REF_SEQ) relative start position (0-based), unsigned value.
A class template that holds a choice of seqan3::field.
Definition: record.hpp:136
Sequence and qualities combined in one range.
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:267
Provides seqan3::type_list and auxiliary metafunctions.
Reactivity error values given in a vector corresponding to REACT.
Identifier for user defined file formats and specialisations.
Sequence (SEQ) relative start position (0-based), unsigned value.
The identifier, usually a string.
void clear()
(Re-)Initialise all tuple elements with {}.
Definition: record.hpp:232
The mate pair information given as a std::tuple of reference name, offset and template length...
Fixed interactions, usually a string of structure alphabet characters.
The identifier of the (reference) sequence that SEQ was aligned to.
A pointer to the seqan3::alignment_file_header object storing header information. ...
Identifier for user defined file formats and specialisations.
Identifier for user defined file formats and specialisations.
Identifier for user defined file formats and specialisations.
field
An enumerator for the fields used in file formats.Some of the fields are shared between formats...
Definition: record.hpp:63
The optional tags in the SAM format, stored in a dictionary.
detail::transfer_template_args_onto_t< field_types, std::tuple > base_type
A specialisation of std::tuple.
Definition: record.hpp:212
Identifier for user defined file formats and specialisations.
Identifier for user defined file formats and specialisations.
Reactivity values of the sequence characters given in a vector of float numbers.
The bit score (statistical significance indicator), unsigned value.
The mapping quality of the SEQ alignment, usually a ohred-scaled score.
Identifier for user defined file formats and specialisations.