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

Filter maf blocks to keep a subset of sequences, given their name. this filter can also be used to filter block which contain a certain set of sequences. More...

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

+ Inheritance diagram for bpp::SequenceFilterMafIterator:
+ Collaboration diagram for bpp::SequenceFilterMafIterator:

Public Member Functions

 SequenceFilterMafIterator (MafIterator *iterator, const std::vector< std::string > &species, bool strict=false, bool keep=false, bool rmDuplicates=false)
 
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

 SequenceFilterMafIterator (const SequenceFilterMafIterator &iterator)
 
SequenceFilterMafIteratoroperator= (const SequenceFilterMafIterator &iterator)
 
MafBlockanalyseCurrentBlock_ ()
 

Private Attributes

std::vector< std::string > species_
 
bool strict_
 
bool keep_
 
bool rmDuplicates_
 

Detailed Description

Filter maf blocks to keep a subset of sequences, given their name. this filter can also be used to filter block which contain a certain set of sequences.

Typical usage:

  • strict=yes, keep=no: extract the species from the list, only if all of them are present in a block.
  • strict=no, keep=no: extract the species from the list, at least the one which are there.
  • strict=yes, keep=yes: filter blocks to retain only the ones that contain at least all species from the list. Blocks that are empty after the filtering are removed.

Definition at line 62 of file SequenceFilterMafIterator.h.

Constructor & Destructor Documentation

◆ SequenceFilterMafIterator() [1/2]

bpp::SequenceFilterMafIterator::SequenceFilterMafIterator ( MafIterator iterator,
const std::vector< std::string > &  species,
bool  strict = false,
bool  keep = false,
bool  rmDuplicates = false 
)
inline
Parameters
iteratorThe input iterator.
speciesThe list of species names to be retained.
strictIf true, then block that do not contain all species will be discarded.
keepIf true, sequences not in the selection will be kept.
rmDuplicatesIf true, block that contain more than one instance for at least one species will be discarded.

Definition at line 79 of file SequenceFilterMafIterator.h.

◆ SequenceFilterMafIterator() [2/2]

bpp::SequenceFilterMafIterator::SequenceFilterMafIterator ( const SequenceFilterMafIterator iterator)
inlineprivate

Definition at line 88 of file SequenceFilterMafIterator.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 * SequenceFilterMafIterator::analyseCurrentBlock_ ( )
privatevirtual

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

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

Definition at line 96 of file SequenceFilterMafIterator.h.

References keep_, rmDuplicates_, species_, and strict_.

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

◆ keep_

bool bpp::SequenceFilterMafIterator::keep_
private

Definition at line 68 of file SequenceFilterMafIterator.h.

Referenced by operator=().

◆ logstream_

◆ rmDuplicates_

bool bpp::SequenceFilterMafIterator::rmDuplicates_
private

Definition at line 69 of file SequenceFilterMafIterator.h.

Referenced by operator=().

◆ species_

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

Definition at line 66 of file SequenceFilterMafIterator.h.

Referenced by operator=().

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

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

◆ strict_

bool bpp::SequenceFilterMafIterator::strict_
private

Definition at line 67 of file SequenceFilterMafIterator.h.

Referenced by operator=().

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

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