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

MAF file parser. More...

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

+ Inheritance diagram for bpp::MafParser:
+ Collaboration diagram for bpp::MafParser:

Public Member Functions

 MafParser (std::istream *stream, bool parseMask=false, bool checkSize=true, short dotOption=DOT_ERROR)
 Create a new instance of MafParser. More...
 
void addIterationListener (IterationListener *listener)
 
MafBlocknextBlock ()
 Get the next available alignment block. More...
 
bool isVerbose () const
 
void setVerbose (bool yn)
 

Static Public Attributes

static constexpr short DOT_ERROR = 0
 
static constexpr short DOT_ASGAP = 1
 
static constexpr short DOT_ASUNRES = 2
 

Protected Member Functions

virtual void fireIterationStartSignal_ ()
 
virtual void fireIterationMoveSignal_ (const MafBlock &currentBlock)
 
virtual void fireIterationStopSignal_ ()
 

Protected Attributes

std::vector< IterationListener * > iterationListeners_
 
bool started_
 
bool verbose_
 

Private Member Functions

 MafParser (const MafParser &maf)
 
MafParseroperator= (const MafParser &maf)
 
MafBlockanalyseCurrentBlock_ ()
 

Private Attributes

std::istream * stream_
 
bool mask_
 
bool checkSequenceSize_
 
CaseMaskedAlphabet cmAlphabet_
 
bool firstBlock_
 
short dotOption_
 

Detailed Description

MAF file parser.

This class parses synteny blocks from Maf file.

The MAF format is documented on the UCSC Genome Browser website: http://genome.ucsc.edu/FAQ/FAQformat.html#format5

Author
Julien Dutheil

Definition at line 61 of file MafParser.h.

Constructor & Destructor Documentation

◆ MafParser() [1/2]

bpp::MafParser::MafParser ( std::istream *  stream,
bool  parseMask = false,
bool  checkSize = true,
short  dotOption = DOT_ERROR 
)
inline

Create a new instance of MafParser.

Parameters
streamThe input stream to read text from
parseMaskTell is masking (lower case) should be kept
checkSizeTell if the size of sequence found should be compared to the specified one. An exception is thrown in case of mismatch (default). If set to no, a warning will be displayed if verbose is set to true.
dotOption(one of DOT_ERROR, DOT_ASGAP or DOT_ASUNRES) tells how dot should be treated. DOT_ERROR, the default, will return an exception. DOT_ASGAP will convert all dots to gaps and DOT_ASUNRES will convert them to 'N', which will increase parsing time.

Definition at line 88 of file MafParser.h.

◆ MafParser() [2/2]

bpp::MafParser::MafParser ( const MafParser maf)
inlineprivate

Definition at line 94 of file MafParser.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_.

◆ operator=()

MafParser& bpp::MafParser::operator= ( const MafParser maf)
inlineprivate

Definition at line 99 of file MafParser.h.

References checkSequenceSize_, dotOption_, firstBlock_, mask_, and stream_.

◆ 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

◆ checkSequenceSize_

bool bpp::MafParser::checkSequenceSize_
private

Definition at line 67 of file MafParser.h.

Referenced by operator=().

◆ cmAlphabet_

CaseMaskedAlphabet bpp::MafParser::cmAlphabet_
private

Definition at line 68 of file MafParser.h.

◆ DOT_ASGAP

constexpr short bpp::MafParser::DOT_ASGAP = 1
staticconstexpr

Definition at line 113 of file MafParser.h.

◆ DOT_ASUNRES

constexpr short bpp::MafParser::DOT_ASUNRES = 2
staticconstexpr

Definition at line 114 of file MafParser.h.

◆ DOT_ERROR

constexpr short bpp::MafParser::DOT_ERROR = 0
staticconstexpr

Definition at line 112 of file MafParser.h.

◆ dotOption_

short bpp::MafParser::dotOption_
private

Definition at line 70 of file MafParser.h.

Referenced by operator=().

◆ firstBlock_

bool bpp::MafParser::firstBlock_
private

Definition at line 69 of file MafParser.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().

◆ mask_

bool bpp::MafParser::mask_
private

Definition at line 66 of file MafParser.h.

Referenced by operator=().

◆ started_

bool bpp::AbstractMafIterator::started_
protectedinherited

Definition at line 90 of file MafIterator.h.

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

◆ stream_

std::istream* bpp::MafParser::stream_
private

Definition at line 65 of file MafParser.h.

Referenced by operator=().

◆ verbose_

bool bpp::AbstractMafIterator::verbose_
protectedinherited

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