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

This iterator outputs all SNPs in the format readable by MSMC. More...

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

+ Inheritance diagram for bpp::MsmcOutputMafIterator:
+ Collaboration diagram for bpp::MsmcOutputMafIterator:

Public Member Functions

 MsmcOutputMafIterator (MafIterator *iterator, std::ostream *out, const std::vector< std::string > &species, const std::string &reference)
 Build a new MsmcOutputMafIterator object. More...
 
MafBlockanalyseCurrentBlock_ ()
 
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

 MsmcOutputMafIterator (const MsmcOutputMafIterator &iterator)
 
MsmcOutputMafIteratoroperator= (const MsmcOutputMafIterator &iterator)
 
void writeBlock_ (std::ostream &out, const MafBlock &block)
 

Private Attributes

std::ostream * output_
 
std::vector< std::string > species_
 
std::string refSpecies_
 
std::string currentChr_
 
size_t lastPosition_
 
unsigned int nbOfCalledSites_
 

Detailed Description

This iterator outputs all SNPs in the format readable by MSMC.

See https://github.com/stschiff/msmc for a format description.

Definition at line 57 of file MsmcOutputMafIterator.h.

Constructor & Destructor Documentation

◆ MsmcOutputMafIterator() [1/2]

bpp::MsmcOutputMafIterator::MsmcOutputMafIterator ( MafIterator iterator,
std::ostream *  out,
const std::vector< std::string > &  species,
const std::string &  reference 
)
inline

Build a new MsmcOutputMafIterator object.

Parameters
iteratorThe input iterator.
outThe output stream where to write the MSMC file.
speciesA list of at least two species to compute SNPs. Only blocks containing at least these two species will be used. In case one species is duplicated in a block, the first sequence will be used.
referenceThe species to use as a reference for coordinates. It does not have to be one of the selected species on which SNPs are computed.

Definition at line 80 of file MsmcOutputMafIterator.h.

◆ MsmcOutputMafIterator() [2/2]

bpp::MsmcOutputMafIterator::MsmcOutputMafIterator ( const MsmcOutputMafIterator iterator)
inlineprivate

Definition at line 90 of file MsmcOutputMafIterator.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_()

MafBlock* bpp::MsmcOutputMafIterator::analyseCurrentBlock_ ( )
inlinevirtual

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

MsmcOutputMafIterator& bpp::MsmcOutputMafIterator::operator= ( const MsmcOutputMafIterator 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

◆ currentBlock_

◆ currentChr_

std::string bpp::MsmcOutputMafIterator::currentChr_
private

Definition at line 64 of file MsmcOutputMafIterator.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_

◆ lastPosition_

size_t bpp::MsmcOutputMafIterator::lastPosition_
private

Definition at line 65 of file MsmcOutputMafIterator.h.

Referenced by operator=().

◆ logstream_

◆ nbOfCalledSites_

unsigned int bpp::MsmcOutputMafIterator::nbOfCalledSites_
private

Definition at line 66 of file MsmcOutputMafIterator.h.

Referenced by operator=().

◆ output_

std::ostream* bpp::MsmcOutputMafIterator::output_
private

Definition at line 61 of file MsmcOutputMafIterator.h.

Referenced by analyseCurrentBlock_(), and operator=().

◆ refSpecies_

std::string bpp::MsmcOutputMafIterator::refSpecies_
private

Definition at line 63 of file MsmcOutputMafIterator.h.

Referenced by operator=().

◆ species_

std::vector<std::string> bpp::MsmcOutputMafIterator::species_
private

Definition at line 62 of file MsmcOutputMafIterator.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

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