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

Translate features coordinates from one species to another, based on the alignment. More...

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

+ Inheritance diagram for bpp::CoordinateTranslatorMafIterator:
+ Collaboration diagram for bpp::CoordinateTranslatorMafIterator:

Public Member Functions

 CoordinateTranslatorMafIterator (MafIterator *iterator, const std::string &referenceSpecies, const std::string &targetSpecies, const SequenceFeatureSet &features, std::ostream &output, bool outputClosestCoordinate=true)
 Build a new CoordinateTranslator iterator. More...
 
virtual ~CoordinateTranslatorMafIterator ()
 
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::string referenceSpecies_
 
std::string targetSpecies_
 
std::map< std::string, SequenceFeatureSet * > inputFeaturesPerChr_
 
std::ostream & output_
 
bool outputClosestCoordinate_
 

Detailed Description

Translate features coordinates from one species to another, based on the alignment.

This filter is similar in principle to the UCSC "liftOver" utility and software alike. For now, only write a text file with all coordinates from reference and corresponding target sequence.

Definition at line 61 of file CoordinateTranslatorMafIterator.h.

Constructor & Destructor Documentation

◆ CoordinateTranslatorMafIterator()

bpp::CoordinateTranslatorMafIterator::CoordinateTranslatorMafIterator ( MafIterator iterator,
const std::string &  referenceSpecies,
const std::string &  targetSpecies,
const SequenceFeatureSet features,
std::ostream &  output,
bool  outputClosestCoordinate = true 
)
inline

Build a new CoordinateTranslator iterator.

Parameters
iteratorThe input iterator
referenceSpeciesThe reference species for feature coordinates
targetSpeciesThe target species for which features coordinates should be translated
featuresThe set of features to lift over
outputOutput stream for translated coordinates
outputClosestCoordinateIn case the target sequence has a gap at the corresponding position, tells if the previous non-gap position should be returned, or NA.

Definition at line 83 of file CoordinateTranslatorMafIterator.h.

References bpp::SequenceFeatureSet::getSequences(), bpp::SequenceFeatureSet::getSubsetForSequence(), inputFeaturesPerChr_, and output_.

◆ ~CoordinateTranslatorMafIterator()

virtual bpp::CoordinateTranslatorMafIterator::~CoordinateTranslatorMafIterator ( )
inlinevirtual

Definition at line 109 of file CoordinateTranslatorMafIterator.h.

References inputFeaturesPerChr_.

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

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

◆ inputFeaturesPerChr_

std::map<std::string, SequenceFeatureSet*> bpp::CoordinateTranslatorMafIterator::inputFeaturesPerChr_
private

◆ iterationListeners_

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

Definition at line 89 of file MafIterator.h.

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

◆ iterator_

◆ logstream_

◆ output_

std::ostream& bpp::CoordinateTranslatorMafIterator::output_
private

Definition at line 68 of file CoordinateTranslatorMafIterator.h.

Referenced by CoordinateTranslatorMafIterator().

◆ outputClosestCoordinate_

bool bpp::CoordinateTranslatorMafIterator::outputClosestCoordinate_
private

Definition at line 69 of file CoordinateTranslatorMafIterator.h.

◆ referenceSpecies_

std::string bpp::CoordinateTranslatorMafIterator::referenceSpecies_
private

Definition at line 65 of file CoordinateTranslatorMafIterator.h.

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

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

◆ targetSpecies_

std::string bpp::CoordinateTranslatorMafIterator::targetSpecies_
private

Definition at line 66 of file CoordinateTranslatorMafIterator.h.

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

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