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

A sequence class which is used to store data from MAF files. More...

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

+ Inheritance diagram for bpp::MafSequence:
+ Collaboration diagram for bpp::MafSequence:

Public Member Functions

 MafSequence ()
 
 MafSequence (const std::string &name, const std::string &sequence, bool parseName=true)
 
 MafSequence (const std::string &name, const std::string &sequence, size_t begin, char strand, size_t srcSize, bool parseName=true)
 
MafSequenceclone () const
 
 ~MafSequence ()
 
bool hasCoordinates () const
 
void removeCoordinates ()
 
size_t start () const throw (Exception)
 
size_t stop () const
 
Range< size_t > getRange (bool origin=true) const
 
void setName (const std::string &name)
 
const std::string & getSpecies () const
 
const std::string & getChromosome () const
 
char getStrand () const
 
size_t getGenomicSize () const
 
size_t getSrcSize () const
 
void setStart (size_t begin)
 
void setChromosome (const std::string &chr)
 
void setSpecies (const std::string &species)
 
void setStrand (char s)
 
void setSrcSize (size_t srcSize)
 
std::string getDescription () const
 
MafSequencesubSequence (size_t startAt, size_t length) const
 Extract a sub-sequence. More...
 

Static Public Member Functions

static void splitNameIntoSpeciesAndChromosome (const std::string &name, std::string &species, std::string &chr)
 

Private Member Functions

void beforeSequenceChanged (const SymbolListEditionEvent &event)
 
void afterSequenceChanged (const SymbolListEditionEvent &event)
 
void beforeSequenceInserted (const SymbolListInsertionEvent &event)
 
void afterSequenceInserted (const SymbolListInsertionEvent &event)
 
void beforeSequenceDeleted (const SymbolListDeletionEvent &event)
 
void afterSequenceDeleted (const SymbolListDeletionEvent &event)
 
void beforeSequenceSubstituted (const SymbolListSubstitutionEvent &event)
 
void afterSequenceSubstituted (const SymbolListSubstitutionEvent &event)
 

Private Attributes

bool hasCoordinates_
 
size_t begin_
 
std::string species_
 
std::string chromosome_
 
char strand_
 
size_t size_
 
size_t srcSize_
 

Detailed Description

A sequence class which is used to store data from MAF files.

It extends the SequenceWithAnnotation class to store MAF-specific features, like the chromosome position. The sequence is its own listener, and recomputes its "genomic" site by using the SequenceTools::getNumberOfSites function when a content modification is performed. Tags like begin and stop, hovever, have to be set by hand.

A MAF sequence is necessarily a DNA sequence.

Definition at line 62 of file MafSequence.h.

Constructor & Destructor Documentation

◆ MafSequence() [1/3]

bpp::MafSequence::MafSequence ( )
inline

Definition at line 75 of file MafSequence.h.

References size_.

Referenced by clone().

◆ MafSequence() [2/3]

bpp::MafSequence::MafSequence ( const std::string &  name,
const std::string &  sequence,
bool  parseName = true 
)
inline

Definition at line 81 of file MafSequence.h.

References chromosome_, size_, species_, and splitNameIntoSpeciesAndChromosome().

◆ MafSequence() [3/3]

bpp::MafSequence::MafSequence ( const std::string &  name,
const std::string &  sequence,
size_t  begin,
char  strand,
size_t  srcSize,
bool  parseName = true 
)
inline

Definition at line 89 of file MafSequence.h.

References chromosome_, size_, species_, and splitNameIntoSpeciesAndChromosome().

◆ ~MafSequence()

bpp::MafSequence::~MafSequence ( )
inline

Definition at line 99 of file MafSequence.h.

Member Function Documentation

◆ afterSequenceChanged()

void bpp::MafSequence::afterSequenceChanged ( const SymbolListEditionEvent &  event)
inlineprivate

Definition at line 191 of file MafSequence.h.

References size_.

◆ afterSequenceDeleted()

void bpp::MafSequence::afterSequenceDeleted ( const SymbolListDeletionEvent &  event)
inlineprivate

Definition at line 195 of file MafSequence.h.

References size_.

◆ afterSequenceInserted()

void bpp::MafSequence::afterSequenceInserted ( const SymbolListInsertionEvent &  event)
inlineprivate

Definition at line 193 of file MafSequence.h.

References size_.

◆ afterSequenceSubstituted()

void bpp::MafSequence::afterSequenceSubstituted ( const SymbolListSubstitutionEvent &  event)
inlineprivate

Definition at line 197 of file MafSequence.h.

◆ beforeSequenceChanged()

void bpp::MafSequence::beforeSequenceChanged ( const SymbolListEditionEvent &  event)
inlineprivate

Definition at line 190 of file MafSequence.h.

◆ beforeSequenceDeleted()

void bpp::MafSequence::beforeSequenceDeleted ( const SymbolListDeletionEvent &  event)
inlineprivate

Definition at line 194 of file MafSequence.h.

◆ beforeSequenceInserted()

void bpp::MafSequence::beforeSequenceInserted ( const SymbolListInsertionEvent &  event)
inlineprivate

Definition at line 192 of file MafSequence.h.

◆ beforeSequenceSubstituted()

void bpp::MafSequence::beforeSequenceSubstituted ( const SymbolListSubstitutionEvent &  event)
inlineprivate

Definition at line 196 of file MafSequence.h.

◆ clone()

MafSequence* bpp::MafSequence::clone ( ) const
inline

Definition at line 97 of file MafSequence.h.

References MafSequence().

◆ getChromosome()

◆ getDescription()

std::string bpp::MafSequence::getDescription ( ) const
inline

◆ getGenomicSize()

size_t bpp::MafSequence::getGenomicSize ( ) const
inline

Definition at line 158 of file MafSequence.h.

References size_.

Referenced by bpp::MafParser::analyseCurrentBlock_(), and bpp::OutputMafIterator::writeBlock().

◆ getRange()

Range<size_t> bpp::MafSequence::getRange ( bool  origin = true) const
inline
Returns
A range with cooridinates from this sequence.
Parameters
originTell if coorinates according to original sequence should be used. If 'yes' and the sequence is on the negative strand, the returned rang will be computed as [SrcSize-Stop, SrcSize-Start[

Definition at line 121 of file MafSequence.h.

References hasCoordinates_, srcSize_, start(), stop(), and strand_.

Referenced by bpp::FeatureFilterMafIterator::analyseCurrentBlock_(), and bpp::FeatureExtractor::analyseCurrentBlock_().

◆ getSpecies()

◆ getSrcSize()

◆ getStrand()

◆ hasCoordinates()

◆ removeCoordinates()

void bpp::MafSequence::removeCoordinates ( )
inline

◆ setChromosome()

void bpp::MafSequence::setChromosome ( const std::string &  chr)
inline

◆ setName()

◆ setSpecies()

void bpp::MafSequence::setSpecies ( const std::string &  species)
inline

Definition at line 169 of file MafSequence.h.

References chromosome_, and species_.

◆ setSrcSize()

void bpp::MafSequence::setSrcSize ( size_t  srcSize)
inline

Definition at line 176 of file MafSequence.h.

References srcSize_.

◆ setStart()

void bpp::MafSequence::setStart ( size_t  begin)
inline

Definition at line 162 of file MafSequence.h.

References begin_, and hasCoordinates_.

Referenced by bpp::SequenceStreamToMafIterator::analyseCurrentBlock_().

◆ setStrand()

◆ splitNameIntoSpeciesAndChromosome()

static void bpp::MafSequence::splitNameIntoSpeciesAndChromosome ( const std::string &  name,
std::string &  species,
std::string &  chr 
)
inlinestatic

Definition at line 142 of file MafSequence.h.

Referenced by MafSequence(), and setName().

◆ start()

◆ stop()

◆ subSequence()

Member Data Documentation

◆ begin_

size_t bpp::MafSequence::begin_
private

Definition at line 67 of file MafSequence.h.

Referenced by removeCoordinates(), setStart(), start(), and stop().

◆ chromosome_

std::string bpp::MafSequence::chromosome_
private

Definition at line 69 of file MafSequence.h.

Referenced by getChromosome(), MafSequence(), setChromosome(), setName(), and setSpecies().

◆ hasCoordinates_

bool bpp::MafSequence::hasCoordinates_
private

◆ size_

size_t bpp::MafSequence::size_
private

◆ species_

std::string bpp::MafSequence::species_
private

Definition at line 68 of file MafSequence.h.

Referenced by getSpecies(), MafSequence(), setChromosome(), setName(), and setSpecies().

◆ srcSize_

size_t bpp::MafSequence::srcSize_
private

Definition at line 72 of file MafSequence.h.

Referenced by getRange(), getSrcSize(), and setSrcSize().

◆ strand_

char bpp::MafSequence::strand_
private

Definition at line 70 of file MafSequence.h.

Referenced by getDescription(), getRange(), getStrand(), and setStrand().


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