 |
SeqAn3
3.0.1
The Modern C++ library for sequence analysis.
|
|
Go to the documentation of this file.
22 #pragma GCC diagnostic push
23 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
38 #include <seqan3/io/detail/record.hpp>
102 template <
typename t>
151 template <
typename _sequence_alphabet>
158 template <
typename _
id_alphabet>
165 template <
typename _quality_alphabet>
342 static_assert([] () constexpr
344 for (
field f : selected_field_ids::as_array)
345 if (!field_ids::contains(f))
349 "You selected a field that is not valid for sequence files, please refer to the documentation "
350 "of sequence_file_input::field_ids for the accepted values.");
352 static_assert([] () constexpr
358 "You may not select field::seq_qual and either of field::seq and field::qual at the same time.");
367 typename traits_type::sequence_alphabet>;
369 using id_type =
typename traits_type::template id_container<
370 typename traits_type::id_alphabet>;
372 using quality_type =
typename traits_type::template quality_container<
373 typename traits_type::quality_alphabet>;
377 typename traits_type::quality_alphabet>>;
402 using iterator = detail::in_file_iterator<sequence_file_input>;
443 primary_stream{
new std::ifstream{filename, std::ios_base::in | std::ios::binary}, stream_deleter_default}
445 if (!primary_stream->good())
446 throw file_open_error{
"Could not open file " + filename.
string() +
" for reading."};
449 secondary_stream = detail::make_secondary_istream(*primary_stream, filename);
452 detail::set_format(format, filename);
475 template <input_stream stream_t,
481 file_format
const & SEQAN3_DOXYGEN_ONLY(format_tag),
483 primary_stream{&stream, stream_deleter_noop},
484 format{detail::sequence_file_input_format_exposer<file_format>{}}
486 static_assert(list_traits::contains<file_format, valid_formats>,
487 "You selected a format that is not in the valid_formats of this file.");
490 secondary_stream = detail::make_secondary_istream(*primary_stream);
494 template <input_stream stream_t,
500 file_format
const & SEQAN3_DOXYGEN_ONLY(format_tag),
502 primary_stream{
new stream_t{
std::move(stream)}, stream_deleter_default},
503 format{detail::sequence_file_input_format_exposer<file_format>{}}
505 static_assert(list_traits::contains<file_format, valid_formats>,
506 "You selected a format that is not in the valid_formats of this file.");
509 secondary_stream = detail::make_secondary_istream(*primary_stream);
534 if (!first_record_was_read)
537 first_record_was_read =
true;
615 stream_ptr_t primary_stream{
nullptr, stream_deleter_noop};
617 stream_ptr_t secondary_stream{
nullptr, stream_deleter_noop};
620 bool first_record_was_read{
false};
625 using format_type =
typename detail::variant_from_tags<
valid_formats,
626 detail::sequence_file_input_format_exposer>::type;
632 void read_next_record()
635 record_buffer.clear();
645 assert(!format.valueless_by_exception());
651 f.read_sequence_record(*secondary_stream,
653 detail::get_or_ignore<field::seq_qual>(record_buffer),
654 detail::get_or_ignore<field::id>(record_buffer),
655 detail::get_or_ignore<field::seq_qual>(record_buffer));
659 f.read_sequence_record(*secondary_stream,
661 detail::get_or_ignore<field::seq>(record_buffer),
662 detail::get_or_ignore<field::id>(record_buffer),
663 detail::get_or_ignore<field::qual>(record_buffer));
677 template <input_stream stream_type,
680 sequence_file_input(stream_type & stream,
684 type_list<file_format>>;
687 template <input_stream stream_type,
689 sequence_file_input(stream_type && stream,
693 type_list<file_format>>;
696 template <input_stream stream_type,
698 detail::fields_specialisation selected_field_ids>
699 sequence_file_input(stream_type && stream,
701 selected_field_ids
const &)
704 type_list<file_format>>;
707 template <input_stream stream_type,
709 detail::fields_specialisation selected_field_ids>
710 sequence_file_input(stream_type & stream,
712 selected_field_ids
const &)
715 type_list<file_format>>;
719 #pragma GCC diagnostic pop
Sequence and qualities combined in one range.
The "sequence", usually a range of nucleotides or amino acids.
Provides quality alphabet composites.
Provides algorithms for meta programming, parameter packs and seqan3::type_list.
A more refined container concept than seqan3::container.
meta::list< types... > type_list
Type that contains multiple types, an alias for meta::list.
Definition: type_list.hpp:31
Resolves to std::ranges::explicitly_convertible_to<type1, type2>().
const auto move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:68
The 15 letter DNA alphabet, containing all IUPAC smybols minus the gap.
Definition: dna15.hpp:48
Provides the seqan3::record template and the seqan3::field enum.
This header includes C++17 filesystem support and imports it into namespace seqan3::filesystem (indep...
constexpr bool contains
Whether a type occurs in a pack or not.
Definition: traits.hpp:193
A class template that holds a choice of seqan3::field.
Definition: record.hpp:165
The concept std::same_as<T, U> is satisfied if and only if T and U denote the same type.
Meta-header for the nucleotide submodule; includes all headers from alphabet/nucleotide/.
Provides seqan3::aa27, container aliases and string literals.
Provides exceptions used in the I/O module.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
Quality type for traditional Sanger and modern Illumina Phred scores (typical range).
Definition: phred42.hpp:43
Provides alphabet adaptations for standard char types.
Provides seqan3::concatenated_sequences.
field
An enumerator for the fields used in file formats.
Definition: record.hpp:64
Joins an arbitrary alphabet with a quality alphabet.
Definition: qualified.hpp:55
The qualities, usually in phred-score notation.
The five letter DNA alphabet of A,C,G,T and the unknown character N.
Definition: dna5.hpp:48
Provides the seqan3::detail::in_file_iterator class template.
Provides traits for seqan3::type_list.
Refines seqan3::alphabet and adds assignability.
A concept that indicates whether a writable alphabet represents quality scores.
The twenty-seven letter amino acid alphabet.
Definition: aa27.hpp:43
Provides seqan3::phred42 quality scores.