bpp-seq-omics  2.2.0
bpp::AlignmentFilterMafIterator Class Reference

Filter maf blocks to remove ambiguously aligned or non-informative regions. More...

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

+ Inheritance diagram for bpp::AlignmentFilterMafIterator:
+ Collaboration diagram for bpp::AlignmentFilterMafIterator:

Public Member Functions

 AlignmentFilterMafIterator (MafIterator *iterator, const std::vector< std::string > &species, unsigned int windowSize, unsigned int step, unsigned int maxGap, double maxEnt, bool keepTrashedBlocks, bool missingAsGap)
 
MafBlocknextRemovedBlock () throw (Exception)
 Get the next available removed alignment block. More...
 
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

MafBlockanalyseCurrentBlock_ () throw (Exception)
 

Private Attributes

std::vector< std::string > species_
 
unsigned int windowSize_
 
unsigned int step_
 
unsigned int maxGap_
 
double maxEnt_
 
std::deque< MafBlock * > blockBuffer_
 
std::deque< MafBlock * > trashBuffer_
 
std::deque< std::vector< int > > window_
 
bool keepTrashedBlocks_
 
bool missingAsGap_
 

Detailed Description

Filter maf blocks to remove ambiguously aligned or non-informative regions.

Regions with a too high proportion of gaps, unknown character or high entropy in a set of species will be removed, and blocks adjusted accordingly.

The total entropy of a window is defined as $ \frac{\sum_i {E(5)}_i}{w} $ where $E(5)_i$ is the shannon entropy of site i, computed using a logarithm of base 5, and w is the window size. As a result, the total entropy is normalized so that it falls between 0 and 1. A logarithm of base 5 is used to account for the fact that gaps are considered as a state.

In case a sequence from the list is missing, it can be either ignored or counted as a full sequence of gaps.

Definition at line 63 of file AlignmentFilterMafIterator.h.

Constructor & Destructor Documentation

◆ AlignmentFilterMafIterator()

bpp::AlignmentFilterMafIterator::AlignmentFilterMafIterator ( MafIterator iterator,
const std::vector< std::string > &  species,
unsigned int  windowSize,
unsigned int  step,
unsigned int  maxGap,
double  maxEnt,
bool  keepTrashedBlocks,
bool  missingAsGap 
)
inline

Definition at line 80 of file AlignmentFilterMafIterator.h.

Member Function Documentation

◆ addIterationListener()

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

Implements bpp::MafIterator.

Definition at line 99 of file MafIterator.h.

◆ analyseCurrentBlock_()

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

◆ nextRemovedBlock()

MafBlock* bpp::AlignmentFilterMafIterator::nextRemovedBlock ( )
throw (Exception
)
inlinevirtual

Get the next available removed alignment block.

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

Implements bpp::MafTrashIterator.

Definition at line 102 of file AlignmentFilterMafIterator.h.

References trashBuffer_.

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

Member Data Documentation

◆ blockBuffer_

std::deque<MafBlock*> bpp::AlignmentFilterMafIterator::blockBuffer_
private

Definition at line 73 of file AlignmentFilterMafIterator.h.

◆ currentBlock_

◆ iterationListeners_

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

Definition at line 89 of file MafIterator.h.

◆ iterator_

◆ keepTrashedBlocks_

bool bpp::AlignmentFilterMafIterator::keepTrashedBlocks_
private

Definition at line 76 of file AlignmentFilterMafIterator.h.

◆ logstream_

OutputStream* bpp::AbstractFilterMafIterator::logstream_
protectedinherited

◆ maxEnt_

double bpp::AlignmentFilterMafIterator::maxEnt_
private

Definition at line 72 of file AlignmentFilterMafIterator.h.

◆ maxGap_

unsigned int bpp::AlignmentFilterMafIterator::maxGap_
private

Definition at line 71 of file AlignmentFilterMafIterator.h.

◆ missingAsGap_

bool bpp::AlignmentFilterMafIterator::missingAsGap_
private

Definition at line 77 of file AlignmentFilterMafIterator.h.

◆ species_

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

Definition at line 68 of file AlignmentFilterMafIterator.h.

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

◆ step_

unsigned int bpp::AlignmentFilterMafIterator::step_
private

Definition at line 70 of file AlignmentFilterMafIterator.h.

◆ trashBuffer_

std::deque<MafBlock*> bpp::AlignmentFilterMafIterator::trashBuffer_
private

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

Definition at line 91 of file MafIterator.h.

◆ window_

std::deque< std::vector<int> > bpp::AlignmentFilterMafIterator::window_
private

Definition at line 75 of file AlignmentFilterMafIterator.h.

◆ windowSize_

unsigned int bpp::AlignmentFilterMafIterator::windowSize_
private

Definition at line 69 of file AlignmentFilterMafIterator.h.


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