SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
sam_file/input.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 <cassert>
13#include <concepts>
14#include <filesystem>
15#include <fstream>
16#include <ranges>
17#include <string>
18#include <variant>
19#include <vector>
20
30#include <seqan3/io/detail/record.hpp>
43
44namespace seqan3
45{
46
47// ---------------------------------------------------------------------------------------------------------------------
48// sam_file_input_traits
49// ---------------------------------------------------------------------------------------------------------------------
50
109template <typename t>
110concept sam_file_input_traits = requires (t v) {
111 // field::seq
116
117 // field::id
119
120 // field::qual
123
124 // field::ref_seq
125 // either ref_info_not_given or a range over ranges over alphabet (e.g. std::vector<dna4_vector>)
126 requires std::same_as<typename t::ref_sequences, ref_info_not_given> || requires () {
128 };
129
130 // field::ref_id
132 && (!std::same_as<typename t::ref_sequences, ref_info_not_given>
134 std::ranges::range_reference_t<std::ranges::range_reference_t<typename t::ref_ids>>>);
135 requires std::ranges::forward_range<std::ranges::range_reference_t<typename t::ref_ids>>;
136 requires std::ranges::forward_range<typename t::ref_ids>;
137
138 // field::ref_offset is fixed to std::optional<int32_t>
139 // field::flag is fixed to seqan3::sam_flag
140 // field::mapq is fixed to uint8_t
141 // field::evalue is fixed to double
142 // field::bitscore is fixed to double
143 // field::mate is fixed to std::tuple<ref_id_container<ref_id_alphabet>, ref_offset_type, int32_t>
144};
146
147// ---------------------------------------------------------------------------------------------------------------------
148// sam_file_input_default_traits
149// ---------------------------------------------------------------------------------------------------------------------
150
166template <typename ref_sequences_t = ref_info_not_given, typename ref_ids_t = std::deque<std::string>>
168{
176
179
181 template <typename _sequence_alphabet>
183
185 template <typename _id_alphabet>
187
190
192 template <typename _quality_alphabet>
194
197
201};
202
203// ---------------------------------------------------------------------------------------------------------------------
204// sam_file_input
205// ---------------------------------------------------------------------------------------------------------------------
206
222template <sam_file_input_traits traits_type_ = sam_file_input_default_traits<>,
223 detail::fields_specialisation selected_field_ids_ = fields<field::seq,
224 field::id,
225 field::ref_id,
226 field::ref_offset,
227 field::cigar,
228 field::mapq,
229 field::qual,
230 field::flag,
231 field::mate,
232 field::tags,
233 field::header_ptr>,
234 detail::type_list_of_sam_file_input_formats valid_formats_ = type_list<format_sam, format_bam>>
236{
237public:
251
252private:
254 using dummy_ref_type = decltype(views::repeat_n(typename traits_type::sequence_alphabet{}, size_t{})
255 | std::views::transform(detail::access_restrictor_fn{}));
256
258 using ref_sequence_unsliced_type = detail::lazy_conditional_t<
259 std::ranges::range<typename traits_type::ref_sequences const>,
260 detail::lazy<std::ranges::range_reference_t, typename traits_type::ref_sequences const>,
261 dummy_ref_type>;
262
264 using ref_sequence_sliced_type = decltype(std::declval<ref_sequence_unsliced_type>() | views::slice(0, 0));
265
266public:
283 dummy_ref_type,
284 ref_sequence_sliced_type>;
301 using mapq_type = uint8_t;
312
315 id_type,
319 mapq_type,
321 flag_type,
322 mate_type,
324 header_type *>;
325
346 field::id,
356
357 static_assert(!selected_field_ids::contains(field::alignment),
358 "The seqan3::field::alignment was removed from the allowed fields for seqan3::sam_file_input. "
359 "Only seqan3::field::cigar is supported. Please see seqan3::alignment_from_cigar on how to get an "
360 "alignment from the cigar information.");
361
362 static_assert(!selected_field_ids::contains(field::offset),
363 "The field::offset is deprecated. Please access field::cigar and retrieve the soft clipping (S) "
364 "value at the front of the CIGAR string (offset = 0 if there is no soft clipping at the front).");
365
366 static_assert(
367 []() constexpr
368 {
369 for (field f : selected_field_ids::as_array)
370 if (!field_ids::contains(f))
371 return false;
372 return true;
373 }(),
374 "You selected a field that is not valid for SAM files, please refer to the documentation "
375 "of sam_file_input::field_ids for the accepted values.");
376
381
393 using size_type = size_t;
397 using iterator = detail::in_file_iterator<sam_file_input>;
401 using sentinel = std::default_sentinel_t;
403
408 sam_file_input() = delete;
418 ~sam_file_input() = default;
419
439 primary_stream{new std::ifstream{}, stream_deleter_default}
440 {
441 init_by_filename(std::move(filename));
442 }
443
463 template <input_stream stream_t, sam_file_input_format file_format>
464 requires std::same_as<typename std::remove_reference_t<stream_t>::char_type, stream_char_type>
468 primary_stream{&stream, stream_deleter_noop}
469 {
471 }
472
474 template <input_stream stream_t, sam_file_input_format file_format>
475 requires std::same_as<typename std::remove_reference_t<stream_t>::char_type, stream_char_type>
479 primary_stream{new stream_t{std::move(stream)}, stream_deleter_default}
480 {
482 }
483
513 typename traits_type::ref_ids & ref_ids,
514 typename traits_type::ref_sequences & ref_sequences,
516 primary_stream{new std::ifstream{}, stream_deleter_default}
517 {
518 // initialize reference information
519 set_references(ref_ids, ref_sequences);
520
521 init_by_filename(std::move(filename));
522 }
523
554 template <input_stream stream_t, sam_file_input_format file_format>
556 typename traits_type::ref_ids & ref_ids,
557 typename traits_type::ref_sequences & ref_sequences,
560 primary_stream{&stream, stream_deleter_noop}
561 {
562 // initialize reference information
563 set_references(ref_ids, ref_sequences);
564
566 }
567
569 template <input_stream stream_t, sam_file_input_format file_format>
571 typename traits_type::ref_ids & ref_ids,
572 typename traits_type::ref_sequences & ref_sequences,
575 primary_stream{new stream_t{std::move(stream)}, stream_deleter_default}
576 {
577 // initialize reference information
578 set_references(ref_ids, ref_sequences);
579
581 }
582
584 // explicitly delete rvalues for reference information
586 typename traits_type::ref_ids &&,
587 typename traits_type::ref_sequences &&,
588 selected_field_ids const &) = delete;
589
590 template <input_stream stream_t, sam_file_input_format file_format>
591 sam_file_input(stream_t &&,
592 typename traits_type::ref_ids &&,
593 typename traits_type::ref_sequences &&,
594 file_format const &,
595 selected_field_ids const &) = delete;
598
620 {
621 // buffer first record
622 if (!first_record_was_read)
623 {
624 read_next_record();
625 first_record_was_read = true;
626 }
627
628 return {*this};
629 }
630
645 {
646 return {};
647 }
648
673 {
674 return *begin();
675 }
677
680
694 {
695 // make sure header is read
696 if (!first_record_was_read)
697 {
698 read_next_record();
699 first_record_was_read = true;
700 }
701
702 return *header_ptr;
703 }
704
705protected:
707
709 void init_by_filename(std::filesystem::path filename)
710 {
711 primary_stream->rdbuf()->pubsetbuf(stream_buffer.data(), stream_buffer.size());
712 static_cast<std::basic_ifstream<char> *>(primary_stream.get())
713 ->open(filename, std::ios_base::in | std::ios::binary);
714 // open stream
715 if (!primary_stream->good())
716 throw file_open_error{"Could not open file " + filename.string() + " for reading."};
717
718 secondary_stream = detail::make_secondary_istream(*primary_stream, filename);
719 detail::set_format(format, filename);
720 }
721
723 template <typename format_type>
724 void init_by_format()
725 {
726 static_assert(list_traits::contains<format_type, valid_formats>,
727 "You selected a format that is not in the valid_formats of this file.");
728
729 format = detail::sam_file_input_format_exposer<format_type>{};
730 secondary_stream = detail::make_secondary_istream(*primary_stream);
731 }
732
735
740 record_type record_buffer;
742 std::vector<char> stream_buffer{std::vector<char>(1'000'000)};
744 std::streampos position_buffer{};
746
754 static void stream_deleter_noop(std::basic_istream<stream_char_type> *)
755 {}
757 static void stream_deleter_default(std::basic_istream<stream_char_type> * ptr)
758 {
759 delete ptr;
760 }
761
763 stream_ptr_t primary_stream{nullptr, stream_deleter_noop};
765 stream_ptr_t secondary_stream{nullptr, stream_deleter_noop};
766
768 bool first_record_was_read{false};
770 bool at_end{false};
771
773 using format_type = typename detail::variant_from_tags<valid_formats, detail::sam_file_input_format_exposer>::type;
774
776 format_type format;
778
783 typename traits_type::ref_sequences const * reference_sequences_ptr{nullptr};
784
797 template <std::ranges::forward_range ref_sequences_t>
798 void set_references(typename traits_type::ref_ids & ref_ids, ref_sequences_t && ref_sequences)
799 {
800 assert(std::ranges::distance(ref_ids) == std::ranges::distance(ref_sequences));
801
802 header_ptr = std::unique_ptr<header_type>{std::make_unique<header_type>(ref_ids)};
803 reference_sequences_ptr = &ref_sequences;
804
805 // initialise reference map and ref_dict if ref_ids are non-empty
806 for (int32_t idx = 0; idx < std::ranges::distance(ref_ids); ++idx)
807 {
808 header_ptr->ref_id_info.emplace_back(std::ranges::distance(ref_sequences[idx]), "");
809
810 if constexpr (std::ranges::contiguous_range<std::ranges::range_reference_t<typename traits_type::ref_ids>>
811 && std::ranges::sized_range<std::ranges::range_reference_t<typename traits_type::ref_ids>>
812 && std::ranges::borrowed_range<std::ranges::range_reference_t<typename traits_type::ref_ids>>)
813 {
814 auto && id = header_ptr->ref_ids()[idx];
815 header_ptr->ref_dict[std::span{std::ranges::data(id), std::ranges::size(id)}] = idx;
816 }
817 else
818 {
819 header_ptr->ref_dict[header_ptr->ref_ids()[idx]] = idx;
820 }
821 }
822 }
824
826 void read_next_record()
827 {
828 // clear the record
829 record_buffer.clear();
830 detail::get_or_ignore<field::header_ptr>(record_buffer) = header_ptr.get();
831
832 // at end if we could not read further
833 if (std::istreambuf_iterator<stream_char_type>{*secondary_stream}
835 {
836 at_end = true;
837 return;
838 }
839
840 auto call_read_func = [this](auto & ref_seq_info)
841 {
843 [&](auto & f)
844 {
845 f.read_alignment_record(*secondary_stream,
846 options,
847 ref_seq_info,
848 *header_ptr,
849 position_buffer,
850 detail::get_or_ignore<field::seq>(record_buffer),
851 detail::get_or_ignore<field::qual>(record_buffer),
852 detail::get_or_ignore<field::id>(record_buffer),
853 detail::get_or_ignore<field::ref_seq>(record_buffer),
854 detail::get_or_ignore<field::ref_id>(record_buffer),
855 detail::get_or_ignore<field::ref_offset>(record_buffer),
856 detail::get_or_ignore<field::cigar>(record_buffer),
857 detail::get_or_ignore<field::flag>(record_buffer),
858 detail::get_or_ignore<field::mapq>(record_buffer),
859 detail::get_or_ignore<field::mate>(record_buffer),
860 detail::get_or_ignore<field::tags>(record_buffer),
861 detail::get_or_ignore<field::evalue>(record_buffer),
862 detail::get_or_ignore<field::bit_score>(record_buffer));
863 },
864 format);
865 };
866
867 assert(!format.valueless_by_exception());
868
869 if constexpr (!std::same_as<typename traits_type::ref_sequences, ref_info_not_given>)
870 call_read_func(*reference_sequences_ptr);
871 else
872 call_read_func(std::ignore);
873 }
874
876 friend iterator;
877};
878
884template <input_stream stream_type, sam_file_input_format file_format, detail::fields_specialisation selected_field_ids>
886 -> sam_file_input<typename sam_file_input<>::traits_type, // actually use the default
889
891template <input_stream stream_type, sam_file_input_format file_format, detail::fields_specialisation selected_field_ids>
893 -> sam_file_input<typename sam_file_input<>::traits_type, // actually use the default
896
898template <input_stream stream_type, sam_file_input_format file_format>
900 -> sam_file_input<typename sam_file_input<>::traits_type, // actually use the default
901 typename sam_file_input<>::selected_field_ids, // actually use the default
903
905template <input_stream stream_type, sam_file_input_format file_format>
907 -> sam_file_input<typename sam_file_input<>::traits_type, // actually use the default
908 typename sam_file_input<>::selected_field_ids, // actually use the default
910
912template <std::ranges::forward_range ref_ids_t,
913 std::ranges::forward_range ref_sequences_t,
914 detail::fields_specialisation selected_field_ids>
919 typename sam_file_input<>::valid_formats>; // actually use the default
920
922template <std::ranges::forward_range ref_ids_t, std::ranges::forward_range ref_sequences_t>
926 typename sam_file_input<>::selected_field_ids, // actually use the default
927 typename sam_file_input<>::valid_formats>; // actually use the default
928
930template <input_stream stream_type,
931 std::ranges::forward_range ref_ids_t,
932 std::ranges::forward_range ref_sequences_t,
934 detail::fields_specialisation selected_field_ids>
940
942template <input_stream stream_type,
943 std::ranges::forward_range ref_ids_t,
944 std::ranges::forward_range ref_sequences_t,
946 detail::fields_specialisation selected_field_ids>
952
954template <input_stream stream_type,
955 std::ranges::forward_range ref_ids_t,
956 std::ranges::forward_range ref_sequences_t,
961 typename sam_file_input<>::selected_field_ids, // actually use the default
963
965template <input_stream stream_type,
966 std::ranges::forward_range ref_ids_t,
967 std::ranges::forward_range ref_sequences_t,
972 typename sam_file_input<>::selected_field_ids, // actually use the default
975
976} // namespace seqan3
Provides seqan3::aa27, container aliases and string literals.
Provides the seqan3::cigar alphabet.
Provides alphabet adaptations for standard char types.
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:79
debug_stream_type()=default
Defaulted.
The 15 letter DNA alphabet, containing all IUPAC smybols minus the gap.
Definition dna15.hpp:48
The five letter DNA alphabet of A,C,G,T and the unknown character N.
Definition dna5.hpp:48
Quality type for traditional Sanger and modern Illumina Phred scores.
Definition phred42.hpp:44
The generic concept for alignment file input formats.
Definition sam_file/input_format_concept.hpp:146
A class for reading SAM files, both SAM and its binary representation BAM are supported.
Definition sam_file/input.hpp:236
sam_file_input(std::filesystem::path path, ref_ids_t &, ref_sequences_t &) -> sam_file_input< sam_file_input_default_traits< std::remove_reference_t< ref_sequences_t >, std::remove_reference_t< ref_ids_t > >, typename sam_file_input<>::selected_field_ids, typename sam_file_input<>::valid_formats >
Deduce ref_sequences_t and ref_ids_t, default the rest.
sentinel end() noexcept
Returns a sentinel for comparison with iterator.
Definition sam_file/input.hpp:644
size_t size_type
An unsigned integer type, usually std::size_t.
Definition sam_file/input.hpp:393
std::optional< int32_t > ref_id_type
The type of field::ref_id is fixed to std::optional<int32_t>.
Definition sam_file/input.hpp:292
sam_file_input(std::filesystem::path path, ref_ids_t &, ref_sequences_t &, selected_field_ids const &) -> sam_file_input< sam_file_input_default_traits< std::remove_reference_t< ref_sequences_t >, std::remove_reference_t< ref_ids_t > >, selected_field_ids, typename sam_file_input<>::valid_formats >
Deduce selected fields, ref_sequences_t and ref_ids_t, default the rest.
char stream_char_type
Character type of the stream(s).
Definition sam_file/input.hpp:249
detail::in_file_iterator< sam_file_input > iterator
The iterator type of this view (an input iterator).
Definition sam_file/input.hpp:397
sam_file_input(stream_type &&stream, ref_ids_t &, ref_sequences_t &, file_format const &) -> sam_file_input< sam_file_input_default_traits< std::remove_reference_t< ref_sequences_t >, std::remove_reference_t< ref_ids_t > >, typename sam_file_input<>::selected_field_ids, type_list< file_format > >
Deduce ref_sequences_t and ref_ids_t, and file format.
sam_file_input(std::filesystem::path filename, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from filename.
Definition sam_file/input.hpp:437
sam_file_input(stream_type &stream, file_format const &) -> sam_file_input< typename sam_file_input<>::traits_type, typename sam_file_input<>::selected_field_ids, type_list< file_format > >
Deduce file_format, and default the rest.
std::default_sentinel_t sentinel
The type returned by end().
Definition sam_file/input.hpp:401
sam_file_input(stream_t &stream, typename traits_type::ref_ids &ref_ids, typename traits_type::ref_sequences &ref_sequences, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from an existing stream and with specified format.
Definition sam_file/input.hpp:555
typename traits_type::template sequence_container< typename traits_type::sequence_alphabet > sequence_type
The type of field::seq (default std::vector<seqan3::dna5>).
Definition sam_file/input.hpp:273
std::optional< int32_t > ref_offset_type
The type of field::ref_offset is fixed to a std::optional<int32_t>.
Definition sam_file/input.hpp:299
sam_file_input(stream_type &stream, ref_ids_t &, ref_sequences_t &, file_format const &) -> sam_file_input< sam_file_input_default_traits< std::remove_reference_t< ref_sequences_t >, std::remove_reference_t< ref_ids_t > >, typename sam_file_input<>::selected_field_ids, type_list< file_format > >
Deduce selected fields, ref_sequences_t and ref_ids_t, and file format.
sam_file_input_options< typename traits_type::sequence_legal_alphabet > options
The options are public and its members can be set directly.
Definition sam_file/input.hpp:679
sam_file_input(stream_type &&stream, file_format const &) -> sam_file_input< typename sam_file_input<>::traits_type, typename sam_file_input<>::selected_field_ids, type_list< file_format > >
Deduce file_format, and default the rest.
sam_file_input(stream_t &stream, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from an existing stream and with specified format.
Definition sam_file/input.hpp:465
sam_file_header< typename traits_type::ref_ids > header_type
The type of field::header_ptr (default: sam_file_header<typename traits_type::ref_ids>).
Definition sam_file/input.hpp:311
typename traits_type::template id_container< char > id_type
The type of field::id (default std::string by default).
Definition sam_file/input.hpp:275
sam_file_input & operator=(sam_file_input &&)=default
Move assignment is defaulted.
sam_file_input(stream_t &&stream, typename traits_type::ref_ids &ref_ids, typename traits_type::ref_sequences &ref_sequences, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition sam_file/input.hpp:570
sam_record< detail::select_types_with_ids_t< field_types, field_ids, selected_field_ids >, selected_field_ids > record_type
The type of the record, a specialisation of seqan3::record; acts as a tuple of the selected field typ...
Definition sam_file/input.hpp:379
sam_file_input()=delete
Default constructor is explicitly deleted, you need to give a stream or file name.
iterator begin()
Returns an iterator to current position in the file.
Definition sam_file/input.hpp:619
selected_field_ids_ selected_field_ids
A seqan3::fields list with the fields selected for the record.
Definition sam_file/input.hpp:245
sam_file_input(stream_type &stream, ref_ids_t &, ref_sequences_t &, file_format const &, selected_field_ids const &) -> sam_file_input< sam_file_input_default_traits< std::remove_reference_t< ref_sequences_t >, std::remove_reference_t< ref_ids_t > >, selected_field_ids, type_list< file_format > >
Deduce selected fields, ref_sequences_t and ref_ids_t, and file format.
sam_file_input(std::filesystem::path filename, typename traits_type::ref_ids &ref_ids, typename traits_type::ref_sequences &ref_sequences, selected_field_ids const &fields_tag=selected_field_ids{})
Construct from filename and given additional reference information.
Definition sam_file/input.hpp:512
sam_file_input & operator=(sam_file_input const &)=delete
Copy assignment is explicitly deleted because you cannot have multiple access to the same file.
sam_file_input(sam_file_input &&)=default
Move construction is defaulted.
header_type & header()
Access the file's header.
Definition sam_file/input.hpp:693
sam_file_input(sam_file_input const &)=delete
Copy construction is explicitly deleted because you cannot have multiple access to the same file.
uint8_t mapq_type
The type of field::mapq is fixed to uint8_t.
Definition sam_file/input.hpp:301
sam_flag flag_type
The type of field::flag is fixed to seqan3::sam_flag.
Definition sam_file/input.hpp:305
sam_file_input(stream_type &&stream, file_format const &, selected_field_ids const &) -> sam_file_input< typename sam_file_input<>::traits_type, selected_field_ids, type_list< file_format > >
Deduce selected fields, file_format, and default the rest.
sam_file_input(stream_t &&stream, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition sam_file/input.hpp:476
sam_file_input(stream_type &&stream, ref_ids_t &, ref_sequences_t &, file_format const &, selected_field_ids const &) -> sam_file_input< sam_file_input_default_traits< std::remove_reference_t< ref_sequences_t >, std::remove_reference_t< ref_ids_t > >, selected_field_ids, type_list< file_format > >
Deduce selected fields, ref_sequences_t and ref_ids_t, and file format.
~sam_file_input()=default
Destructor is defaulted.
std::tuple< ref_id_type, ref_offset_type, int32_t > mate_type
The type of field::mate is fixed to std::tuple<ref_id_type, ref_offset_type, int32_t>).
Definition sam_file/input.hpp:309
reference front() noexcept
Return the record we are currently at in the file.
Definition sam_file/input.hpp:672
typename traits_type::template quality_container< typename traits_type::quality_alphabet > quality_type
The type of field::qual (default std::vector<seqan3::phred42>).
Definition sam_file/input.hpp:303
sam_file_input(stream_type &stream, file_format const &, selected_field_ids const &) -> sam_file_input< typename sam_file_input<>::traits_type, selected_field_ids, type_list< file_format > >
Deduce selected fields, file_format, and default the rest.
The SAM tag dictionary class that stores all optional SAM fields.
Definition sam_tag_dictionary.hpp:327
T data(T... args)
Provides seqan3::dna15, container aliases and string literals.
Provides seqan3::dna5, container aliases and string literals.
Provides the seqan3::format_bam.
Provides the seqan3::format_sam.
T format(T... args)
T get(T... args)
sam_flag
An enum flag that describes the properties of an aligned read (given as a SAM record).
Definition sam_flag.hpp:73
field
An enumerator for the fields used in file formats.
Definition record.hpp:60
@ flag
The alignment flag (bit information), uint16_t value.
@ ref_offset
Sequence (seqan3::field::ref_seq) relative start position (0-based), unsigned value.
@ alignment
The (pairwise) alignment stored in an object that models seqan3::detail::pairwise_alignment.
@ cigar
The cigar vector (std::vector<seqan3::cigar>) representing the alignment in SAM/BAM format.
@ 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.
@ header_ptr
A pointer to the seqan3::sam_file_header object storing header information.
@ ref_id
The identifier of the (reference) sequence that seqan3::field::seq was aligned to.
@ id
The identifier, usually a string.
@ tags
The optional tags in the SAM format, stored in a dictionary.
@ seq
The "sequence", usually a range of nucleotides or amino acids.
@ qual
The qualities, usually in Phred score notation.
constexpr auto slice
A view adaptor that returns a half-open interval on the underlying range.
Definition slice.hpp:175
constexpr auto repeat_n
A view factory that repeats a given value n times.
Definition repeat_n.hpp:88
Provides the seqan3::detail::in_file_iterator class template.
The generic alphabet concept that covers most data types used in ranges.
Checks whether from can be explicitly converted to to.
The requirements a traits_type for seqan3::sam_file_input must meet.
A more refined container concept than seqan3::container.
Refines seqan3::alphabet and adds assignability.
A concept that indicates whether a writable alphabet represents quality scores.
Provides exceptions used in the I/O module.
Stream concepts.
Provides various utility functions required only for input.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.
Provides seqan3::phred42 quality scores.
Provides quality alphabet composites.
Provides seqan3::views::repeat_n.
Provides seqan3::sam_file_input_format and auxiliary classes.
Provides seqan3::sam_record.
Provides helper data structures for the seqan3::sam_file_output.
T size(T... args)
Provides seqan3::views::slice.
A class template that holds a choice of seqan3::field.
Definition record.hpp:125
Thrown if there is an unspecified filesystem or stream error while opening, e.g. permission problem.
Definition io/exception.hpp:36
The default traits for seqan3::sam_file_input.
Definition sam_file/input.hpp:168
Type that contains multiple types.
Definition type_list.hpp:26
Provides seqan3::detail::transformation_trait_or.
Provides traits for seqan3::type_list.
Provides seqan3::tuple_like.
T visit(T... args)
Hide me