bpp-seq-omics  2.4.1
bpp::AlignmentFilter2MafIterator 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::AlignmentFilter2MafIterator:
+ Collaboration diagram for bpp::AlignmentFilter2MafIterator:

Public Member Functions

 AlignmentFilter2MafIterator (MafIterator *iterator, const std::vector< std::string > &species, unsigned int windowSize, unsigned int step, unsigned int maxGap, unsigned int maxPos, bool keepTrashedBlocks, bool missingAsGap)
 Create a new AlignmentFilter2MafIterator with absolute thresholds. More...
 
 AlignmentFilter2MafIterator (MafIterator *iterator, const std::vector< std::string > &species, unsigned int windowSize, unsigned int step, double maxPropGap, unsigned int maxPos, bool keepTrashedBlocks, bool missingAsGap)
 Create a new AlignmentFilterMafIterator with relative thresholds. More...
 
MafBlocknextRemovedBlock ()
 Get the next available removed alignment block. More...
 
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

MafBlockanalyseCurrentBlock_ ()
 

Private Attributes

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

Detailed Description

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

This iterators offers a different algorithm than AlignmentFilterMafIterator. It takes two parameters: g=maxGap and n=maxPos. Windows with more than n positions containing each of them more than g=maxPos gaps will be discarded. In addition, consecutives patterns are only counted once. 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 176 of file AlignmentFilterMafIterator.h.

Constructor & Destructor Documentation

◆ AlignmentFilter2MafIterator() [1/2]

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

Create a new AlignmentFilter2MafIterator with absolute thresholds.

Parameters
iteratorInput iterator
speciesSelection of species on which filtering criteria are applied. Results of filtering will be applied to all species.
windowSizeSize of the sliding window (nt).
stepStep by which windows are moved (nt).
maxGapMaximum number of gaps allowed in the window.
maxPosMaximum number of gaps "events" allowed.
keepTrashedBlocksRemoved windows are kept as separate blocks.
missingAsGapAdd missing species as gap sequences where needed.

Definition at line 208 of file AlignmentFilterMafIterator.h.

◆ AlignmentFilter2MafIterator() [2/2]

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

Create a new AlignmentFilterMafIterator with relative thresholds.

Parameters
iteratorInput iterator
speciesSelection of species on which filtering criteria are applied. Results of filtering will be applied to all species.
windowSizeSize of the sliding window (nt).
stepStep by which windows are moved (nt).
maxPropGapMaximum proportion of gaps allowed in the window.
maxPosMaximum number of gaps "events" allowed.
keepTrashedBlocksRemoved windows are kept as separate blocks.
missingAsGapAdd missing species as gap sequences where needed.

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

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

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

◆ nextRemovedBlock()

MafBlock* bpp::AlignmentFilter2MafIterator::nextRemovedBlock ( )
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 254 of file AlignmentFilterMafIterator.h.

References trashBuffer_.

◆ 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

◆ blockBuffer_

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

Definition at line 187 of file AlignmentFilterMafIterator.h.

◆ currentBlock_

◆ iterationListeners_

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

Definition at line 89 of file MafIterator.h.

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

◆ iterator_

◆ keepTrashedBlocks_

bool bpp::AlignmentFilter2MafIterator::keepTrashedBlocks_
private

Definition at line 190 of file AlignmentFilterMafIterator.h.

◆ logstream_

◆ maxGap_

unsigned int bpp::AlignmentFilter2MafIterator::maxGap_
private

Definition at line 184 of file AlignmentFilterMafIterator.h.

◆ maxPos_

unsigned int bpp::AlignmentFilter2MafIterator::maxPos_
private

Definition at line 186 of file AlignmentFilterMafIterator.h.

◆ maxPropGap_

double bpp::AlignmentFilter2MafIterator::maxPropGap_
private

Definition at line 185 of file AlignmentFilterMafIterator.h.

◆ missingAsGap_

bool bpp::AlignmentFilter2MafIterator::missingAsGap_
private

Definition at line 191 of file AlignmentFilterMafIterator.h.

◆ relative_

bool bpp::AlignmentFilter2MafIterator::relative_
private

Definition at line 192 of file AlignmentFilterMafIterator.h.

◆ species_

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

Definition at line 181 of file AlignmentFilterMafIterator.h.

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

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

◆ step_

unsigned int bpp::AlignmentFilter2MafIterator::step_
private

Definition at line 183 of file AlignmentFilterMafIterator.h.

◆ trashBuffer_

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

Definition at line 188 of file AlignmentFilterMafIterator.h.

Referenced by nextRemovedBlock().

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

◆ window_

std::deque< std::vector<bool> > bpp::AlignmentFilter2MafIterator::window_
private

Definition at line 189 of file AlignmentFilterMafIterator.h.

◆ windowSize_

unsigned int bpp::AlignmentFilter2MafIterator::windowSize_
private

Definition at line 182 of file AlignmentFilterMafIterator.h.


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