 |
SeqAn3
3.0.2
The Modern C++ library for sequence analysis.
|
|
Go to the documentation of this file.
34 #include <seqan3/io/detail/record.hpp>
146 template <
typename _sequence_alphabet>
153 template <
typename _
id_alphabet>
160 template <
typename _quality_alphabet>
337 static_assert([] () constexpr
339 for (
field f : selected_field_ids::as_array)
340 if (!field_ids::contains(f))
344 "You selected a field that is not valid for sequence files, please refer to the documentation "
345 "of sequence_file_input::field_ids for the accepted values.");
347 static_assert([] () constexpr
353 "You may not select field::seq_qual and either of field::seq and field::qual at the same time.");
362 typename traits_type::sequence_alphabet>;
364 using id_type =
typename traits_type::template id_container<
365 typename traits_type::id_alphabet>;
368 typename traits_type::quality_alphabet>;
372 typename traits_type::quality_alphabet>>;
397 using iterator = detail::in_file_iterator<sequence_file_input>;
440 primary_stream->rdbuf()->pubsetbuf(stream_buffer.
data(), stream_buffer.
size());
442 std::ios_base::in | std::ios::binary);
444 if (!primary_stream->good())
445 throw file_open_error{
"Could not open file " + filename.
string() +
" for reading."};
448 secondary_stream = detail::make_secondary_istream(*primary_stream, filename);
451 detail::set_format(format, filename);
474 template <input_stream stream_t,
477 requires std::same_as<typename std::remove_reference_t<stream_t>::char_type,
stream_char_type>
480 file_format
const & SEQAN3_DOXYGEN_ONLY(format_tag),
482 primary_stream{&stream, stream_deleter_noop},
483 format{detail::sequence_file_input_format_exposer<file_format>{}}
485 static_assert(list_traits::contains<file_format, valid_formats>,
486 "You selected a format that is not in the valid_formats of this file.");
489 secondary_stream = detail::make_secondary_istream(*primary_stream);
493 template <input_stream stream_t,
496 requires std::same_as<typename std::remove_reference_t<stream_t>::char_type,
stream_char_type>
499 file_format
const & SEQAN3_DOXYGEN_ONLY(format_tag),
501 primary_stream{
new stream_t{
std::move(stream)}, stream_deleter_default},
502 format{detail::sequence_file_input_format_exposer<file_format>{}}
504 static_assert(list_traits::contains<file_format, valid_formats>,
505 "You selected a format that is not in the valid_formats of this file.");
508 secondary_stream = detail::make_secondary_istream(*primary_stream);
533 if (!first_record_was_read)
536 first_record_was_read =
true;
616 stream_ptr_t primary_stream{
nullptr, stream_deleter_noop};
618 stream_ptr_t secondary_stream{
nullptr, stream_deleter_noop};
621 bool first_record_was_read{
false};
626 using format_type =
typename detail::variant_from_tags<
valid_formats,
627 detail::sequence_file_input_format_exposer>::type;
633 void read_next_record()
636 record_buffer.clear();
646 assert(!
format.valueless_by_exception());
652 f.read_sequence_record(*secondary_stream,
654 detail::get_or_ignore<field::seq_qual>(record_buffer),
655 detail::get_or_ignore<field::id>(record_buffer),
656 detail::get_or_ignore<field::seq_qual>(record_buffer));
660 f.read_sequence_record(*secondary_stream,
662 detail::get_or_ignore<field::seq>(record_buffer),
663 detail::get_or_ignore<field::id>(record_buffer),
664 detail::get_or_ignore<field::qual>(record_buffer));
678 template <input_stream stream_type,
688 template <input_stream stream_type,
697 template <input_stream stream_type,
708 template <input_stream stream_type,
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
Provides seqan3::dna15, container aliases and string literals.
Resolves to std::ranges::explicitly_convertible_to<type1, type2>().
The 15 letter DNA alphabet, containing all IUPAC smybols minus the gap.
Definition: dna15.hpp:49
Provides the seqan3::record template and the seqan3::field enum.
This header includes C++17 filesystem support and imports it into namespace std::filesystem (independ...
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:166
constexpr sequenced_policy seq
Global execution policy object for sequenced execution policy.
Definition: execution.hpp:54
Provides seqan3::aa27, container aliases and string literals.
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:68
Provides exceptions used in the I/O module.
Provides seqan3::dna5, container aliases and string literals.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Quality type for traditional Sanger and modern Illumina Phred scores (typical range).
Definition: phred42.hpp:44
Provides alphabet adaptations for standard char types.
field
An enumerator for the fields used in file formats.
Definition: record.hpp:65
Joins an arbitrary alphabet with a quality alphabet.
Definition: qualified.hpp:59
The five letter DNA alphabet of A,C,G,T and the unknown character N.
Definition: dna5.hpp:49
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:44
Provides seqan3::phred42 quality scores.