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

Compute a series of sequence statistics for each block. More...

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

+ Inheritance diagram for bpp::SequenceStatisticsMafIterator:
+ Collaboration diagram for bpp::SequenceStatisticsMafIterator:

Public Member Functions

 SequenceStatisticsMafIterator (MafIterator *iterator, const std::vector< MafStatistics * > statistics)
 
const std::vector< const BppNumberI * > & getResults () const
 
const std::vector< std::string > & getResultsColumnNames () const
 
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

 SequenceStatisticsMafIterator (const SequenceStatisticsMafIterator &iterator)
 
SequenceStatisticsMafIteratoroperator= (const SequenceStatisticsMafIterator &iterator)
 
MafBlockanalyseCurrentBlock_ ()
 

Private Attributes

std::vector< MafStatistics * > statistics_
 
std::vector< const BppNumberI * > results_
 
std::vector< std::string > names_
 

Detailed Description

Compute a series of sequence statistics for each block.

Computed statistics are stored into a vector of double, which can be retrieved as well as statistics names. Listeners can be set up to automatically analyse or write the output after iterations are over.

The current implementation focuses on speed and memory efificiency, as it only stores in memory the current results of the statistics. The only drawback of this, is that disk access might be high when writing the results, although appropriate buffering should most likely circumvent the issue. The code is easily extensible, however, to enable storage of all results into a matrix, with writing only once at the end of iterations.

Definition at line 65 of file SequenceStatisticsMafIterator.h.

Constructor & Destructor Documentation

◆ SequenceStatisticsMafIterator() [1/2]

SequenceStatisticsMafIterator::SequenceStatisticsMafIterator ( MafIterator iterator,
const std::vector< MafStatistics * >  statistics 
)
Parameters
iteratorThe input iterator.
statisticsA vector of pointers toward MafStatistics, to be computed simultaneously for each maf block.

Definition at line 50 of file SequenceStatisticsMafIterator.cpp.

References names_, results_, and statistics_.

◆ SequenceStatisticsMafIterator() [2/2]

bpp::SequenceStatisticsMafIterator::SequenceStatisticsMafIterator ( const SequenceStatisticsMafIterator iterator)
inlineprivate

Definition at line 81 of file SequenceStatisticsMafIterator.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().

◆ getResults()

const std::vector<const BppNumberI*>& bpp::SequenceStatisticsMafIterator::getResults ( ) const
inline

Definition at line 97 of file SequenceStatisticsMafIterator.h.

References results_.

◆ getResultsColumnNames()

const std::vector<std::string>& bpp::SequenceStatisticsMafIterator::getResultsColumnNames ( ) const
inline

Definition at line 98 of file SequenceStatisticsMafIterator.h.

References names_.

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

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

Definition at line 88 of file SequenceStatisticsMafIterator.h.

References names_, results_, and statistics_.

◆ 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_.

Member Data Documentation

◆ currentBlock_

◆ iterationListeners_

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

Definition at line 89 of file MafIterator.h.

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

◆ iterator_

◆ logstream_

◆ names_

std::vector<std::string> bpp::SequenceStatisticsMafIterator::names_
private

◆ results_

std::vector<const BppNumberI*> bpp::SequenceStatisticsMafIterator::results_
private

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

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

◆ statistics_

std::vector<MafStatistics*> bpp::SequenceStatisticsMafIterator::statistics_
private

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

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