bpp-seq-omics  2.2.0
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)
 Creates a new OutputAlignmentMafIterator object. More...
 
 OutputAlignmentMafIterator (MafIterator *iterator, const std::string &file, OAlignment *writer, bool mask=true)
 Creates a new OutputAlignmentMafIterator object. More...
 
 ~OutputAlignmentMafIterator ()
 
void setLogStream (OutputStream *logstream)
 
void addIterationListener (IterationListener *listener)
 
MafBlocknextBlock () throw (Exception)
 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_
 
OutputStream * logstream_
 
std::vector< IterationListener * > iterationListeners_
 
bool started_
 
bool verbose_
 

Private Member Functions

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

Private Attributes

std::ostream * output_
 
std::string file_
 
bool mask_
 
std::auto_ptr< OAlignment > writer_
 
unsigned int currentBlockIndex_
 

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 
)
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).

Definition at line 81 of file OutputAlignmentMafIterator.h.

◆ OutputAlignmentMafIterator() [2/3]

bpp::OutputAlignmentMafIterator::OutputAlignmentMafIterator ( MafIterator iterator,
const std::string &  file,
OAlignment *  writer,
bool  mask = true 
)
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).

Definition at line 100 of file OutputAlignmentMafIterator.h.

◆ ~OutputAlignmentMafIterator()

bpp::OutputAlignmentMafIterator::~OutputAlignmentMafIterator ( )
inline

Definition at line 107 of file OutputAlignmentMafIterator.h.

◆ OutputAlignmentMafIterator() [3/3]

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

Definition at line 110 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.

◆ analyseCurrentBlock_()

MafBlock * OutputAlignmentMafIterator::analyseCurrentBlock_ ( )
throw (Exception
)
privatevirtual

Implements bpp::AbstractMafIterator.

Definition at line 53 of file OutputAlignmentMafIterator.cpp.

◆ fireIterationMoveSignal_()

void AbstractMafIterator::fireIterationMoveSignal_ ( const MafBlock currentBlock)
protectedvirtualinherited

Definition at line 57 of file MafIterator.cpp.

◆ fireIterationStartSignal_()

void AbstractMafIterator::fireIterationStartSignal_ ( )
protectedvirtualinherited

Definition at line 51 of file MafIterator.cpp.

◆ fireIterationStopSignal_()

void AbstractMafIterator::fireIterationStopSignal_ ( )
protectedvirtualinherited

Definition at line 63 of file MafIterator.cpp.

◆ isVerbose()

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

Implements bpp::MafIterator.

Definition at line 116 of file MafIterator.h.

◆ nextBlock()

MafBlock* bpp::AbstractMafIterator::nextBlock ( )
throw (Exception
)
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.

◆ operator=()

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

Definition at line 119 of file OutputAlignmentMafIterator.h.

References currentBlockIndex_, file_, mask_, output_, and writer_.

◆ setLogStream()

void bpp::AbstractFilterMafIterator::setLogStream ( OutputStream *  logstream)
inlineinherited

Definition at line 178 of file MafIterator.h.

◆ setVerbose()

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

Implements bpp::MafIterator.

Definition at line 117 of file MafIterator.h.

◆ writeBlock()

Member Data Documentation

◆ currentBlock_

◆ currentBlockIndex_

unsigned int bpp::OutputAlignmentMafIterator::currentBlockIndex_
private

Definition at line 67 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.

◆ iterator_

◆ logstream_

OutputStream* bpp::AbstractFilterMafIterator::logstream_
protectedinherited

◆ 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=().

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

Definition at line 91 of file MafIterator.h.

◆ writer_

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

Definition at line 66 of file OutputAlignmentMafIterator.h.

Referenced by operator=().


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