SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
The FASTQ format. More...
#include <seqan3/io/sequence_file/format_fastq.hpp>
Public Member Functions | |
Constructors, destructor and assignment | |
format_fastq () noexcept=default | |
Defaulted. | |
format_fastq (format_fastq const &) noexcept=default | |
Defaulted. | |
format_fastq & | operator= (format_fastq const &) noexcept=default |
Defaulted. | |
format_fastq (format_fastq &&) noexcept=default | |
Defaulted. | |
format_fastq & | operator= (format_fastq &&) noexcept=default |
Defaulted. | |
~format_fastq () noexcept=default | |
Defaulted. | |
Static Public Attributes | |
static std::vector< std::string > | file_extensions {{"fastq"}, {"fq"}} |
The valid file extensions for this format; note that you can modify this value. | |
Protected Member Functions | |
template<typename stream_type , typename seq_legal_alph_type , typename stream_pos_type , typename seq_type , typename id_type , typename qual_type > | |
void | read_sequence_record (stream_type &stream, sequence_file_input_options< seq_legal_alph_type > const &options, stream_pos_type &position_buffer, seq_type &sequence, id_type &id, qual_type &qualities) |
Read from the specified stream and back-insert into the given field buffers. | |
template<typename stream_type , typename seq_type , typename id_type , typename qual_type > | |
void | write_sequence_record (stream_type &stream, sequence_file_output_options const &options, seq_type &&sequence, id_type &&id, qual_type &&qualities) |
Write the given fields to the specified stream. | |
The FASTQ format.
FASTQ is the de-facto-standard for storing sequences together with quality information. See the article on wikipedia for a an in-depth description of the format.
The FASTQ format provides the fields seqan3::field::seq, seqan3::field::id and seqan3::field::qual. All three fields are required when writing and the sequence and qualities are required to be of the same length.
All documented encodings for the quality string are supported (see the article above), but they are not detected from the file. Instead, when reading the file, you have to set the respective alphabet via a traits type (see seqan3::sequence_file_input_traits and the Quality submodule).
This implementation supports the following optional features of the format:
+
-line also (line is always ignored when reading)
|
inlineprotected |
Read from the specified stream and back-insert into the given field buffers.
stream_type | Input stream, must satisfy seqan3::input_stream_over with char . |
stream_pos_type | Buffer for storing the current record's file position. |
seq_type | Type of the seqan3::field::seq input; must satisfy std::ranges::output_range over a seqan3::alphabet. |
id_type | Type of the seqan3::field::id input; must satisfy std::ranges::output_range over a seqan3::alphabet. |
qual_type | Type of the seqan3::field::qual input; must satisfy std::ranges::output_range over a seqan3::writable_quality_alphabet. |
[in,out] | stream | The input stream to read from. |
[in,out] | position_buffer | The buffer to store the current record's file position. |
[in] | options | File specific options passed to the format. |
[out] | sequence | The buffer for seqan3::field::seq input, i.e. the "sequence". |
[out] | id | The buffer for seqan3::field::id input, e.g. the header line in FASTA . |
[out] | qualities | The buffer for seqan3::field::qual input. |
|
inlineprotected |
Write the given fields to the specified stream.
stream_type | Output stream, must satisfy seqan3::output_stream_over with char . |
seq_type | Type of the seqan3::field::seq output; must satisfy std::ranges::output_range over a seqan3::alphabet. |
id_type | Type of the seqan3::field::id output; must satisfy std::ranges::output_range over a seqan3::alphabet. |
qual_type | Type of the seqan3::field::qual output; must satisfy std::ranges::output_range over a seqan3::quality_alphabet. |
[in,out] | stream | The output stream to write into. |
[in] | options | File specific options passed to the format. |
[in] | sequence | The data for seqan3::field::seq, i.e. the "sequence". |
[in] | id | The data for seqan3::field::id, e.g. the header line in FASTA. |
[in] | qualities | The data for seqan3::field::qual. |