SeqAn3  3.0.0
The Modern C++ library for sequence analysis.
seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ > Class Template Reference

A class for writing structured sequence files, e.g. Stockholm, Connect, Vienna, ViennaRNA bpp matrix ... More...

#include <seqan3/io/structure_file/output.hpp>

Public Types

using field_ids = fields< field::SEQ, field::ID, field::BPP, field::STRUCTURE, field::STRUCTURED_SEQ, field::ENERGY, field::REACT, field::REACT_ERR, field::COMMENT, field::OFFSET >
 The subset of seqan3::field IDs that are valid for this file.
 
Template arguments

Exposed as member types for public access.

using selected_field_ids = selected_field_ids_
 A seqan3::fields list with the fields selected for the record.
 
using valid_formats = valid_formats_
 A seqan3::type_list with the possible formats.
 
using stream_char_type = stream_char_type_
 Character type of the stream(s), usually char.
 
Range associated types

Most of the range associated types are void for output ranges.

using value_type = void
 The value type (void).
 
using reference = void
 The reference type (void).
 
using const_reference = void
 The const reference type (void).
 
using size_type = void
 The size type (void).
 
using difference_type = std::ptrdiff_t
 A signed integer type, usually std::ptrdiff_t.
 
using iterator = detail::out_file_iterator< structure_file_output >
 The iterator type of this view (an output iterator).
 
using const_iterator = void
 The const iterator type is void, because files are not const-iterable.
 
using sentinel = std::ranges::default_sentinel_t
 The type returned by end().
 

Public Member Functions

Constructors, destructor and assignment
 structure_file_output ()=delete
 Default constructor is explicitly deleted, you need to give a stream or file name.
 
 structure_file_output (structure_file_output const &)=delete
 Copy construction is explicitly deleted, because you can't have multiple access to the same file.
 
structure_file_outputoperator= (structure_file_output const &)=delete
 Copy assignment is explicitly deleted, because you can't have multiple access to the same file.
 
 structure_file_output (structure_file_output &&)=default
 Move construction is defaulted.
 
structure_file_outputoperator= (structure_file_output &&)=default
 Move assignment is defaulted.
 
 ~structure_file_output ()=default
 Destructor is defaulted.
 
 structure_file_output (std::filesystem::path filename, selected_field_ids const &fields_tag=selected_field_ids{})
 Construct from filename. More...
 
template<OStream2 stream_t, StructureFileOutputFormat file_format>
 structure_file_output (stream_t &stream, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
 Construct from an existing stream and with specified format. More...
 
template<OStream2 stream_t, StructureFileOutputFormat file_format>
 structure_file_output (stream_t &&stream, file_format const &format_tag, selected_field_ids const &fields_tag=selected_field_ids{})
 
Tuple interface

Provides functions for field-based ("column"-based) writing.

template<typename typelist , typename field_ids >
structure_file_outputoperator= (record< typelist, field_ids > const &r)
 Write columns (wrapped in a seqan3::record) to the file. More...
 
template<typename ... arg_types>
structure_file_outputoperator= (std::tuple< arg_types... > const &t)
 Write columns (wrapped in a std::tuple) to the file. More...
 

Public Attributes

structure_file_output_options options
 The options are public and its members can be set directly.
 

Related Functions

(Note that these are not member functions.)

Type deduction guides
template<OStream2 stream_t, StructureFileOutputFormat file_format, detail::Fields selected_field_ids>
 structure_file_output (stream_t &&, file_format const &, selected_field_ids const &) -> structure_file_output< selected_field_ids, type_list< file_format >, typename std::remove_reference_t< stream_t >::char_type >
 Deduction of the selected fields, the file format and the stream type.
 
template<OStream2 stream_t, StructureFileOutputFormat file_format, detail::Fields selected_field_ids>
 structure_file_output (stream_t &, file_format const &, selected_field_ids const &) -> structure_file_output< selected_field_ids, type_list< file_format >, typename std::remove_reference_t< stream_t >::char_type >
 

Range interface

Provides functions for record based writing of the file.

iterator begin () noexcept
 Returns an iterator to current position in the file. More...
 
sentinel end () noexcept
 Returns a sentinel for comparison with iterator. More...
 
template<typename record_t >
void push_back (record_t &&r) requires TupleLike< record_t > &&requires
 Write a seqan3::record to the file. More...
 
template<typename tuple_t >
void push_back (tuple_t &&t) requires TupleLike< tuple_t >
 Write a record in form of a std::tuple to the file. More...
 
template<typename arg_t , typename ... arg_types>
void emplace_back (arg_t &&arg, arg_types &&... args)
 Write a record to the file by passing individual fields. More...
 
template<std::ranges::InputRange rng_t>
structure_file_outputoperator= (rng_t &&range) requires TupleLike< reference_t< rng_t >>
 Write a range of records (or tuples) to the file. More...
 
template<std::ranges::InputRange rng_t>
structure_file_outputoperator| (rng_t &&range, structure_file_output &f) requires TupleLike< reference_t< rng_t >>
 Write a range of records (or tuples) to the file. More...
 
template<std::ranges::InputRange rng_t>
structure_file_output operator| (rng_t &&range, structure_file_output &&f) requires TupleLike< reference_t< rng_t >>
 

Detailed Description

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
class seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >

A class for writing structured sequence files, e.g. Stockholm, Connect, Vienna, ViennaRNA bpp matrix ...

Template Parameters
selected_field_idsA seqan3::fields type with the list and order of fields IDs; only relevant if these can't be deduced.
valid_formatsA seqan3::type_list of the selectable formats (each must meet seqan3::StructureFileOutputFormat).
stream_char_typeThe type of the underlying stream device(s); must model seqan3::Char.

Introduction

Structured sequence files contain intra-molecular interactions of RNA or protein. Usually, but not necessarily, they contain the nucleotide or amino acid sequences and descriptions as well. Interactions can be represented either as fixed secondary structure, where every character is assigned at most one interaction partner (structure of minimum free energy), or an annotated sequence, where every character is assigned a set of interaction partners with specific base pair probabilities.

The structured sequence file abstraction supports writing ten different fields:

  1. seqan3::field::SEQ (sequence)
  2. seqan3::field::ID (identifier)
  3. seqan3::field::BPP (annotated sequence)
  4. seqan3::field::STRUCTURE (secondary structure)
  5. seqan3::field::STRUCTURED_SEQ (sequence and structure in one range)
  6. seqan3::field::ENERGY (minimum free energy)
  7. seqan3::field::REACT (reactivity)
  8. seqan3::field::REACT_ERR (reactivity error)
  9. seqan3::field::COMMENT (free text)
  10. seqan3::field::OFFSET (index of first sequence character)

The member functions take any and either of these fields. If the field ID of an argument cannot be deduced, it is assumed to correspond to the field ID of the respective template parameter.

Construction and specialisation

This class comes with two constructors, one for construction from a file name and one for construction from an existing stream and a known format. The first one automatically picks the format based on the extension of the file name. The second can be used if you have a non-file stream, like std::cout or std::ostringstream, that you want to read from and/or if you cannot use file-extension based detection, but know that your output file has a certain format.

In most cases the template parameters are deduced completely automatically:

structure_file_output fout{tmp_dir/"output.dbn"}; // Vienna format detected, std::ofstream opened for file

Writing to std::cout:

structure_file_output fout{std::cout, format_vienna{}};
// ^ no need to specify the template arguments
fout.emplace_back("AACGUU"_rna4, "example_id", ".(())."_wuss51); // default order for vienna: SEQ, ID, STRUCTURE

Note that this is not the same as writing structure_file_output<> (with angle brackets). In the latter case they are explicitly set to their default values, in the former case automatic deduction happens which chooses different parameters depending on the constructor arguments. Prefer deduction over explicit defaults.

Writing record-wise

You can iterate over this file record-wise:

structure_file_output fout{tmp_dir/"my.dbn"};
for (int i = 0; i < 10; i++) // ...
{
std::string id{"test_id"};
rna5_vector seq{"ACGU"_rna5};
std::vector<wuss51> structure{".()."_wuss51};
// ...
fout.emplace_back(seq, id, structure); // as individual variables
// or:
fout.push_back(std::tie(seq, id, structure)); // as a tuple
}

The easiest way to write to a sequence file is to use the push_back() or emplace_back() member functions. These work similarly to how they work on an std::vector. If you pass a tuple to push_back() or give arguments to emplace_back() the seqan3::field ID of the i-th tuple-element/argument is assumed to be the i-th value of selected_field_ids, i.e. by default the first is assumed to be seqan3::field::SEQ, the second seqan3::field::ID and the third one seqan3::field::STRUCTURE. You may give less fields than are selected, if the actual format you are writing to can cope with less (e.g. for Vienna it is sufficient to write seqan3::field::SEQ, seqan3::field::ID and seqan3::field::STRUCTURE, even if selected_field_ids also contains seqan3::field::ENERGY).

You may also use the output file's iterator for writing, however, this rarely provides an advantage.

Writing record-wise (custom fields)

If you want to pass a combined object for SEQ and STRUCTURE fields to push_back() / emplace_back(), or if you want to change the order of the parameters, you can pass a non-empty fields trait object to the structure_file_output constructor to select the fields that are used for interpreting the arguments.

The following snippets demonstrates the usage of such a fields trait object.

structured_rna<rna5, wuss51> sr{'G'_rna5, '.'_wuss51};
structure_file_output fout{tmp_dir/"my.dbn", fields<field::ID, field::STRUCTURED_SEQ>{}};
for (int i = 0; i < 10; i++)// ...
{
std::string id{"test_id"};
std::vector<structured_rna<rna5, wuss51>> structured_seq{sr, sr, sr, sr}; // vector of combined data structure
// ...
fout.emplace_back(id, structured_seq); // note also that the order the arguments is now different, because
// or: you specified that ID should be first in the fields template argument
fout.push_back(std::tie(id, structured_seq));
}

A different way of passing custom fields to the file is to pass a seqan3::record – instead of a tuple – to push_back(). The seqan3::record clearly indicates which of its elements has which seqan3::field ID so the file will use that information instead of the template argument. This is especially handy when reading from one file and writing to another, because you don't have to configure the output file to match the input file, it will just work:

structure_file_input fin{tmp_dir/"input.dbn", fields<field::ID, field::SEQ, field::STRUCTURE>{}};
structure_file_output fout{tmp_dir/"my_wrong.dbn"}; // doesn't have to match the configuration
for (auto & r : fin)
{
if (criteria) // r fulfills some filter criterium
{
fout.push_back(r);
}
}

Writing record-wise in batches

You can write multiple records at once, by assigning to the file:

structure_file_output fout{tmp_dir/"my.dbn"};
{
{ "ACGT"_rna5, "First", "...."_wuss51 },
{ "NATA"_rna5, "2nd", "...."_wuss51 },
{ "GATA"_rna5, "Third", "...."_wuss51 }
}; // a range of "records"
fout = range; // will iterate over the records and write them

File I/O pipelines

Record-wise writing in batches also works for writing from input files directly to output files, because input files are also input ranges in SeqAn:

// file format conversion in one line:
structure_file_output{tmp_dir/"output.dbn"} = structure_file_input{tmp_dir/"input.dbn"};
// with structure_file_output as a variable:
structure_file_output fout{tmp_dir/"output.dbn"};
fout = structure_file_input{tmp_dir/"input.dbn"};
// or in pipe notation:
structure_file_input{tmp_dir/"input.dbn"} | structure_file_output{tmp_dir/"output.dbn"};

This can be combined with file-based views to create I/O pipelines:

structure_file_input my_in{tmp_dir/"input.dbn"};
my_in | view::take(5) | structure_file_output{"output.dbn"};

Column-based writing

The record-based interface treats the file as a range of tuples (the records), but in certain situations you might have the data as columns, i.e. a tuple-of-ranges, instead of range-of-tuples.

You can use column-based writing in that case, it uses operator=() :

struct data_storage_t
{
concatenated_sequences<rna5_vector> sequences{"AACGUU"_rna5};
concatenated_sequences<std::string> ids{std::string{"seq1"}};
concatenated_sequences<std::vector<wuss51>> structures{".(())."_wuss51};
};
data_storage_t data_storage; // a global or globally used variable in your program
// ... in your file writing function:
structure_file_output fout{tmp_dir/"my.dbn"};
fout = std::tie(data_storage.sequences, data_storage.ids, data_storage.structures);

Formats

Currently, the only implemented format is seqan3::format_vienna. More formats will follow soon.

Constructor & Destructor Documentation

◆ structure_file_output() [1/3]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::structure_file_output ( std::filesystem::path  filename,
selected_field_ids const &  fields_tag = selected_field_ids{} 
)
inline

Construct from filename.

Parameters
[in]filenamePath to the file you wish to open.
[in]fields_tagA seqan3::fields tag. [optional]

In addition to the file name, you may specify a custom seqan3::fields type which may be easier than defining all the template parameters.

Compression

This constructor transparently applies a compression stream on top of the file stream in case the given file extension suggests the user wants this. See the section on compression and decompression for more information.

◆ structure_file_output() [2/3]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<OStream2 stream_t, StructureFileOutputFormat file_format>
seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::structure_file_output ( stream_t &  stream,
file_format const &  format_tag,
selected_field_ids const &  fields_tag = selected_field_ids{} 
)
inline

Construct from an existing stream and with specified format.

Template Parameters
file_formatThe format of the file in the stream, must satisfy seqan3::StructureFileOutputFormat.
Parameters
[in,out]streamThe stream to write to, must be derived of std::basic_ostream.
[in]format_tagThe file format tag.
[in]fields_tagA seqan3::fields tag. [optional]

Compression

This constructor does not apply compression transparently (because there is no way to know if the user wants this). However, you can just pass e.g. seqan3::contrib::gz_ostream to this constructor if you explicitly want compression. See the section on compression and decompression for more information.

◆ structure_file_output() [3/3]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<OStream2 stream_t, StructureFileOutputFormat file_format>
seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::structure_file_output ( stream_t &&  stream,
file_format const &  format_tag,
selected_field_ids const &  fields_tag = selected_field_ids{} 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

◆ begin()

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
iterator seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::begin ( )
inlinenoexcept

Returns an iterator to current position in the file.

Returns
An iterator pointing to the current position in the file.

You can write to the file by assigning to the iterator, but using push_back() is usually more intuitive.

Complexity

Constant.

Exceptions

No-throw guarantee.

Example

structure_file_output fout{tmp_dir/"my.dbn"};
auto it = fout.begin();
for (int i = 0; i < 10; i++) // ...
{
std::string id{"test_id"};
rna5_vector seq{"AGGGUU"_rna5};
std::vector<wuss51> structure{"..().."_wuss51};
// ...
// assign to iterator
*it = std::tie(seq, id, structure);
// is the same as:
fout.push_back(std::tie(seq, id, structure));
}

◆ emplace_back()

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<typename arg_t , typename ... arg_types>
void seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::emplace_back ( arg_t &&  arg,
arg_types &&...  args 
)
inline

Write a record to the file by passing individual fields.

Template Parameters
arg_tType of the first field.
arg_typesTypes of further fields.
Parameters
[in]argThe first field to write.
[in]argsFurther fields.

The fields are assumed to correspond to the field IDs given in selected_field_ids, however passing less is accepted if the format does not require all of them.

Complexity

Constant. TODO linear in the size of the written sequences?

Exceptions

Basic exception safety.

Example

structure_file_output fout{tmp_dir/"my.dbn"};
auto it = fout.begin();
for (int i = 0; i < 10; i++) // ...
{
std::string id{"test_id"};
rna5_vector seq{"AGGGUU"_rna5};
std::vector<wuss51> structure{"..().."_wuss51};
// ...
fout.emplace_back(seq, id, structure);
}

◆ end()

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
sentinel seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::end ( )
inlinenoexcept

Returns a sentinel for comparison with iterator.

Returns
An end that is never reached.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour. It always compares false against an iterator.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ operator=() [1/3]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<std::ranges::InputRange rng_t>
structure_file_output& seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::operator= ( rng_t &&  range)
inline

Write a range of records (or tuples) to the file.

Template Parameters
rng_tType of the range, must satisfy std::ranges::OutputRange and have a reference type that satisfies seqan3::TupleLike.
Parameters
[in]rangeThe range to write.

This function simply iterates over the argument and calls push_back() on each element.

Complexity

Linear in the number of records.

Exceptions

Basic exception safety.

Example

structure_file_output fout{tmp_dir/"my.dbn"};
{
{ "ACGT"_rna5, "First", "...."_wuss51 },
{ "NATA"_rna5, "2nd", "...."_wuss51 },
{ "GATA"_rna5, "Third", "...."_wuss51 }
}; // a range of "records"
fout = range; // will iterate over the records and write them

◆ operator=() [2/3]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<typename typelist , typename field_ids >
structure_file_output& seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::operator= ( record< typelist, field_ids > const &  r)
inline

Write columns (wrapped in a seqan3::record) to the file.

Template Parameters
typelistTemplate argument to seqan3::record, each type must be a column (range-of-range).
field_idsTemplate argument to seqan3::record, the IDs corresponding to the columns.
Parameters
[in]rThe record of columns.
Attention
This is not part of the row-based file writing; the seqan3::record does not represent a file record, it is a tuple of the columns (with field information).

Complexity

Linear in the size of the columns.

Exceptions

Basic exception safety.

Example

// ... in your file writing function:
structure_file_output fout{tmp_dir/"my.dbn"};
fout = std::tie(data_storage.sequences, data_storage.ids, data_storage.structures);

◆ operator=() [3/3]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<typename ... arg_types>
structure_file_output& seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::operator= ( std::tuple< arg_types... > const &  t)
inline

Write columns (wrapped in a std::tuple) to the file.

Template Parameters
arg_typesThe column types, each type must be a range-of-range.
Parameters
[in]tThe tuple of columns.

The columns are assumed to correspond to the field IDs given in selected_field_ids, however passing less is accepted if the format does not require all of them.

Complexity

Linear in the size of the columns.

Exceptions

Basic exception safety.

Example

// ... in your file writing function:
structure_file_output fout{tmp_dir/"my.dbn"};
fout = std::tie(data_storage.sequences, data_storage.ids, data_storage.structures);

◆ push_back() [1/2]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<typename record_t >
void seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::push_back ( record_t &&  r) &&
inline

Write a seqan3::record to the file.

Template Parameters
record_tType of the record, a specialisation of seqan3::record.
Parameters
[in]rThe record to write.

Complexity

Constant. TODO linear in the size of the written sequences?

Exceptions

Basic exception safety.

Example

structure_file_input fin{tmp_dir/"input.dbn", fields<field::ID, field::SEQ, field::STRUCTURE>{}};
structure_file_output fout{tmp_dir/"my_wrong.dbn"}; // doesn't have to match the configuration
for (auto & r : fin)
{
if (criteria) // r fulfills some filter criterium
{
fout.push_back(r);
}
}

◆ push_back() [2/2]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<typename tuple_t >
void seqan3::structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ >::push_back ( tuple_t &&  t)
inline

Write a record in form of a std::tuple to the file.

Template Parameters
tuple_tType of the record, a specialisation of std::tuple.
Parameters
[in]tThe record to write.

The fields in the tuple are assumed to correspond to the field IDs given in selected_field_ids, however passing less is accepted if the format does not require all of them.

Complexity

Constant. TODO linear in the size of the written sequences?

Exceptions

Basic exception safety.

Example

structure_file_output fout{tmp_dir/"my.dbn"};
auto it = fout.begin();
for (int i = 0; i < 10; i++) // ...
{
std::string id{"test_id"};
rna5_vector seq{"AGGGUU"_rna5};
std::vector<wuss51> structure{"..().."_wuss51};
// ...
fout.push_back(std::tie(seq, id, structure));
}

Friends And Related Function Documentation

◆ operator| [1/2]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<std::ranges::InputRange rng_t>
structure_file_output& operator| ( rng_t &&  range,
structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ > &  f 
)
friend

Write a range of records (or tuples) to the file.

Template Parameters
rng_tType of the range, must satisfy std::ranges::InputRange and have a reference type that satisfies seqan3::TupleLike.
Parameters
[in]rangeThe range to write.
[in]fThe file being written to.

This operator enables structure_file_output to be at the end of a piping operation. It just calls operator=() internally.

Complexity

Linear in the number of records.

Exceptions

Basic exception safety.

Example

structure_file_output fout{tmp_dir/"my.dbn"};
{
{ "ACGT"_rna5, "First", "...."_wuss51 },
{ "NATA"_rna5, "2nd", "...."_wuss51 },
{ "GATA"_rna5, "Third", "...."_wuss51 }
}; // a range of "records"
range | fout;
// the same as:
fout = range;

This is especially useful in combination with file-based filters:

structure_file_input my_in{tmp_dir/"input.dbn"};
my_in | view::take(5) | structure_file_output{"output.dbn"};

◆ operator| [2/2]

template<detail::Fields selected_field_ids_ = fields<field::SEQ, field::ID, field::STRUCTURE>, detail::TypeListOfStructureFileOutputFormats valid_formats_ = type_list<format_vienna>, Char stream_char_type_ = char>
template<std::ranges::InputRange rng_t>
structure_file_output operator| ( rng_t &&  range,
structure_file_output< selected_field_ids_, valid_formats_, stream_char_type_ > &&  f 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ structure_file_output()

template<OStream2 stream_t, StructureFileOutputFormat file_format, detail::Fields selected_field_ids>
structure_file_output ( stream_t &  ,
file_format const &  ,
selected_field_ids const &   
) -> structure_file_output< selected_field_ids, type_list< file_format >, typename std::remove_reference_t< stream_t >::char_type >
related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


The documentation for this class was generated from the following file: