84 template <
typename stream_type,
85 typename seq_legal_alph_type,
86 typename ref_seqs_type,
87 typename ref_ids_type,
91 typename ref_seq_type,
93 typename ref_offset_type,
100 typename tag_dict_type,
101 typename e_value_type,
102 typename bit_score_type>
105 ref_seqs_type & ref_seqs,
110 offset_type & offset,
111 ref_seq_type & SEQAN3_DOXYGEN_ONLY(ref_seq),
112 ref_id_type & ref_id,
113 ref_offset_type & ref_offset,
115 cigar_type & cigar_vector,
119 tag_dict_type & tag_dict,
120 e_value_type & SEQAN3_DOXYGEN_ONLY(e_value),
121 bit_score_type & SEQAN3_DOXYGEN_ONLY(bit_score));
123 template <
typename stream_type,
124 typename header_type,
127 typename ref_seq_type,
128 typename ref_id_type,
133 typename tag_dict_type>
136 [[maybe_unused]] header_type && header,
137 [[maybe_unused]] seq_type && seq,
138 [[maybe_unused]] qual_type && qual,
139 [[maybe_unused]] id_type &&
id,
140 [[maybe_unused]] int32_t
const offset,
141 [[maybe_unused]] ref_seq_type && SEQAN3_DOXYGEN_ONLY(ref_seq),
142 [[maybe_unused]] ref_id_type && ref_id,
144 [[maybe_unused]] align_type && align,
145 [[maybe_unused]] cigar_type && cigar_vector,
146 [[maybe_unused]]
sam_flag const flag,
147 [[maybe_unused]] uint8_t
const mapq,
148 [[maybe_unused]] mate_type && mate,
149 [[maybe_unused]] tag_dict_type && tag_dict,
150 [[maybe_unused]]
double SEQAN3_DOXYGEN_ONLY(e_value),
151 [[maybe_unused]]
double SEQAN3_DOXYGEN_ONLY(bit_score));
187 ret[
static_cast<index_t
>(
'I')] = 1;
188 ret[
static_cast<index_t
>(
'D')] = 2;
189 ret[
static_cast<index_t
>(
'N')] = 3;
190 ret[
static_cast<index_t
>(
'S')] = 4;
191 ret[
static_cast<index_t
>(
'H')] = 5;
192 ret[
static_cast<index_t
>(
'P')] = 6;
193 ret[
static_cast<index_t
>(
'=')] = 7;
194 ret[
static_cast<index_t
>(
'X')] = 8;
201 static uint16_t
reg2bin(int32_t beg, int32_t end) noexcept
204 if (beg >> 14 == end >> 14)
return ((1 << 15) - 1) / 7 + (beg >> 14);
205 if (beg >> 17 == end >> 17)
return ((1 << 12) - 1) / 7 + (beg >> 17);
206 if (beg >> 20 == end >> 20)
return ((1 << 9) - 1) / 7 + (beg >> 20);
207 if (beg >> 23 == end >> 23)
return ((1 << 6) - 1) / 7 + (beg >> 23);
208 if (beg >> 26 == end >> 26)
return ((1 << 3) - 1) / 7 + (beg >> 26);
212 using format_sam_base::read_field;
220 template <
typename stream_view_type, std::
integral number_type>
221 void read_field(stream_view_type && stream_view, number_type & target)
223 std::ranges::copy_n(std::ranges::begin(stream_view),
sizeof(target),
reinterpret_cast<char *
>(&target));
231 template <
typename stream_view_type>
232 void read_field(stream_view_type && stream_view,
float & target)
234 std::ranges::copy_n(std::ranges::begin(stream_view),
sizeof(int32_t),
reinterpret_cast<char *
>(&target));
247 template <
typename stream_view_type,
typename optional_value_type>
250 optional_value_type tmp;
251 read_field(std::forward<stream_view_type>(stream_view), tmp);
255 template <
typename stream_view_type,
typename value_type>
257 stream_view_type && stream_view,
258 value_type const & SEQAN3_DOXYGEN_ONLY(value));
260 template <
typename stream_view_type>
263 template <
typename cigar_input_type>
270 template <
typename stream_type,
271 typename seq_legal_alph_type,
272 typename ref_seqs_type,
273 typename ref_ids_type,
276 typename offset_type,
277 typename ref_seq_type,
278 typename ref_id_type,
279 typename ref_offset_type,
286 typename tag_dict_type,
287 typename e_value_type,
288 typename bit_score_type>
291 ref_seqs_type & ref_seqs,
296 offset_type & offset,
297 ref_seq_type & SEQAN3_DOXYGEN_ONLY(ref_seq),
298 ref_id_type & ref_id,
299 ref_offset_type & ref_offset,
301 cigar_type & cigar_vector,
305 tag_dict_type & tag_dict,
306 e_value_type & SEQAN3_DOXYGEN_ONLY(e_value),
307 bit_score_type & SEQAN3_DOXYGEN_ONLY(bit_score))
309 static_assert(detail::decays_to_ignore_v<ref_offset_type> ||
310 detail::is_type_specialisation_of_v<ref_offset_type, std::optional>,
311 "The ref_offset must be a specialisation of std::optional.");
313 static_assert(detail::decays_to_ignore_v<mapq_type> || std::same_as<mapq_type, uint8_t>,
314 "The type of field::mapq must be uint8_t.");
316 static_assert(detail::decays_to_ignore_v<flag_type> || std::same_as<flag_type, sam_flag>,
317 "The type of field::flag must be seqan3::sam_flag.");
322 [[maybe_unused]] int32_t offset_tmp{};
323 [[maybe_unused]] int32_t soft_clipping_end{};
325 [[maybe_unused]] int32_t ref_length{0}, seq_length{0};
344 for (int32_t ref_idx = 0; ref_idx < n_ref; ++ref_idx)
349 std::ranges::copy_n(std::ranges::begin(stream_view), tmp32 - 1,
string_buffer.
data());
350 std::ranges::next(std::ranges::begin(stream_view));
360 "' found in BAM file header (header.ref_ids():",
363 else if (id_it->second != ref_idx)
366 " does not correspond to the position ", id_it->second,
367 " in the header (header.ref_ids():", header.
ref_ids(),
").")};
369 else if (std::get<0>(header.
ref_id_info[id_it->second]) != tmp32)
371 throw format_error{
"Provided reference has unequal length as specified in the header."};
377 if (std::ranges::begin(stream_view) == std::ranges::end(stream_view))
386 if (core.
refID >=
static_cast<int32_t
>(header.
ref_ids().size()) || core.
refID < -1)
389 "header.ref_ids(), which has size ", header.
ref_ids().size(),
".")};
391 else if (core.
refID > -1)
402 if constexpr (!detail::decays_to_ignore_v<mate_type>)
416 std::ranges::next(std::ranges::begin(stream_view));
420 if constexpr (!detail::decays_to_ignore_v<align_type> || !detail::decays_to_ignore_v<cigar_type>)
437 auto seq_stream = stream_view
445 if constexpr (detail::decays_to_ignore_v<seq_type>)
447 if constexpr (!detail::decays_to_ignore_v<align_type>)
450 "If you want to read ALIGNMENT but not SEQ, the alignment"
451 " object must store a sequence container at the second (query) position.");
453 if (!tmp_cigar_vector.empty())
455 assert(core.
l_seq == (seq_length + offset_tmp + soft_clipping_end));
456 using alph_t = std::ranges::range_value_t<decltype(get<1>(align))>;
457 constexpr
auto from_dna16 = detail::convert_through_char_representation<alph_t, sam_dna16>;
459 get<1>(align).reserve(seq_length);
461 auto tmp_iter = std::ranges::begin(seq_stream);
462 std::ranges::advance(tmp_iter, offset_tmp / 2);
466 get<1>(align).push_back(from_dna16[
to_rank(get<1>(*tmp_iter))]);
471 for (
size_t i = (seq_length / 2); i > 0; --i)
473 get<1>(align).push_back(from_dna16[
to_rank(get<0>(*tmp_iter))]);
474 get<1>(align).push_back(from_dna16[
to_rank(get<1>(*tmp_iter))]);
480 get<1>(align).push_back(from_dna16[
to_rank(get<0>(*tmp_iter))]);
485 std::ranges::advance(tmp_iter, (soft_clipping_end + !(seq_length & 1)) / 2);
496 std::ranges::next(std::ranges::begin(stream_view));
501 using alph_t = std::ranges::range_value_t<decltype(
seq)>;
502 constexpr
auto from_dna16 = detail::convert_through_char_representation<alph_t, sam_dna16>;
504 for (
auto [d1, d2] : seq_stream)
514 std::ranges::next(std::ranges::begin(stream_view));
517 if constexpr (!detail::decays_to_ignore_v<align_type>)
519 assign_unaligned(get<1>(align),
520 seq |
views::slice(
static_cast<std::ranges::range_difference_t<seq_type>
>(offset_tmp),
521 std::ranges::distance(
seq) - soft_clipping_end));
535 assert(remaining_bytes >= 0);
538 while (tags_view.size() > 0)
543 if constexpr (!detail::decays_to_ignore_v<align_type> || !detail::decays_to_ignore_v<cigar_type>)
548 if (core.
l_seq != 0 && offset_tmp == core.
l_seq)
550 if constexpr (detail::decays_to_ignore_v<tag_dict_type> | detail::decays_to_ignore_v<seq_type>)
553 "N' suggests that the cigar string exceeded 65535 elements and was therefore ",
554 "stored in the optional field CG. You need to read in the field::tags and "
555 "field::seq in order to access this information.")};
559 auto it = tag_dict.
find(
"CG"_tag);
561 if (it == tag_dict.end())
563 "N' suggests that the cigar string exceeded 65535 elements and was therefore ",
564 "stored in the optional field CG but this tag is not present in the given ",
567 auto cigar_view = std::views::all(std::get<std::string>(it->second));
569 offset_tmp = soft_clipping_end = 0;
573 if constexpr (!detail::decays_to_ignore_v<align_type>)
575 assign_unaligned(get<1>(align),
576 seq |
views::slice(
static_cast<std::ranges::range_difference_t<seq_type>
>(offset_tmp),
577 std::ranges::distance(
seq) - soft_clipping_end));
584 if constexpr (!detail::decays_to_ignore_v<align_type>)
587 if constexpr (!detail::decays_to_ignore_v<cigar_type>)
588 std::swap(cigar_vector, tmp_cigar_vector);
592 template <
typename stream_type,
593 typename header_type,
596 typename ref_seq_type,
597 typename ref_id_type,
602 typename tag_dict_type>
605 [[maybe_unused]] header_type && header,
606 [[maybe_unused]] seq_type && seq,
607 [[maybe_unused]] qual_type && qual,
608 [[maybe_unused]] id_type &&
id,
609 [[maybe_unused]] int32_t
const offset,
610 [[maybe_unused]] ref_seq_type && SEQAN3_DOXYGEN_ONLY(ref_seq),
611 [[maybe_unused]] ref_id_type && ref_id,
613 [[maybe_unused]] align_type && align,
614 [[maybe_unused]] cigar_type && cigar_vector,
615 [[maybe_unused]]
sam_flag const flag,
616 [[maybe_unused]] uint8_t
const mapq,
617 [[maybe_unused]] mate_type && mate,
618 [[maybe_unused]] tag_dict_type && tag_dict,
619 [[maybe_unused]]
double SEQAN3_DOXYGEN_ONLY(e_value),
620 [[maybe_unused]]
double SEQAN3_DOXYGEN_ONLY(bit_score))
625 static_assert((std::ranges::forward_range<seq_type> &&
626 alphabet<std::ranges::range_reference_t<seq_type>>),
627 "The seq object must be a std::ranges::forward_range over "
628 "letters that model seqan3::alphabet.");
630 static_assert((std::ranges::forward_range<id_type> &&
631 alphabet<std::ranges::range_reference_t<id_type>>),
632 "The id object must be a std::ranges::forward_range over "
633 "letters that model seqan3::alphabet.");
635 static_assert((std::ranges::forward_range<ref_seq_type> &&
636 alphabet<std::ranges::range_reference_t<ref_seq_type>>),
637 "The ref_seq object must be a std::ranges::forward_range "
638 "over letters that model seqan3::alphabet.");
640 if constexpr (!detail::decays_to_ignore_v<ref_id_type>)
642 static_assert((std::ranges::forward_range<ref_id_type> ||
645 "The ref_id object must be a std::ranges::forward_range "
646 "over letters that model seqan3::alphabet or an integral or a std::optional<integral>.");
650 "The align object must be a std::pair of two ranges whose "
651 "value_type is comparable to seqan3::gap");
654 std::equality_comparable_with<
gap, std::ranges::range_reference_t<decltype(std::get<0>(align))>> &&
655 std::equality_comparable_with<
gap, std::ranges::range_reference_t<decltype(std::get<1>(align))>>),
656 "The align object must be a std::pair of two ranges whose "
657 "value_type is comparable to seqan3::gap");
659 static_assert((std::ranges::forward_range<qual_type> &&
660 alphabet<std::ranges::range_reference_t<qual_type>>),
661 "The qual object must be a std::ranges::forward_range "
662 "over letters that model seqan3::alphabet.");
665 "The mate object must be a std::tuple of size 3 with "
666 "1) a std::ranges::forward_range with a value_type modelling seqan3::alphabet, "
667 "2) a std::integral or std::optional<std::integral>, and "
668 "3) a std::integral.");
670 static_assert(((std::ranges::forward_range<decltype(std::get<0>(
mate))> ||
676 "The mate object must be a std::tuple of size 3 with "
677 "1) a std::ranges::forward_range with a value_type modelling seqan3::alphabet, "
678 "2) a std::integral or std::optional<std::integral>, and "
679 "3) a std::integral.");
682 "The tag_dict object must be of type seqan3::sam_tag_dictionary.");
684 if constexpr (detail::decays_to_ignore_v<header_type>)
686 throw format_error{
"BAM can only be written with a header but you did not provide enough information! "
687 "You can either construct the output file with ref_ids and ref_seqs information and "
688 "the header will be created for you, or you can access the `header` member directly."};
709 int32_t l_text{
static_cast<int32_t
>(os.
str().size())};
710 std::ranges::copy_n(
reinterpret_cast<char *
>(&l_text), 4, stream_it);
714 int32_t n_ref{
static_cast<int32_t
>(header.
ref_ids().size())};
715 std::ranges::copy_n(
reinterpret_cast<char *
>(&n_ref), 4, stream_it);
717 for (int32_t ridx = 0; ridx < n_ref; ++ridx)
719 int32_t l_name{
static_cast<int32_t
>(header.
ref_ids()[ridx].size()) + 1};
720 std::ranges::copy_n(
reinterpret_cast<char *
>(&l_name), 4, stream_it);
722 std::ranges::copy(header.
ref_ids()[ridx].begin(), header.
ref_ids()[ridx].end(), stream_it);
725 std::ranges::copy_n(
reinterpret_cast<char *
>(&get<0>(header.
ref_id_info[ridx])), 4, stream_it);
734 int32_t ref_length{};
738 if (!std::ranges::empty(cigar_vector))
740 int32_t dummy_seq_length{};
741 for (
auto & [
count, operation] : cigar_vector)
744 else if (!std::ranges::empty(get<0>(align)) && !std::ranges::empty(get<1>(align)))
746 ref_length = std::ranges::distance(get<1>(align));
752 int32_t off_end{
static_cast<int32_t
>(std::ranges::distance(
seq)) -
offset};
754 for (
auto chr : get<1>(align))
758 off_end -= ref_length;
762 if (cigar_vector.size() >= (1 << 16))
765 cigar_vector.resize(2);
766 cigar_vector[0] =
cigar{
static_cast<uint32_t
>(std::ranges::distance(
seq)),
'S'_cigar_operation};
767 cigar_vector[1] =
cigar{
static_cast<uint32_t
>(std::ranges::distance(get<1>(align))),
'N'_cigar_operation};
777 uint8_t read_name_size = std::min<uint8_t>(std::ranges::distance(
id), 254) + 1;
778 read_name_size +=
static_cast<uint8_t
>(read_name_size == 1);
788 static_cast<uint16_t
>(cigar_vector.size()),
790 static_cast<int32_t
>(std::ranges::distance(
seq)),
792 get<1>(
mate).value_or(-1),
796 auto check_and_assign_id_to = [&header] ([[maybe_unused]]
auto & id_source,
797 [[maybe_unused]]
auto & id_target)
801 if constexpr (!detail::decays_to_ignore_v<id_t>)
803 if constexpr (std::integral<id_t>)
805 id_target = id_source;
807 else if constexpr (detail::is_type_specialisation_of_v<id_t, std::optional>)
809 id_target = id_source.value_or(-1);
813 if (!std::ranges::empty(id_source))
817 if constexpr (std::ranges::contiguous_range<decltype(id_source)> &&
818 std::ranges::sized_range<decltype(id_source)> &&
819 std::ranges::borrowed_range<decltype(id_source)>)
829 "The ref_id type is not convertible to the reference id information stored in the "
830 "reference dictionary of the header object.");
832 id_it = header.
ref_dict.find(id_source);
838 "not be found in BAM header ref_dict: ",
842 id_target = id_it->second;
849 check_and_assign_id_to(
ref_id, core.refID);
852 check_and_assign_id_to(get<0>(
mate), core.next_refID);
855 core.block_size =
sizeof(core) - 4 +
857 core.n_cigar_op * 4 +
858 (core.l_seq + 1) / 2 +
860 tag_dict_binary_str.
size();
862 std::ranges::copy_n(
reinterpret_cast<char *
>(&core),
sizeof(core), stream_it);
864 if (std::ranges::empty(
id))
867 std::ranges::copy_n(std::ranges::begin(
id), core.l_read_name - 1, stream_it);
871 for (
auto [cigar_count, op] : cigar_vector)
873 cigar_count = cigar_count << 4;
875 std::ranges::copy_n(
reinterpret_cast<char *
>(&cigar_count), 4, stream_it);
879 using alph_t = std::ranges::range_value_t<seq_type>;
880 constexpr
auto to_dna16 = detail::convert_through_char_representation<sam_dna16, alph_t>;
882 auto sit = std::ranges::begin(
seq);
883 for (int32_t sidx = 0; sidx < ((core.l_seq & 1) ? core.l_seq - 1 : core.l_seq); ++sidx, ++sit)
888 stream_it =
static_cast<char>(compressed_chr);
892 stream_it =
static_cast<char>(
to_rank(to_dna16[
to_rank(*sit)]) << 4);
895 if (std::ranges::empty(
qual))
898 std::ranges::copy_n(v.begin(), core.l_seq, stream_it);
902 if (std::ranges::distance(
qual) != core.l_seq)
904 core.l_seq,
". Got quality with size ",
905 std::ranges::distance(
qual),
" instead.")};
908 std::ranges::copy_n(v.begin(), core.l_seq, stream_it);
912 stream << tag_dict_binary_str;
917 template <
typename stream_view_type,
typename value_type>
919 stream_view_type && stream_view,
920 value_type const & SEQAN3_DOXYGEN_ONLY(value))
954 template <
typename stream_view_type>
963 auto it = std::ranges::begin(stream_view);
964 uint16_t tag =
static_cast<uint16_t
>(*it) << 8;
967 tag +=
static_cast<uint16_t
>(*it);
986 target[tag] =
static_cast<int32_t
>(tmp);
993 target[tag] =
static_cast<int32_t
>(tmp);
1000 target[tag] =
static_cast<int32_t
>(tmp);
1007 target[tag] =
static_cast<int32_t
>(tmp);
1021 target[tag] =
static_cast<int32_t
>(tmp);
1034 while (!is_char<'\0'>(*it))
1051 char array_value_type_id = *it;
1054 switch (array_value_type_id)
1079 "must be one of [cCsSiIf] but '", array_value_type_id,
"' was given.")};
1085 "SAM tag must be one of [A,i,Z,H,B,f] but '", type_id,
"' was given.")};
1103 template <
typename cigar_input_type>
1107 char operation{
'\0'};
1109 int32_t ref_length{}, seq_length{};
1110 uint32_t operation_and_count{};
1111 constexpr
char const * cigar_mapping =
"MIDNSHP=X*******";
1112 constexpr uint32_t cigar_mask = 0x0f;
1114 if (n_cigar_op == 0)
1115 return std::tuple{operations, ref_length, seq_length};
1119 while (n_cigar_op > 0)
1121 std::ranges::copy_n(std::ranges::begin(cigar_input),
1122 sizeof(operation_and_count),
1123 reinterpret_cast<char*
>(&operation_and_count));
1124 operation = cigar_mapping[operation_and_count & cigar_mask];
1125 count = operation_and_count >> 4;
1132 return std::tuple{operations, ref_length, seq_length};
1142 auto stream_variant_fn = [&result] (
auto && arg)
1147 if constexpr (std::same_as<T, int32_t>)
1150 size_t const absolute_arg = std::abs(arg);
1152 bool const negative = arg < 0;
1153 n = n * n + 2 * negative;
1159 result[result.size() - 1] =
'C';
1160 result.append(
reinterpret_cast<char const *
>(&arg), 1);
1165 result[result.size() - 1] =
'S';
1166 result.append(
reinterpret_cast<char const *
>(&arg), 2);
1171 result[result.size() - 1] =
'c';
1172 int8_t tmp =
static_cast<int8_t
>(arg);
1173 result.append(
reinterpret_cast<char const *
>(&tmp), 1);
1178 result[result.size() - 1] =
's';
1179 int16_t tmp =
static_cast<int16_t
>(arg);
1180 result.append(
reinterpret_cast<char const *
>(&tmp), 2);
1185 result.append(
reinterpret_cast<char const *
>(&arg), 4);
1190 else if constexpr (std::same_as<T, std::string>)
1192 result.append(
reinterpret_cast<char const *
>(arg.data()), arg.size() + 1);
1194 else if constexpr (!std::ranges::range<T>)
1196 result.append(
reinterpret_cast<char const *
>(&arg),
sizeof(arg));
1200 int32_t sz{
static_cast<int32_t
>(arg.size())};
1201 result.append(
reinterpret_cast<char *
>(&sz), 4);
1202 result.append(
reinterpret_cast<char const *
>(arg.data()),
1203 arg.size() *
sizeof(std::ranges::range_value_t<T>));
1207 for (
auto & [tag, variant] : tag_dict)
1209 result.push_back(
static_cast<char>(tag / 256));
1210 result.push_back(
static_cast<char>(tag % 256));
Provides seqan3::alignment_file_output_options.
Provides seqan3::detail::convert_through_char_representation.
Provides the C++20 <bit> header if it is not already available.
constexpr derived_type & assign_char(char_type const c) noexcept
Assign from a character, implicitly converts invalid characters.
Definition: alphabet_base.hpp:158
constexpr derived_type & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition: alphabet_base.hpp:185
The seqan3::cigar semialphabet pairs a counter with a seqan3::cigar::operation letter.
Definition: cigar.hpp:59
Functionally the same as std::ostreambuf_iterator, but offers writing a range more efficiently.
Definition: fast_ostreambuf_iterator.hpp:39
The actual implementation of seqan3::cigar::operation for documentation purpose-only.
Definition: cigar_operation.hpp:48
The alphabet of a gap character '-'.
Definition: gap.hpp:37
A 16 letter DNA alphabet, containing all IUPAC symbols minus the gap and plus an equality sign ('=').
Definition: sam_dna16.hpp:46
The SAM tag dictionary class that stores all optional SAM fields.
Definition: sam_tag_dictionary.hpp:326
Provides various transformation traits used by the range module.
Auxiliary for pretty printing of exception messages.
Provides seqan3::debug_stream and related types.
Provides type traits for working with templates.
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
Provides seqan3::detail::fast_ostreambuf_iterator.
sam_flag
An enum flag that describes the properties of an aligned read (given as a SAM record).
Definition: misc.hpp:73
std::vector< cigar > get_cigar_vector(alignment_type &&alignment, uint32_t const query_start_pos=0, uint32_t const query_end_pos=0, bool const extended_cigar=false)
Creates a cigar string (SAM format) given a seqan3::detail::pairwise_alignment represented by two seq...
Definition: detail.hpp:138
std::string get_cigar_string(std::vector< cigar > const &cigar_vector)
Transforms a vector of cigar elements into a string representation.
Definition: detail.hpp:200
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:146
constexpr T bit_ceil(T x) noexcept
Calculates the smallest integral power of two that is not smaller than x.
Definition: bit:133
constexpr int countr_zero(T x) noexcept
Returns the number of consecutive 0 bits in the value of x, starting from the least significant bit (...
Definition: bit:199
@ flag
The alignment flag (bit information), uint16_t value.
@ ref_offset
Sequence (seqan3::field::ref_seq) relative start position (0-based), unsigned value.
@ mapq
The mapping quality of the seqan3::field::seq alignment, usually a Phred-scaled score.
@ offset
Sequence (seqan3::field::seq) relative start position (0-based), unsigned value.
@ mate
The mate pair information given as a std::tuple of reference name, offset and template length.
@ ref_id
The identifier of the (reference) sequence that seqan3::field::seq was aligned to.
@ seq
The "sequence", usually a range of nucleotides or amino acids.
@ qual
The qualities, usually in Phred score notation.
constexpr void consume(rng_t &&rng)
Iterate over a range (consumes single-pass input ranges).
Definition: misc.hpp:28
decltype(detail::transform< trait_t >(list_t{})) transform
Apply a transformation trait to every type in the list and return a seqan3::type_list of the results.
Definition: traits.hpp:434
constexpr ptrdiff_t count
Count the occurrences of a type in a pack.
Definition: traits.hpp:168
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:150
constexpr auto slice
A view adaptor that returns a half-open interval on the underlying range.
Definition: slice.hpp:141
constexpr auto istreambuf
A view factory that returns a view over the stream buffer of an input stream.
Definition: istreambuf.hpp:114
constexpr auto take_exactly_or_throw
A view adaptor that returns the first size elements from the underlying range and also exposes size i...
Definition: take_exactly.hpp:91
constexpr auto repeat_n
A view factory that repeats a given value n times.
Definition: repeat_n.hpp:94
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:70
Provides seqan3::detail::ignore_output_iterator for writing to null stream.
The generic alphabet concept that covers most data types used in ranges.
Resolves to std::ranges::implicitly_convertible_to<type1, type2>(). <dl class="no-api">This entity i...
A more refined container concept than seqan3::container.
Whether a type behaves like a tuple.
Auxiliary functions for the alignment IO.
Provides helper data structures for the seqan3::alignment_file_output.
Provides various utility functions.
Provides seqan3::views::istreambuf.
constexpr char sam_tag_type_char_extra[12]
Each types SAM tag type extra char id. Index corresponds to the seqan3::detail::sam_tag_variant types...
Definition: sam_tag_dictionary.hpp:38
constexpr char sam_tag_type_char[12]
Each SAM tag type char identifier. Index corresponds to the seqan3::detail::sam_tag_variant types.
Definition: sam_tag_dictionary.hpp:36
std::string to_string(value_type &&...values)
Streams all parameters via the seqan3::debug_stream and returns a concatenated string.
Definition: to_string.hpp:29
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Provides various utility functions.
Adaptations of concepts from the Ranges TS.
Provides seqan3::sam_dna16.
Provides the seqan3::sam_tag_dictionary class and auxiliaries.
Provides seqan3::views::slice.
The options type defines various option members that influence the behavior of all or some formats.
Definition: output_options.hpp:23
Exposes the value_type of another type.
Definition: pre.hpp:58
Provides seqan3::views::take_exactly and seqan3::views::take_exactly_or_throw.
Provides seqan3::views::take_until and seqan3::views::take_until_or_throw.
Provides character predicates for tokenisation.
Provides seqan3::tuple_like.