bpp-seq-omics
2.4.1
|
Compute a series of sequence statistics for each block. More...
#include <Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.h>
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) |
MafBlock * | nextBlock () |
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 ¤tBlock) |
virtual void | fireIterationStopSignal_ () |
Protected Attributes | |
MafIterator * | iterator_ |
MafBlock * | currentBlock_ |
std::shared_ptr< OutputStream > | logstream_ |
std::vector< IterationListener * > | iterationListeners_ |
bool | started_ |
bool | verbose_ |
Private Member Functions | |
SequenceStatisticsMafIterator (const SequenceStatisticsMafIterator &iterator) | |
SequenceStatisticsMafIterator & | operator= (const SequenceStatisticsMafIterator &iterator) |
MafBlock * | analyseCurrentBlock_ () |
Private Attributes | |
std::vector< MafStatistics * > | statistics_ |
std::vector< const BppNumberI * > | results_ |
std::vector< std::string > | names_ |
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.
SequenceStatisticsMafIterator::SequenceStatisticsMafIterator | ( | MafIterator * | iterator, |
const std::vector< MafStatistics * > | statistics | ||
) |
iterator | The input iterator. |
statistics | A 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_.
|
inlineprivate |
Definition at line 81 of file SequenceStatisticsMafIterator.h.
|
inlinevirtualinherited |
Implements bpp::MafIterator.
Definition at line 99 of file MafIterator.h.
References bpp::AbstractMafIterator::iterationListeners_.
|
privatevirtual |
Implements bpp::AbstractMafIterator.
Definition at line 71 of file SequenceStatisticsMafIterator.cpp.
References bpp::BppNumberI::clone(), bpp::AbstractFilterMafIterator::currentBlock_, bpp::MafStatisticsResult::getValue(), bpp::MafStatisticsResult::hasValue(), bpp::AbstractFilterMafIterator::iterator_, bpp::MafIterator::nextBlock(), results_, and statistics_.
|
protectedvirtualinherited |
Definition at line 57 of file MafIterator.cpp.
Referenced by bpp::AbstractMafIterator::nextBlock().
|
protectedvirtualinherited |
Definition at line 51 of file MafIterator.cpp.
Referenced by bpp::AbstractMafIterator::nextBlock().
|
protectedvirtualinherited |
Definition at line 63 of file MafIterator.cpp.
Referenced by bpp::AbstractMafIterator::nextBlock().
|
inline |
Definition at line 97 of file SequenceStatisticsMafIterator.h.
References results_.
|
inline |
Definition at line 98 of file SequenceStatisticsMafIterator.h.
References names_.
|
inlinevirtualinherited |
Implements bpp::MafIterator.
Definition at line 116 of file MafIterator.h.
References bpp::AbstractMafIterator::verbose_.
|
inlinevirtualinherited |
Get the next available alignment block.
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_.
|
inlineprivate |
Definition at line 88 of file SequenceStatisticsMafIterator.h.
References names_, results_, and statistics_.
|
inlineinherited |
Definition at line 178 of file MafIterator.h.
References bpp::AbstractFilterMafIterator::logstream_.
|
inlinevirtualinherited |
Implements bpp::MafIterator.
Definition at line 117 of file MafIterator.h.
References bpp::AbstractMafIterator::verbose_.
|
protectedinherited |
Definition at line 154 of file MafIterator.h.
Referenced by bpp::BlockLengthMafIterator::analyseCurrentBlock_(), bpp::BlockSizeMafIterator::analyseCurrentBlock_(), bpp::MafIteratorSynchronizer::analyseCurrentBlock_(), bpp::MsmcOutputMafIterator::analyseCurrentBlock_(), bpp::OrderFilterMafIterator::analyseCurrentBlock_(), bpp::OutputMafIterator::analyseCurrentBlock_(), bpp::PlinkOutputMafIterator::analyseCurrentBlock_(), analyseCurrentBlock_(), bpp::TableOutputMafIterator::analyseCurrentBlock_(), bpp::VcfOutputMafIterator::analyseCurrentBlock_(), and bpp::AbstractFilterMafIterator::operator=().
|
protectedinherited |
Definition at line 89 of file MafIterator.h.
Referenced by bpp::AbstractMafIterator::addIterationListener().
|
protectedinherited |
Definition at line 153 of file MafIterator.h.
Referenced by bpp::BlockLengthMafIterator::analyseCurrentBlock_(), bpp::BlockSizeMafIterator::analyseCurrentBlock_(), bpp::MafIteratorSynchronizer::analyseCurrentBlock_(), bpp::MsmcOutputMafIterator::analyseCurrentBlock_(), bpp::OrderFilterMafIterator::analyseCurrentBlock_(), bpp::OutputMafIterator::analyseCurrentBlock_(), bpp::PlinkOutputMafIterator::analyseCurrentBlock_(), analyseCurrentBlock_(), bpp::TableOutputMafIterator::analyseCurrentBlock_(), bpp::VcfOutputMafIterator::analyseCurrentBlock_(), and bpp::AbstractFilterMafIterator::operator=().
|
protectedinherited |
Definition at line 155 of file MafIterator.h.
Referenced by bpp::BlockLengthMafIterator::analyseCurrentBlock_(), bpp::BlockSizeMafIterator::analyseCurrentBlock_(), bpp::AbstractFilterMafIterator::operator=(), and bpp::AbstractFilterMafIterator::setLogStream().
|
private |
Definition at line 71 of file SequenceStatisticsMafIterator.h.
Referenced by getResultsColumnNames(), operator=(), and SequenceStatisticsMafIterator().
|
private |
Definition at line 70 of file SequenceStatisticsMafIterator.h.
Referenced by analyseCurrentBlock_(), getResults(), operator=(), and SequenceStatisticsMafIterator().
|
protectedinherited |
Definition at line 90 of file MafIterator.h.
Referenced by bpp::AbstractMafIterator::nextBlock().
|
private |
Definition at line 69 of file SequenceStatisticsMafIterator.h.
Referenced by analyseCurrentBlock_(), operator=(), and SequenceStatisticsMafIterator().
|
protectedinherited |
Definition at line 91 of file MafIterator.h.
Referenced by bpp::AbstractMafIterator::isVerbose(), and bpp::AbstractMafIterator::setVerbose().