SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
|
The Vienna format (dot bracket notation) for RNA sequences with secondary structure. More...
#include <seqan3/io/structure_file/format_vienna.hpp>
Public Member Functions | |
Constructors, destructor and assignment | |
format_vienna () noexcept=default | |
Defaulted. | |
format_vienna (format_vienna const &) noexcept=default | |
Defaulted. | |
format_vienna & | operator= (format_vienna const &) noexcept=default |
Defaulted. | |
format_vienna (format_vienna &&) noexcept=default | |
Defaulted. | |
format_vienna & | operator= (format_vienna &&) noexcept=default |
Defaulted. | |
~format_vienna () noexcept=default | |
Defaulted. | |
Static Public Attributes | |
static std::vector< std::string > | file_extensions {{"dbn"}, {"fasta"}, {"fa"}} |
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 , bool structured_seq_combined, typename seq_type , typename id_type , typename bpp_type , typename structure_type , typename energy_type , typename react_type , typename comment_type , typename offset_type > | |
void | read_structure_record (stream_type &stream, structure_file_input_options< seq_legal_alph_type, structured_seq_combined > const &options, seq_type &seq, id_type &id, bpp_type &bpp, structure_type &structure, energy_type &energy, react_type &react, react_type &react_err, comment_type &comment, offset_type &offset) |
Read from the specified stream and back-insert into the given field buffers. | |
template<typename stream_type , typename seq_type , typename id_type , typename bpp_type , typename structure_type , typename energy_type , typename react_type , typename comment_type , typename offset_type > | |
void | write_structure_record (stream_type &stream, structure_file_output_options const &options, seq_type &&seq, id_type &&id, bpp_type &&bpp, structure_type &&structure, energy_type &&energy, react_type &&react, react_type &&react_err, comment_type &&comment, offset_type &&offset) |
Write the given fields to the specified stream. | |
Additional Inherited Members | |
![]() | |
static inline std::vector< std::string > | file_extensions |
The format type is required to provide a vector of all supported file extensions. | |
![]() | |
static inline std::vector< std::string > | file_extensions |
The format type is required to provide a vector of all supported file extensions. | |
The Vienna format (dot bracket notation) for RNA sequences with secondary structure.
Dot Bracket or Vienna Notation is widely used for secondary structure annotation. Is is a very simple format, containing one or more sequences. Each sequence must appear as a single line in the file. A sequence may be preceded by a special line starting with the '>' character followed by a sequence name (like FASTA). After each sequence line there is usually a line containing secondary structure, using brackets to denote interacting nucleotides or amino acids, and dots for unpaired sites. The length of the struture must equal the length of the sequence. Optionally, the structure may be followed by a space character and the minimum free energy value enclosed in parentheses (). Note that there cannot be energy without structure.
The Vienna format is the output format of RNAfold. Furthermore, it is designed to be compatible with the input format of the ViennaRNA package (if structure and energy are omitted). See https://www.tbi.univie.ac.at/RNA/tutorial/#sec2_7 for details.
The Vienna format provides the fields seqan3::field::seq, seqan3::field::id, seqan3::field::bpp (read only), seqan3::field::structure, seqan3::field::structured_seq and seqan3::field::energy.
If you select seqan3::field::structured_seq you must not select seqan3::field::seq or seqan3::field::structure.
Either the field seqan3::field::seq or the field seqan3::field::structured_seq is required when writing.
The field seqan3::field::bpp is ignored when writing, but a structure string can be converted to bpp when reading.
When reading the ID-line the identifier (>
) and any blank characters before the actual ID are stripped. Each field is read/written as a single line (except ENERGY, which goes right after the structure). Numbers and spaces within the sequence are simply ignored, but not within the structure.
|
no-apiinlineprotected |
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 . |
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. |
bpp_type | Type of the seqan3::field::bpp input; must satisfy std::ranges::output_range over a set of pair of types satisfying std::is_floating_point and std::numeric_limits::is_integer, respectively. |
structure_type | Type of the seqan3::field::structure input; must satisfy std::ranges::output_range over a seqan3::rna_structure_alphabet. |
energy_type | Type of the seqan3::field::energy input; must satisfy std::is_floating_point. |
react_type | Type of the seqan3::field::react and seqan3::field::react_err input; must satisfy std::is_floating_point. |
comment_type | Type of the seqan3::field::comment input; must satisfy std::ranges::output_range over a seqan3::alphabet. |
offset_type | Type of the seqan3::field::offset input; must satisfy std::numeric_limits::is_integer. |
[in,out] | stream | The input stream to read from. |
[in] | options | File specific options passed to the format. |
[out] | seq | 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. |
[out] | bpp | The buffer for seqan3::field::bpp input. |
[out] | structure | The buffer for seqan3::field::structure input. |
[out] | energy | The buffer for seqan3::field::energy input. |
[out] | react | The buffer for seqan3::field::react input. |
[out] | react_err | The buffer for seqan3::field::react_err input. |
[out] | comment | The buffer for seqan3::field::comment input. |
[out] | offset | The buffer for seqan3::field::offset input. |
Implements seqan3::structure_file_input_format< t >.
|
no-apiinlineprotected |
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. |
bpp_type | Type of the seqan3::field::bpp output; must satisfy std::ranges::output_range over a set of pair of types satisfying std::is_floating_point and std::numeric_limits::is_integer, respectively. |
structure_type | Type of the seqan3::field::structure output; must satisfy std::ranges::output_range over a seqan3::rna_structure_alphabet. |
energy_type | Type of the seqan3::field::energy output; must satisfy std::is_floating_point. |
react_type | Type of the seqan3::field::react and seqan3::field::react_err output; must satisfy std::is_floating_point. |
comment_type | Type of the seqan3::field::comment output; must satisfy std::ranges::output_range over a seqan3::alphabet. |
offset_type | Type of the seqan3::field::offset output; must satisfy std::numeric_limits::is_integer. |
[in,out] | stream | The output stream to write into. |
[in] | options | File specific options passed to the format. |
[in] | seq | The data for seqan3::field::seq output, i.e. the "sequence". |
[in] | id | The data for seqan3::field::id output, e.g. the header line. |
[in] | bpp | The data for seqan3::field::bpp output. |
[in] | structure | The data for seqan3::field::structure output. |
[in] | energy | The data for seqan3::field::energy output. |
[in] | react | The data for seqan3::field::react output. |
[in] | react_err | The data for seqan3::field::react_err output. |
[in] | comment | The data for seqan3::field::comment output. |
[in] | offset | The data for seqan3::field::offset output. |
Implements seqan3::structure_file_output_format< t >.