A library for working with phylogenetic and population genetic data.
v0.32.0
FastxOutputStream< Writer > Class Template Reference

#include <genesis/sequence/formats/fastx_output_stream.hpp>

Detailed Description

template<class Writer>
class genesis::sequence::FastxOutputStream< Writer >

Write Fasta or Fastq data, sequentially.

This class allows to write Sequence data to an output target, using Fasta or Fastq format, without the need to have a full SequenceSet containing all Sequences in memory.

Exemplary usage:

auto out_it = FastqOutputStream( utils::to_file( "path/to/out.fastq" ));
while( ... ) {
    Sequence seq = ...
    out_it << seq;
}

See the output target convenience functions utils::to_file(), utils::to_stream(), and utils::to_string() for examples of how to obtain a suitable output target.

Definition at line 57 of file fastx_output_stream.hpp.

Public Member Functions

 FastxOutputStream ()=delete
 
 FastxOutputStream (self_type &&)=default
 
 FastxOutputStream (self_type const &)=default
 
 FastxOutputStream (std::shared_ptr< utils::BaseOutputTarget > target)
 
 FastxOutputStream (std::shared_ptr< utils::BaseOutputTarget > target, Writer const &writer)
 
 ~FastxOutputStream ()=default
 
self_type const & operator<< (Sequence const &sequence) const
 
self_typeoperator= (self_type &&)=default
 
self_typeoperator= (self_type const &)=default
 
std::shared_ptr< utils::BaseOutputTargetoutput_target () const
 
self_type const & write (Sequence const &sequence) const
 
template<typename T = Writer, typename std::enable_if< std::is_same< T, FastqWriter >::value >::type * = nullptr>
self_type const & write (Sequence const &sequence, std::string const &quality_string) const
 Writer overload for Fastq files where the quality_string is provided instead of taken from the sequence. More...
 
Writer & writer ()
 Return the Writer used for this iterator. More...
 
Writer const & writer () const
 

Public Types

using self_type = FastxOutputStream
 

Constructor & Destructor Documentation

◆ FastxOutputStream() [1/5]

FastxOutputStream ( )
delete

◆ FastxOutputStream() [2/5]

FastxOutputStream ( std::shared_ptr< utils::BaseOutputTarget target)
inlineexplicit

Definition at line 100 of file fastx_output_stream.hpp.

◆ FastxOutputStream() [3/5]

FastxOutputStream ( std::shared_ptr< utils::BaseOutputTarget target,
Writer const &  writer 
)
inline

Definition at line 107 of file fastx_output_stream.hpp.

◆ ~FastxOutputStream()

~FastxOutputStream ( )
default

◆ FastxOutputStream() [4/5]

FastxOutputStream ( self_type const &  )
default

◆ FastxOutputStream() [5/5]

FastxOutputStream ( self_type &&  )
default

Member Function Documentation

◆ operator<<()

self_type const& operator<< ( Sequence const &  sequence) const
inline

Definition at line 127 of file fastx_output_stream.hpp.

◆ operator=() [1/2]

self_type& operator= ( self_type &&  )
default

◆ operator=() [2/2]

self_type& operator= ( self_type const &  )
default

◆ output_target()

std::shared_ptr<utils::BaseOutputTarget> output_target ( ) const
inline

Definition at line 180 of file fastx_output_stream.hpp.

◆ write() [1/2]

self_type const& write ( Sequence const &  sequence) const
inline

Definition at line 133 of file fastx_output_stream.hpp.

◆ write() [2/2]

self_type const& write ( Sequence const &  sequence,
std::string const &  quality_string 
) const
inline

Writer overload for Fastq files where the quality_string is provided instead of taken from the sequence.

Definition at line 147 of file fastx_output_stream.hpp.

◆ writer() [1/2]

Writer& writer ( )
inline

Return the Writer used for this iterator.

Use this to change the settings and writing behaviour of the iterator. See Writer for details.

Definition at line 191 of file fastx_output_stream.hpp.

◆ writer() [2/2]

Writer const& writer ( ) const
inline

Definition at line 196 of file fastx_output_stream.hpp.

Member Typedef Documentation

◆ self_type

Definition at line 92 of file fastx_output_stream.hpp.


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