bpp-seq-omics  2.4.1
bpp::OutputAlignmentMafIterator Class Reference

This iterator forward the iterator given as input after having printed its content to an alignment file. The syntax for ENSEMBL meta data is used. More...

#include <Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.h>

+ Inheritance diagram for bpp::OutputAlignmentMafIterator:
+ Collaboration diagram for bpp::OutputAlignmentMafIterator:

Public Member Functions

 OutputAlignmentMafIterator (MafIterator *iterator, std::ostream *out, OAlignment *writer, bool mask=true, bool outputCoordinates=true, bool addLDHatHeader=false, const std::string &reference="")
 Creates a new OutputAlignmentMafIterator object. More...
 
 OutputAlignmentMafIterator (MafIterator *iterator, const std::string &file, OAlignment *writer, bool mask=true, bool outputCoordinates=true, bool addLDHatHeader=false, const std::string &reference="")
 Creates a new OutputAlignmentMafIterator object. More...
 
 ~OutputAlignmentMafIterator ()
 
void setLogStream (std::shared_ptr< OutputStream > logstream)
 
void addIterationListener (IterationListener *listener)
 
MafBlocknextBlock ()
 Get the next available alignment block. More...
 
bool isVerbose () const
 
void setVerbose (bool yn)
 

Protected Member Functions

virtual void fireIterationStartSignal_ ()
 
virtual void fireIterationMoveSignal_ (const MafBlock &currentBlock)
 
virtual void fireIterationStopSignal_ ()
 

Protected Attributes

MafIteratoriterator_
 
MafBlockcurrentBlock_
 
std::shared_ptr< OutputStreamlogstream_
 
std::vector< IterationListener * > iterationListeners_
 
bool started_
 
bool verbose_
 

Private Member Functions

 OutputAlignmentMafIterator (const OutputAlignmentMafIterator &iterator)
 
OutputAlignmentMafIteratoroperator= (const OutputAlignmentMafIterator &iterator)
 
MafBlockanalyseCurrentBlock_ ()
 
void writeBlock (std::ostream &out, const MafBlock &block) const
 

Private Attributes

std::ostream * output_
 
std::string file_
 
bool mask_
 
bool outputCoordinates_
 
bool addLDHatHeader_
 
std::unique_ptr< OAlignmentwriter_
 
unsigned int currentBlockIndex_
 
std::string refSpecies_
 

Detailed Description

This iterator forward the iterator given as input after having printed its content to an alignment file. The syntax for ENSEMBL meta data is used.

Definition at line 59 of file OutputAlignmentMafIterator.h.

Constructor & Destructor Documentation

◆ OutputAlignmentMafIterator() [1/3]

bpp::OutputAlignmentMafIterator::OutputAlignmentMafIterator ( MafIterator iterator,
std::ostream *  out,
OAlignment writer,
bool  mask = true,
bool  outputCoordinates = true,
bool  addLDHatHeader = false,
const std::string &  reference = "" 
)
inline

Creates a new OutputAlignmentMafIterator object.

All block will be printed as separate alignment, yet one after the other on the stream. Be aware that not all format will recognize the resulting file as a multiple alignment file (Mase and Clustal will for instance, not Fasta).

Parameters
iteratorThe input iterator
outA pointer toward the output stream. The stream will not be own by this instance, and will not be copied neither destroyed.
writerA pointer toward an alignment writer object which specifies the format to use when writing sequences. The underlying object will be own by this instance, and destroyed when this object is deleted.
maskTell if sequences should be printed masked (if applicable).
outputCoordinatesTell if coordinates should be written in sequence headers, if any.
addLDHatHeaderTell if first line of file should contain number and lenght of sequences (for instance for use with LDhat/convert).
reference[optional] specify a reference species which can be used to configure file names (for instance using coordinates information).

Definition at line 88 of file OutputAlignmentMafIterator.h.

◆ OutputAlignmentMafIterator() [2/3]

bpp::OutputAlignmentMafIterator::OutputAlignmentMafIterator ( MafIterator iterator,
const std::string &  file,
OAlignment writer,
bool  mask = true,
bool  outputCoordinates = true,
bool  addLDHatHeader = false,
const std::string &  reference = "" 
)
inline

Creates a new OutputAlignmentMafIterator object.

All block will be printed as separate alignment, yet one after the other on the stream. Be aware that not all format will recognize the resulting file as a multiple alignment file (Mase and Clustal will for instance, not Fasta).

Parameters
iteratorThe input iterator
fileA string describing the path to the output files. Each block will be written to a distinct file. If "file" is a fixed string, it will only contain the last block. Using the i code in the file name allows to generate one file per block, i denoting the block index.
writerA pointer toward an alignment writer object which specifies the format to use when writing sequences. The underlying object will be own by this instance, and destroyed when this object is deleted.
maskTell if sequences should be printed masked (if applicable).
outputCoordinatesTell if coordinates should be written in sequence headers, if any.
addLDHatHeaderTell if first line of file should contain number and lenght of sequences (for instance for use with LDhat/convert).
reference[optional] specify a reference species which can be used to configure file names (for instance using coordinates information).

Definition at line 126 of file OutputAlignmentMafIterator.h.

◆ ~OutputAlignmentMafIterator()

bpp::OutputAlignmentMafIterator::~OutputAlignmentMafIterator ( )
inline

Definition at line 148 of file OutputAlignmentMafIterator.h.

◆ OutputAlignmentMafIterator() [3/3]

bpp::OutputAlignmentMafIterator::OutputAlignmentMafIterator ( const OutputAlignmentMafIterator iterator)
inlineprivate

Definition at line 151 of file OutputAlignmentMafIterator.h.

Member Function Documentation

◆ addIterationListener()

void bpp::AbstractMafIterator::addIterationListener ( IterationListener listener)
inlinevirtualinherited

Implements bpp::MafIterator.

Definition at line 99 of file MafIterator.h.

References bpp::AbstractMafIterator::iterationListeners_.

◆ analyseCurrentBlock_()

◆ fireIterationMoveSignal_()

void AbstractMafIterator::fireIterationMoveSignal_ ( const MafBlock currentBlock)
protectedvirtualinherited

Definition at line 57 of file MafIterator.cpp.

Referenced by bpp::AbstractMafIterator::nextBlock().

◆ fireIterationStartSignal_()

void AbstractMafIterator::fireIterationStartSignal_ ( )
protectedvirtualinherited

Definition at line 51 of file MafIterator.cpp.

Referenced by bpp::AbstractMafIterator::nextBlock().

◆ fireIterationStopSignal_()

void AbstractMafIterator::fireIterationStopSignal_ ( )
protectedvirtualinherited

Definition at line 63 of file MafIterator.cpp.

Referenced by bpp::AbstractMafIterator::nextBlock().

◆ isVerbose()

bool bpp::AbstractMafIterator::isVerbose ( ) const
inlinevirtualinherited

Implements bpp::MafIterator.

Definition at line 116 of file MafIterator.h.

References bpp::AbstractMafIterator::verbose_.

◆ nextBlock()

MafBlock* bpp::AbstractMafIterator::nextBlock ( )
inlinevirtualinherited

Get the next available alignment block.

Returns
A maf alignment block, or a null pointer if no more block is available.

Implements bpp::MafIterator.

Definition at line 103 of file MafIterator.h.

References bpp::AbstractMafIterator::analyseCurrentBlock_(), bpp::AbstractMafIterator::fireIterationMoveSignal_(), bpp::AbstractMafIterator::fireIterationStartSignal_(), bpp::AbstractMafIterator::fireIterationStopSignal_(), and bpp::AbstractMafIterator::started_.

◆ operator=()

OutputAlignmentMafIterator& bpp::OutputAlignmentMafIterator::operator= ( const OutputAlignmentMafIterator iterator)
inlineprivate

◆ setLogStream()

void bpp::AbstractFilterMafIterator::setLogStream ( std::shared_ptr< OutputStream logstream)
inlineinherited

Definition at line 178 of file MafIterator.h.

References bpp::AbstractFilterMafIterator::logstream_.

◆ setVerbose()

void bpp::AbstractMafIterator::setVerbose ( bool  yn)
inlinevirtualinherited

Implements bpp::MafIterator.

Definition at line 117 of file MafIterator.h.

References bpp::AbstractMafIterator::verbose_.

◆ writeBlock()

Member Data Documentation

◆ addLDHatHeader_

bool bpp::OutputAlignmentMafIterator::addLDHatHeader_
private

Definition at line 67 of file OutputAlignmentMafIterator.h.

Referenced by operator=().

◆ currentBlock_

◆ currentBlockIndex_

unsigned int bpp::OutputAlignmentMafIterator::currentBlockIndex_
private

Definition at line 69 of file OutputAlignmentMafIterator.h.

Referenced by operator=().

◆ file_

std::string bpp::OutputAlignmentMafIterator::file_
private

Definition at line 64 of file OutputAlignmentMafIterator.h.

Referenced by operator=().

◆ iterationListeners_

std::vector<IterationListener*> bpp::AbstractMafIterator::iterationListeners_
protectedinherited

Definition at line 89 of file MafIterator.h.

Referenced by bpp::AbstractMafIterator::addIterationListener().

◆ iterator_

◆ logstream_

◆ mask_

bool bpp::OutputAlignmentMafIterator::mask_
private

Definition at line 65 of file OutputAlignmentMafIterator.h.

Referenced by operator=().

◆ output_

std::ostream* bpp::OutputAlignmentMafIterator::output_
private

Definition at line 63 of file OutputAlignmentMafIterator.h.

Referenced by operator=().

◆ outputCoordinates_

bool bpp::OutputAlignmentMafIterator::outputCoordinates_
private

Definition at line 66 of file OutputAlignmentMafIterator.h.

Referenced by operator=().

◆ refSpecies_

std::string bpp::OutputAlignmentMafIterator::refSpecies_
private

Definition at line 70 of file OutputAlignmentMafIterator.h.

Referenced by operator=().

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

Referenced by bpp::AbstractMafIterator::nextBlock().

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

◆ writer_

std::unique_ptr<OAlignment> bpp::OutputAlignmentMafIterator::writer_
private

Definition at line 68 of file OutputAlignmentMafIterator.h.

Referenced by operator=().


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