113 template <
typename t>
131 requires std::same_as<typename t::ref_sequences, ref_info_not_given> || requires ()
138 (!std::same_as<typename t::ref_sequences, ref_info_not_given> ||
140 requires std::ranges::forward_range<std::ranges::range_reference_t<typename t::ref_ids>>;
141 requires std::ranges::forward_range<typename t::ref_ids>;
182 template <
typename ref_sequences_t = ref_info_not_given,
typename ref_
ids_t = std::deque<std::
string>>
197 template <
typename _sequence_alphabet>
201 template <
typename _
id_alphabet>
208 template <
typename _quality_alphabet>
376 detail::lazy_conditional_t<std::ranges::range<typename traits_type::ref_sequences const>,
378 typename traits_type::ref_sequences
const>,
391 typename traits_type::sequence_alphabet>;
393 using id_type =
typename traits_type::template id_container<char>;
424 typename traits_type::quality_alphabet>;
443 decltype(std::declval<sequence_type &>() |
views::slice(0, 0))>,
510 static_assert([] () constexpr
512 for (
field f : selected_field_ids::as_array)
517 "You selected a field that is not valid for aligment files, please refer to the documentation "
518 "of sam_file_input::field_ids for the accepted values.");
606 template <input_stream stream_t, sam_file_input_format file_format>
608 requires std::same_as<typename std::remove_reference_t<stream_t>::char_type,
stream_char_type>
611 file_format
const & SEQAN3_DOXYGEN_ONLY(format_tag),
615 init_by_format<file_format>();
619 template <input_stream stream_t, sam_file_input_format file_format>
621 requires std::same_as<typename std::remove_reference_t<stream_t>::char_type,
stream_char_type>
624 file_format
const & SEQAN3_DOXYGEN_ONLY(format_tag),
628 init_by_format<file_format>();
655 typename traits_type::ref_ids & ref_ids,
656 typename traits_type::ref_sequences & ref_sequences,
691 template <input_stream stream_t, sam_file_input_format file_format>
693 typename traits_type::ref_ids & ref_ids,
694 typename traits_type::ref_sequences & ref_sequences,
695 file_format
const & SEQAN3_DOXYGEN_ONLY(format_tag),
702 init_by_format<file_format>();
706 template <input_stream stream_t, sam_file_input_format file_format>
708 typename traits_type::ref_ids & ref_ids,
709 typename traits_type::ref_sequences & ref_sequences,
710 file_format
const & SEQAN3_DOXYGEN_ONLY(format_tag),
717 init_by_format<file_format>();
723 typename traits_type::ref_ids &&,
724 typename traits_type::ref_sequences &&,
727 template <input_stream stream_t, sam_file_input_format file_format>
729 typename traits_type::ref_ids &&,
730 typename traits_type::ref_sequences &&,
850 std::ios_base::in | std::ios::binary);
860 template <
typename format_type>
863 static_assert(list_traits::contains<format_type, valid_formats>,
864 "You selected a format that is not in the valid_formats of this file.");
927 template <std::ranges::forward_range ref_sequences_t>
928 void set_references(
typename traits_type::ref_ids & ref_ids, ref_sequences_t && ref_sequences)
930 assert(std::ranges::distance(ref_ids) == std::ranges::distance(ref_sequences));
936 for (int32_t idx = 0; idx < std::ranges::distance(ref_ids); ++idx)
938 header_ptr->ref_id_info.emplace_back(std::ranges::distance(ref_sequences[idx]),
"");
940 if constexpr (std::ranges::contiguous_range<std::ranges::range_reference_t<
941 typename traits_type::ref_ids>> &&
942 std::ranges::sized_range<std::ranges::range_reference_t<typename traits_type::ref_ids>> &&
943 std::ranges::borrowed_range<std::ranges::range_reference_t<typename traits_type::ref_ids>>)
971 auto call_read_func = [
this] (
auto & ref_seq_info)
997 assert(!
format.valueless_by_exception());
999 if constexpr (!std::same_as<typename traits_type::ref_sequences, ref_info_not_given>)
1002 call_read_func(std::ignore);
1014 template <input_stream stream_type, sam_file_input_format file_format, detail::fields_specialisation selected_field_
ids>
1021 template <input_stream stream_type, sam_file_input_format file_format, detail::fields_specialisation selected_field_
ids>
1028 template <input_stream stream_type, sam_file_input_format file_format>
1035 template <input_stream stream_type, sam_file_input_format file_format>
1042 template <std::ranges::forward_range ref_ids_t,
1043 std::ranges::forward_range ref_sequences_t,
1052 template <std::ranges::forward_range ref_ids_t,
1053 std::ranges::forward_range ref_sequences_t>
1061 template <input_stream stream_type,
1062 std::ranges::forward_range ref_ids_t,
1063 std::ranges::forward_range ref_sequences_t,
1073 template <input_stream stream_type,
1074 std::ranges::forward_range ref_ids_t,
1075 std::ranges::forward_range ref_sequences_t,
1085 template <input_stream stream_type,
1086 std::ranges::forward_range ref_ids_t,
1087 std::ranges::forward_range ref_sequences_t,
1089 sam_file_input(stream_type && stream, ref_ids_t &, ref_sequences_t &, file_format
const &)
1096 template <input_stream stream_type,
1097 std::ranges::forward_range ref_ids_t,
1098 std::ranges::forward_range ref_sequences_t,
1100 sam_file_input(stream_type & stream, ref_ids_t &, ref_sequences_t &, file_format
const &)
Provides seqan3::aa27, container aliases and string literals.
Provides the seqan3::cigar alphabet.
Provides alphabet adaptations for standard char types.
A combined alphabet that can hold values of either of its alternatives.
Definition: alphabet_variant.hpp:132
Input iterator necessary for providing a range-like interface in input file.
Definition: in_file_iterator.hpp:41
The 15 letter DNA alphabet, containing all IUPAC smybols minus the gap.
Definition: dna15.hpp:51
The five letter DNA alphabet of A,C,G,T and the unknown character N.
Definition: dna5.hpp:51
A gap decorator allows the annotation of sequences with gap symbols while leaving the underlying sequ...
Definition: gap_decorator.hpp:86
Quality type for traditional Sanger and modern Illumina Phred scores.
Definition: phred42.hpp:47
The SAM tag dictionary class that stores all optional SAM fields.
Definition: sam_tag_dictionary.hpp:326
Provides auxiliary data structures and functions for seqan3::record and seqan3::fields.
Provides seqan3::dna15, container aliases and string literals.
Provides seqan3::dna5, container aliases and string literals.
This header includes C++17 filesystem support and imports it into namespace std::filesystem (independ...
Provides seqan3::gap_decorator.
SEQAN3_CONCEPT type_list_of_sam_file_input_formats
Auxiliary concept that checks whether a type is a seqan3::type_list and all types meet seqan3::sam_fi...
Definition: input_format_concept.hpp:246
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:62
void set_format(format_variant_type &format, std::filesystem::path const &file_name)
Sets the file format according to the file name extension.
Definition: misc.hpp:67
@ flag
The alignment flag (bit information), uint16_t value.
@ ref_offset
Sequence (seqan3::field::ref_seq) relative start position (0-based), unsigned value.
@ ref_seq
The (reference) "sequence" information, usually a range of nucleotides or amino acids.
@ 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.
@ bit_score
The bit score (statistical significance indicator), unsigned value.
@ 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.
@ evalue
The e-value (length normalized bit score), double value.
@ 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.
meta::list< types... > type_list
Type that contains multiple types, an alias for meta::list.
Definition: type_list.hpp:31
constexpr bool contains
Whether a type occurs in a type list or not.
Definition: traits.hpp:194
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 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:145
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 the seqan3::detail::in_file_iterator class template.
The generic alphabet concept that covers most data types used in ranges.
Resolves to std::ranges::explicitly_convertible_to<type1, type2>(). <dl class="no-api">This entity i...
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.
auto make_secondary_istream(std::basic_istream< char_t > &primary_stream, std::filesystem::path &filename) -> std::unique_ptr< std::basic_istream< char_t >, std::function< void(std::basic_istream< char_t > *)>>
Depending on the magic bytes of the given stream, return a decompression stream or forward the primar...
Definition: misc_input.hpp:79
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Provides seqan3::phred42 quality scores.
Provides quality alphabet composites.
Adaptations of concepts from the Ranges TS.
Provides seqan3::views::repeat_n.
Provides seqan3::sam_record.
Provides helper data structures for the seqan3::sam_file_output.
Provides seqan3::views::slice.
An empty type whose only purpose is to hold an uninstantiated template plus its arguments.
Definition: lazy_conditional.hpp:36
A class template that holds a choice of seqan3::field.
Definition: record.hpp:167
static constexpr bool contains(field f)
Whether a field is contained in the parameter pack.
Definition: record.hpp:185
Thrown if there is an unspecified filesystem or stream error while opening, e.g. permission problem.
Definition: exception.hpp:40
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:271
Provides seqan3::tuple_like.
Provides traits for seqan3::type_list.