bpp-seq-omics  2.4.1
bpp::MafSequence Class Referenceabstract

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 (const Alphabet *alphabet=&AlphabetTools::DNA_ALPHABET)
 
 MafSequence (const std::string &name, const std::string &sequence, bool parseName=true, const Alphabet *alphabet=&AlphabetTools::DNA_ALPHABET)
 
 MafSequence (const std::string &name, const std::string &sequence, size_t begin, char strand, size_t srcSize, bool parseName=true, const Alphabet *alphabet=&AlphabetTools::DNA_ALPHABET)
 
MafSequenceclone () const
 
MafSequencecloneMeta () const
 
 ~MafSequence ()
 
bool hasCoordinates () const
 
void removeCoordinates ()
 
size_t start () const
 
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...
 
virtual void addAnnotation (SequenceAnnotation *anno)
 
virtual bool hasAnnotation (const std::string &type) const
 
virtual const SequenceAnnotationgetAnnotation (const std::string &type) const
 
virtual SequenceAnnotationgetAnnotation (const std::string &type)
 
virtual std::vector< std::string > getAnnotationTypes () const
 
virtual void merge (const SequenceWithAnnotation &swa)
 
const CommentsgetComments () const
 
void setComments (const Comments &comments)
 
void clearComments ()
 
const std::string & getName () const
 
virtual const AlphabetgetAlphabet () const=0
 
const AlphabetgetAlphabet () const
 
virtual size_t size () const=0
 
size_t size () const
 
virtual std::string toString () const=0
 
virtual std::string toString () const
 
virtual double getStateValueAt (size_t siteIndex, int state) const
 
virtual double getStateValueAt (size_t siteIndex, int state) const
 
virtual double operator() (size_t siteIndex, int state) const
 
virtual double operator() (size_t siteIndex, int state) const
 
virtual void addElement (const std::string &c)
 
virtual void addElement (size_t pos, const std::string &c)
 
virtual void addElement (const int &v)
 
virtual void addElement (size_t pos, const int &v)
 
virtual void addElement (const T &c)=0
 
virtual void addElement (size_t pos, const T &c)=0
 
virtual void addElement (const T &c)=0
 
virtual void addElement (size_t pos, const T &c)=0
 
virtual void setElement (size_t pos, const std::string &c)
 
virtual void setElement (size_t pos, const int &v)
 
virtual void setElement (size_t pos, const T &c)=0
 
virtual void setElement (size_t pos, const T &c)=0
 
void addIntSymbolListListener (IntSymbolListListener *listener)
 
void deleteElement (size_t pos)
 
virtual void deleteElement (size_t pos)=0
 
virtual void deleteElement (size_t pos)=0
 
void deleteElements (size_t pos, size_t len)
 
virtual void deleteElements (size_t pos, size_t len)=0
 
virtual void deleteElements (size_t pos, size_t len)=0
 
virtual const std::vector< int > & getContent () const
 
virtual const std::vector< T > & getContent () const=0
 
virtual const std::vector< T > & getContent () const=0
 
virtual const int & getElement (size_t pos) const
 
virtual const T & getElement (size_t pos) const=0
 
virtual const T & getElement (size_t pos) const=0
 
virtual const int & getValue (size_t pos) const
 
virtual const T & getValue (size_t pos) const=0
 
virtual const T & getValue (size_t pos) const=0
 
virtual const int & operator[] (size_t pos) const
 
virtual int & operator[] (size_t pos)
 
virtual const T & operator[] (size_t pos) const=0
 
virtual T & operator[] (size_t pos)=0
 
virtual const T & operator[] (size_t pos) const=0
 
virtual T & operator[] (size_t pos)=0
 
virtual void shuffle ()
 
virtual void shuffle ()=0
 
virtual void shuffle ()=0
 
virtual void setContent (const std::string &sequence)
 
void setContent (const std::vector< std::string > &list)
 
void setContent (const std::vector< int > &list)
 
virtual void setContent (const std::vector< T > &list)=0
 
virtual void setContent (const std::string &sequence)
 
void setContent (const std::vector< std::string > &list)
 
void setContent (const std::vector< int > &list)
 
virtual void setContent (const std::vector< T > &list)=0
 
std::string getChar (size_t pos) const
 
std::string getChar (size_t pos) const
 
void setToSizeR (size_t newSize)
 
void setToSizeR (size_t newSize)
 
void setToSizeL (size_t newSize)
 
void setToSizeL (size_t newSize)
 
void append (const Sequence &seq)
 
void append (const std::vector< int > &content)
 
void append (const std::vector< std::string > &content)
 
void append (const std::string &content)
 
void append (const Sequence &seq)
 
void append (const std::vector< int > &content)
 
void append (const std::vector< std::string > &content)
 
void append (const std::string &content)
 
virtual size_t getNumberOfListeners () const
 
virtual const CoreSymbolListListener< int > & getListener (size_t i) const
 
virtual CoreSymbolListListener< int > & getListener (size_t i)
 
virtual void addCoreSymbolListListener (CoreSymbolListListener< int > *listener)
 
virtual void addCoreSymbolListListener (CoreSymbolListListener< T > *listener)=0
 
virtual void removeCoreSymbolListListener (CoreSymbolListListener< int > *listener)
 
virtual void removeCoreSymbolListListener (CoreSymbolListListener< T > *listener)=0
 

Static Public Member Functions

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

Protected Member Functions

virtual void beforeSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
virtual void beforeSequenceChanged (const CoreSymbolListEditionEvent< int > &event)
 
virtual void beforeSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
virtual void afterSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
virtual void afterSequenceChanged (const CoreSymbolListEditionEvent< int > &event)
 
virtual void afterSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
virtual void beforeSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
virtual void beforeSequenceInserted (const CoreSymbolListInsertionEvent< int > &event)
 
virtual void beforeSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
virtual void afterSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
virtual void afterSequenceInserted (const CoreSymbolListInsertionEvent< int > &event)
 
virtual void afterSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
virtual void beforeSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
virtual void beforeSequenceDeleted (const CoreSymbolListDeletionEvent< int > &event)
 
virtual void beforeSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
virtual void afterSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
virtual void afterSequenceDeleted (const CoreSymbolListDeletionEvent< int > &event)
 
virtual void afterSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
virtual void beforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
virtual void beforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< int > &event)
 
virtual void beforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
virtual void afterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
virtual void afterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< int > &event)
 
virtual void afterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
void propagateEvents (bool yn)
 
bool propagateEvents () const
 
void fireBeforeSequenceChanged (const CoreSymbolListEditionEvent< int > &event)
 
virtual void fireBeforeSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
void fireBeforeSequenceChanged (const CoreSymbolListEditionEvent< int > &event)
 
virtual void fireBeforeSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
void fireAfterSequenceChanged (const CoreSymbolListEditionEvent< int > &event)
 
virtual void fireAfterSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
void fireAfterSequenceChanged (const CoreSymbolListEditionEvent< int > &event)
 
virtual void fireAfterSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
void fireBeforeSequenceInserted (const CoreSymbolListInsertionEvent< int > &event)
 
virtual void fireBeforeSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
void fireBeforeSequenceInserted (const CoreSymbolListInsertionEvent< int > &event)
 
virtual void fireBeforeSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
void fireAfterSequenceInserted (const CoreSymbolListInsertionEvent< int > &event)
 
virtual void fireAfterSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
void fireAfterSequenceInserted (const CoreSymbolListInsertionEvent< int > &event)
 
virtual void fireAfterSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
void fireBeforeSequenceDeleted (const CoreSymbolListDeletionEvent< int > &event)
 
virtual void fireBeforeSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
void fireBeforeSequenceDeleted (const CoreSymbolListDeletionEvent< int > &event)
 
virtual void fireBeforeSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
void fireAfterSequenceDeleted (const CoreSymbolListDeletionEvent< int > &event)
 
virtual void fireAfterSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
void fireAfterSequenceDeleted (const CoreSymbolListDeletionEvent< int > &event)
 
virtual void fireAfterSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
void fireBeforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< int > &event)
 
virtual void fireBeforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
void fireBeforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< int > &event)
 
virtual void fireBeforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
void fireAfterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< int > &event)
 
virtual void fireAfterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
void fireAfterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< int > &event)
 
virtual void fireAfterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 

Protected Attributes

Comments comments_
 
std::vector< CoreSymbolListListener< int > * > listeners_
 
std::vector< int > content_
 

Private Member Functions

void beforeSequenceChanged (const IntSymbolListEditionEvent &event)
 
void afterSequenceChanged (const IntSymbolListEditionEvent &event)
 
void beforeSequenceInserted (const IntSymbolListInsertionEvent &event)
 
void afterSequenceInserted (const IntSymbolListInsertionEvent &event)
 
void beforeSequenceDeleted (const IntSymbolListDeletionEvent &event)
 
void afterSequenceDeleted (const IntSymbolListDeletionEvent &event)
 
void beforeSequenceSubstituted (const IntSymbolListSubstitutionEvent &event)
 
void afterSequenceSubstituted (const IntSymbolListSubstitutionEvent &event)
 

Private Attributes

bool hasCoordinates_
 
size_t begin_
 
std::string species_
 
std::string chromosome_
 
char strand_
 
size_t size_
 
size_t srcSize_
 
std::string name_
 
bool propagateEvents_
 
const Alphabetalphabet_
 

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 ( const Alphabet alphabet = &AlphabetTools::DNA_ALPHABET)
inline

Definition at line 75 of file MafSequence.h.

Referenced by clone(), and cloneMeta().

◆ MafSequence() [2/3]

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

◆ 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,
const Alphabet alphabet = &AlphabetTools::DNA_ALPHABET 
)
inline

◆ ~MafSequence()

bpp::MafSequence::~MafSequence ( )
inline

Definition at line 109 of file MafSequence.h.

Member Function Documentation

◆ afterSequenceChanged()

void bpp::MafSequence::afterSequenceChanged ( const IntSymbolListEditionEvent event)
inlineprivatevirtual

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 201 of file MafSequence.h.

References bpp::SequenceTools::getNumberOfSites(), and size_.

◆ afterSequenceDeleted()

void bpp::MafSequence::afterSequenceDeleted ( const IntSymbolListDeletionEvent event)
inlineprivatevirtual

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 205 of file MafSequence.h.

References bpp::SequenceTools::getNumberOfSites(), and size_.

◆ afterSequenceInserted()

void bpp::MafSequence::afterSequenceInserted ( const IntSymbolListInsertionEvent event)
inlineprivatevirtual

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 203 of file MafSequence.h.

References bpp::SequenceTools::getNumberOfSites(), and size_.

◆ afterSequenceSubstituted()

void bpp::MafSequence::afterSequenceSubstituted ( const IntSymbolListSubstitutionEvent event)
inlineprivatevirtual

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 207 of file MafSequence.h.

◆ beforeSequenceChanged()

void bpp::MafSequence::beforeSequenceChanged ( const IntSymbolListEditionEvent event)
inlineprivatevirtual

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 200 of file MafSequence.h.

◆ beforeSequenceDeleted()

void bpp::MafSequence::beforeSequenceDeleted ( const IntSymbolListDeletionEvent event)
inlineprivatevirtual

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 204 of file MafSequence.h.

◆ beforeSequenceInserted()

void bpp::MafSequence::beforeSequenceInserted ( const IntSymbolListInsertionEvent event)
inlineprivatevirtual

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 202 of file MafSequence.h.

◆ beforeSequenceSubstituted()

void bpp::MafSequence::beforeSequenceSubstituted ( const IntSymbolListSubstitutionEvent event)
inlineprivatevirtual

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 206 of file MafSequence.h.

◆ clone()

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

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 101 of file MafSequence.h.

References MafSequence().

◆ cloneMeta()

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

◆ getChromosome()

◆ getDescription()

◆ getGenomicSize()

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

Definition at line 168 of file MafSequence.h.

References size_.

Referenced by bpp::OutputMafIterator::writeBlock().

◆ getRange()

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

Definition at line 131 of file MafSequence.h.

References bpp::SequenceWithAnnotation::getName(), hasCoordinates_, srcSize_, start(), stop(), and strand_.

Referenced by bpp::CoordinateTranslatorMafIterator::analyseCurrentBlock_(), bpp::FeatureExtractorMafIterator::analyseCurrentBlock_(), and bpp::FeatureFilterMafIterator::analyseCurrentBlock_().

◆ getSpecies()

◆ getSrcSize()

◆ getStrand()

◆ hasCoordinates()

◆ removeCoordinates()

void bpp::MafSequence::removeCoordinates ( )
inline

Definition at line 114 of file MafSequence.h.

References begin_, and hasCoordinates_.

Referenced by subSequence().

◆ setChromosome()

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

Definition at line 174 of file MafSequence.h.

References chromosome_, bpp::SequenceWithAnnotation::setName(), and species_.

◆ setName()

void bpp::MafSequence::setName ( const std::string &  name)
inlinevirtual

◆ setSpecies()

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

Definition at line 179 of file MafSequence.h.

References chromosome_, bpp::SequenceWithAnnotation::setName(), and species_.

◆ setSrcSize()

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

Definition at line 186 of file MafSequence.h.

References srcSize_.

◆ setStart()

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

Definition at line 172 of file MafSequence.h.

References begin_, and hasCoordinates_.

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

◆ setStrand()

void bpp::MafSequence::setStrand ( char  s)
inline

Definition at line 184 of file MafSequence.h.

References strand_.

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

◆ splitNameIntoSpeciesAndChromosome()

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

Definition at line 152 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 cloneMeta(), 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 cloneMeta(), getRange(), getSrcSize(), and setSrcSize().

◆ strand_

char bpp::MafSequence::strand_
private

Definition at line 70 of file MafSequence.h.

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


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