bpp-seq 2.0.3

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:

List of all members.

Public Member Functions

 MafSequence ()
 MafSequence (const std::string &name, const std::string &sequence)
 MafSequence (const std::string &name, const std::string &sequence, unsigned int begin, char strand, unsigned int srcSize)
MafSequenceclone () const
 ~MafSequence ()
bool hasCoordinates () const
void removeCoordinates ()
unsigned int start () const throw (Exception)
unsigned int stop () const
Range< unsigned int > getRange () const
void setName (const std::string &name)
 Set the name of this sequence.
const std::string & getSpecies () const
const std::string & getChromosome () const
char getStrand () const
unsigned int getGenomicSize () const
unsigned int getSrcSize () const
void setStart (unsigned int begin)
void setChromosome (const std::string &chr)
void setSpecies (const std::string &species)
void setStrand (char s)
void setSrcSize (unsigned int srcSize)
std::string getDescription () const
MafSequencesubSequence (unsigned int startAt, unsigned int length) const
 Extract a sub-sequence.
virtual void addAnnotation (SequenceAnnotation *anno) throw (Exception)
 Add a new annotation to the sequence.
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) throw (AlphabetMismatchException, Exception)
 Merge a sequence with the current one.
virtual const AlphabetgetAlphabet () const =0
 Get the alphabet associated to the list.
virtual const AlphabetgetAlphabet () const
 Get the alphabet associated to the list.
virtual unsigned int size () const =0
 Get the number of elements in the list.
virtual unsigned int size () const
 Get the number of elements in the list.
virtual const std::vector< int > & getContent () const
 Get the whole content of the list as a vector of int.
virtual std::string toString () const =0
 Convert the list as a string.
virtual std::string toString () const
 Convert the list as a string.
virtual void addElement (const std::string &c) throw (BadCharException)
 Add a character to the end of the list.
virtual void addElement (unsigned int pos, const std::string &c) throw (BadCharException, IndexOutOfBoundsException)
 Add a character at a certain position in the list.
virtual void addElement (int v) throw (BadIntException)
 Add a character to the end of the list.
virtual void addElement (unsigned int pos, int v) throw (BadIntException, IndexOutOfBoundsException)
 Add a character at a certain position in the list.
virtual void setElement (unsigned int pos, const std::string &c) throw (BadCharException, IndexOutOfBoundsException)
 Set the element at position 'pos' to character 'c'.
virtual void setElement (unsigned int pos, int v) throw (BadIntException, IndexOutOfBoundsException)
 Set the element at position 'pos' to character 'v'.
virtual void deleteElement (unsigned int pos) throw (IndexOutOfBoundsException)
 Delete the element at position 'pos'.
virtual void deleteElements (unsigned int pos, unsigned int len) throw (IndexOutOfBoundsException)
 Delete the elements at position 'pos'.
virtual std::string getChar (unsigned int pos) const throw (IndexOutOfBoundsException)
 Get the element at position 'pos' as a character.
virtual int getValue (unsigned int pos) const throw (IndexOutOfBoundsException)
 Get the element at position 'pos' as an int.
virtual const int & operator[] (unsigned int i) const
 Operator [] overloaded for quick access to a character in list.
virtual int & operator[] (unsigned int i)
 Operator [] overloaded for quick access to a character in list.
virtual void shuffle ()
 Randomly shuffle the content of the list, with linear complexity.
Setting/getting the name of the sequence.
const std::string & getName () const
 Get the name of this sequence.
Setting/getting the comments associated to the sequence.
const Comments & getComments () const
 Get the comments associated to this sequence.
void setComments (const Comments &comments)
 Set the comments associated to this sequence.
Adjusting the size of the sequence.
virtual void setContent (const std::string &sequence) throw (BadCharException)
 Set the whole content of the sequence.
void setContent (const std::vector< int > &list) throw (BadIntException)
 Set the whole content of the list.
void setContent (const std::vector< std::string > &list) throw (BadCharException)
 Set the whole content of the list.
virtual void setToSizeR (unsigned int newSize)
 Set up the size of a sequence from the right side.
virtual void setToSizeL (unsigned int newSize)
 Set up the size of a sequence from the left side.
void append (const std::vector< int > &content) throw (BadIntException)
 Append the specified content to the sequence.
void append (const std::vector< std::string > &content) throw (BadCharException)
 Append the specified content to the sequence.
void append (const std::string &content) throw (BadCharException)
 Append the specified content to the sequence.
Acting on the content of the list.
virtual const std::vector< int > & getContent () const =0
 Get the whole content of the list as a vector of int.
Edition methods.
virtual void addElement (const std::string &c)=0 throw (BadCharException)
 Add a character to the end of the list.
virtual void addElement (unsigned int pos, const std::string &c)=0 throw (BadCharException, IndexOutOfBoundsException)
 Add a character at a certain position in the list.
virtual void addElement (int v)=0 throw (BadIntException)
 Add a character to the end of the list.
virtual void addElement (unsigned int pos, int v)=0 throw (BadIntException, IndexOutOfBoundsException)
 Add a character at a certain position in the list.
virtual void setElement (unsigned int pos, const std::string &c)=0 throw (BadCharException, IndexOutOfBoundsException)
 Set the element at position 'pos' to character 'c'.
virtual void setElement (unsigned int pos, int v)=0 throw (BadIntException, IndexOutOfBoundsException)
 Set the element at position 'pos' to character 'v'.
virtual void deleteElement (unsigned int pos)=0 throw (IndexOutOfBoundsException)
 Delete the element at position 'pos'.
virtual void deleteElements (unsigned int pos, unsigned int len)=0 throw (IndexOutOfBoundsException)
 Delete the elements at position 'pos'.
virtual std::string getChar (unsigned int pos) const =0 throw (IndexOutOfBoundsException)
 Get the element at position 'pos' as a character.
virtual int getValue (unsigned int pos) const =0 throw (IndexOutOfBoundsException)
 Get the element at position 'pos' as an int.
Provide direct access to the list content.
Warning:
These operators allow you to modifiy the list content. No alphabet checking is performed for your modifications, so use with care, or consider using the setContent() method.
virtual const int & operator[] (unsigned int i) const =0
 Operator [] overloaded for quick access to a character in list.
virtual int & operator[] (unsigned int i)=0
 Operator [] overloaded for quick access to a character in list.
virtual void shuffle ()=0
 Randomly shuffle the content of the list, with linear complexity.

Protected Member Functions

void propagateEvents (bool yn)
bool propagateEvents () const

Protected Attributes

std::vector< int > content_
 The list content.
std::vector< SymbolListListener * > listeners_
 Contains the listeners.

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_
unsigned int begin_
std::string species_
std::string chromosome_
char strand_
unsigned int size_
unsigned int srcSize_

Events handling

virtual unsigned int getNumberOfListeners () const
virtual const SymbolListListenergetListener (unsigned int i) const
virtual SymbolListListenergetListener (unsigned int i)
virtual void addSymbolListListener (SymbolListListener *listener)
virtual void removeSymbolListListener (SymbolListListener *listener)
void fireBeforeSequenceChanged (const SymbolListEditionEvent &event)
void fireAfterSequenceChanged (const SymbolListEditionEvent &event)
void fireBeforeSequenceInserted (const SymbolListInsertionEvent &event)
void fireAfterSequenceInserted (const SymbolListInsertionEvent &event)
void fireBeforeSequenceDeleted (const SymbolListDeletionEvent &event)
void fireAfterSequenceDeleted (const SymbolListDeletionEvent &event)
void fireBeforeSequenceSubstituted (const SymbolListSubstitutionEvent &event)
void fireAfterSequenceSubstituted (const SymbolListSubstitutionEvent &event)

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 61 of file MafSequence.h.


Constructor & Destructor Documentation

bpp::MafSequence::MafSequence ( ) [inline]

Definition at line 74 of file MafSequence.h.

References size_.

Referenced by clone().

bpp::MafSequence::MafSequence ( const std::string &  name,
const std::string &  sequence 
) [inline]

Definition at line 80 of file MafSequence.h.

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

bpp::MafSequence::MafSequence ( const std::string &  name,
const std::string &  sequence,
unsigned int  begin,
char  strand,
unsigned int  srcSize 
) [inline]

Definition at line 91 of file MafSequence.h.

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

bpp::MafSequence::~MafSequence ( ) [inline]

Definition at line 100 of file MafSequence.h.


Member Function Documentation

virtual void bpp::SequenceWithAnnotation::addAnnotation ( SequenceAnnotation anno) throw (Exception) [inline, virtual, inherited]

Add a new annotation to the sequence.

Parameters:
annoThe annotation object to be added. Unless the annotation is shared, the annotation object will be owned by the sequence object, and will be copied and deleted when needed.
Exceptions:
ExceptionIf the annotation is not valid for this sequence.
See also:
SequenceWithAnnotation::isValidWith

Definition at line 380 of file SequenceWithAnnotation.h.

References bpp::EdSymbolList::addSymbolListListener().

Referenced by bpp::MafAlignmentParser::analyseCurrentBlock_(), bpp::SequenceWithAnnotationTools::createMaskAnnotation(), bpp::SequenceWithQuality::SequenceWithQuality(), and subSequence().

virtual void bpp::SymbolList::addElement ( const std::string &  c) throw (BadCharException) [pure virtual, inherited]

Add a character to the end of the list.

Parameters:
cThe character to add, given as a string.

Implemented in bpp::SequenceWithQuality, bpp::BasicSymbolList, and bpp::EdSymbolList.

Referenced by bpp::SequenceTools::getPutativeHaplotypes(), bpp::AbstractReverseTransliterator::reverse(), and bpp::AbstractTransliterator::translate().

virtual void bpp::SymbolList::addElement ( unsigned int  pos,
const std::string &  c 
) throw (BadCharException, IndexOutOfBoundsException) [pure virtual, inherited]

Add a character at a certain position in the list.

Parameters:
posThe postion where to insert the element.
cThe character to add, given as a string.

Implemented in bpp::SequenceWithQuality, bpp::BasicSymbolList, and bpp::EdSymbolList.

virtual void bpp::SymbolList::addElement ( int  v) throw (BadIntException) [pure virtual, inherited]

Add a character to the end of the list.

Parameters:
vThe character to add, given as an int.

Implemented in bpp::SequenceWithQuality, bpp::BasicSymbolList, and bpp::EdSymbolList.

virtual void bpp::SymbolList::addElement ( unsigned int  pos,
int  v 
) throw (BadIntException, IndexOutOfBoundsException) [pure virtual, inherited]

Add a character at a certain position in the list.

Parameters:
posThe postion where to insert the element.
vThe character to add, given as an int.

Implemented in bpp::SequenceWithQuality, bpp::BasicSymbolList, and bpp::EdSymbolList.

void EdSymbolList::addElement ( const std::string &  c) throw (BadCharException) [virtual, inherited]

Add a character to the end of the list.

Parameters:
cThe character to add, given as a string.

Implements bpp::SymbolList.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 321 of file SymbolList.cpp.

void EdSymbolList::addElement ( unsigned int  pos,
const std::string &  c 
) throw (BadCharException, IndexOutOfBoundsException) [virtual, inherited]

Add a character at a certain position in the list.

Parameters:
posThe postion where to insert the element.
cThe character to add, given as a string.

Implements bpp::SymbolList.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 331 of file SymbolList.cpp.

void EdSymbolList::addElement ( int  v) throw (BadIntException) [virtual, inherited]

Add a character to the end of the list.

Parameters:
vThe character to add, given as an int.

Implements bpp::SymbolList.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 394 of file SymbolList.cpp.

void EdSymbolList::addElement ( unsigned int  pos,
int  v 
) throw (BadIntException, IndexOutOfBoundsException) [virtual, inherited]

Add a character at a certain position in the list.

Parameters:
posThe postion where to insert the element.
vThe character to add, given as an int.

Implements bpp::SymbolList.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 406 of file SymbolList.cpp.

virtual void bpp::EdSymbolList::addSymbolListListener ( SymbolListListener listener) [inline, virtual, inherited]

Definition at line 689 of file SymbolList.h.

References bpp::EdSymbolList::listeners_.

Referenced by bpp::SequenceWithAnnotation::addAnnotation().

void bpp::MafSequence::afterSequenceChanged ( const SymbolListEditionEvent event) [inline, private, virtual]

Reimplemented from bpp::EdSymbolList.

Definition at line 170 of file MafSequence.h.

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

void bpp::MafSequence::afterSequenceDeleted ( const SymbolListDeletionEvent event) [inline, private, virtual]

Reimplemented from bpp::EdSymbolList.

Definition at line 174 of file MafSequence.h.

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

void bpp::MafSequence::afterSequenceInserted ( const SymbolListInsertionEvent event) [inline, private, virtual]

Reimplemented from bpp::EdSymbolList.

Definition at line 172 of file MafSequence.h.

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

void bpp::MafSequence::afterSequenceSubstituted ( const SymbolListSubstitutionEvent event) [inline, private, virtual]

Reimplemented from bpp::EdSymbolList.

Definition at line 176 of file MafSequence.h.

void SequenceWithAnnotation::append ( const std::vector< int > &  content) throw (BadIntException) [virtual, inherited]

Append the specified content to the sequence.

Parameters:
contentThe content to append to the sequence.
Exceptions:
BadIntExceptionIf the content does not match the current alphabet.

Implements bpp::Sequence.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 206 of file SequenceWithAnnotation.cpp.

void SequenceWithAnnotation::append ( const std::vector< std::string > &  content) throw (BadCharException) [virtual, inherited]

Append the specified content to the sequence.

Parameters:
contentThe content to append to the sequence.
Exceptions:
BadCharExceptionIf the content does not match the current alphabet.

Implements bpp::Sequence.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 221 of file SequenceWithAnnotation.cpp.

void SequenceWithAnnotation::append ( const std::string &  content) throw (BadCharException) [virtual, inherited]

Append the specified content to the sequence.

Parameters:
contentThe content to append to the sequence.
Exceptions:
BadCharExceptionIf the content does not match the current alphabet.

Implements bpp::Sequence.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 237 of file SequenceWithAnnotation.cpp.

References bpp::StringSequenceTools::codeSequence().

void bpp::MafSequence::beforeSequenceChanged ( const SymbolListEditionEvent event) [inline, private, virtual]

Reimplemented from bpp::EdSymbolList.

Definition at line 169 of file MafSequence.h.

void bpp::MafSequence::beforeSequenceDeleted ( const SymbolListDeletionEvent event) [inline, private, virtual]

Reimplemented from bpp::EdSymbolList.

Definition at line 173 of file MafSequence.h.

void bpp::MafSequence::beforeSequenceInserted ( const SymbolListInsertionEvent event) [inline, private, virtual]

Reimplemented from bpp::EdSymbolList.

Definition at line 171 of file MafSequence.h.

void bpp::MafSequence::beforeSequenceSubstituted ( const SymbolListSubstitutionEvent event) [inline, private, virtual]

Reimplemented from bpp::EdSymbolList.

Definition at line 175 of file MafSequence.h.

MafSequence* bpp::MafSequence::clone ( ) const [inline, virtual]

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 98 of file MafSequence.h.

References MafSequence().

virtual void bpp::SymbolList::deleteElement ( unsigned int  pos) throw (IndexOutOfBoundsException) [pure virtual, inherited]

Delete the element at position 'pos'.

Parameters:
posThe position of the element to delete.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

Referenced by bpp::SequenceTools::getCDS(), bpp::SequenceTools::removeGaps(), and bpp::VectorSiteContainer::removeSequence().

void EdSymbolList::deleteElement ( unsigned int  pos) throw (IndexOutOfBoundsException) [virtual, inherited]

Delete the element at position 'pos'.

Parameters:
posThe position of the element to delete.

Implements bpp::SymbolList.

Definition at line 369 of file SymbolList.cpp.

virtual void bpp::SymbolList::deleteElements ( unsigned int  pos,
unsigned int  len 
) throw (IndexOutOfBoundsException) [pure virtual, inherited]

Delete the elements at position 'pos'.

Parameters:
posThe position of the first element to delete.
lenThe length of the region to delete.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

void EdSymbolList::deleteElements ( unsigned int  pos,
unsigned int  len 
) throw (IndexOutOfBoundsException) [virtual, inherited]

Delete the elements at position 'pos'.

Parameters:
posThe position of the first element to delete.
lenThe length of the region to delete.

Implements bpp::SymbolList.

Definition at line 381 of file SymbolList.cpp.

void bpp::EdSymbolList::fireAfterSequenceChanged ( const SymbolListEditionEvent event) [inline, protected, inherited]
void bpp::EdSymbolList::fireAfterSequenceDeleted ( const SymbolListDeletionEvent event) [inline, protected, inherited]
void bpp::EdSymbolList::fireAfterSequenceInserted ( const SymbolListInsertionEvent event) [inline, protected, inherited]
void bpp::EdSymbolList::fireAfterSequenceSubstituted ( const SymbolListSubstitutionEvent event) [inline, protected, inherited]
void bpp::EdSymbolList::fireBeforeSequenceChanged ( const SymbolListEditionEvent event) [inline, protected, inherited]
void bpp::EdSymbolList::fireBeforeSequenceDeleted ( const SymbolListDeletionEvent event) [inline, protected, inherited]
void bpp::EdSymbolList::fireBeforeSequenceInserted ( const SymbolListInsertionEvent event) [inline, protected, inherited]
void bpp::EdSymbolList::fireBeforeSequenceSubstituted ( const SymbolListSubstitutionEvent event) [inline, protected, inherited]
virtual const Alphabet* bpp::EdSymbolList::getAlphabet ( ) const [inline, virtual, inherited]
virtual SequenceAnnotation& bpp::SequenceWithAnnotation::getAnnotation ( const std::string &  type) [inline, virtual, inherited]
vector< string > SequenceWithAnnotation::getAnnotationTypes ( ) const [virtual, inherited]
Returns:
The list of annotation types contained in this sequence.

Definition at line 244 of file SequenceWithAnnotation.cpp.

References bpp::EdSymbolList::getListener(), bpp::EdSymbolList::getNumberOfListeners(), and bpp::SequenceAnnotation::getType().

virtual std::string bpp::SymbolList::getChar ( unsigned int  pos) const throw (IndexOutOfBoundsException) [pure virtual, inherited]

Get the element at position 'pos' as a character.

Parameters:
posThe position of the character to retrieve.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

Referenced by bpp::SiteContainerTools::resolveDottedAlignment().

string EdSymbolList::getChar ( unsigned int  pos) const throw (IndexOutOfBoundsException) [virtual, inherited]

Get the element at position 'pos' as a character.

Parameters:
posThe position of the character to retrieve.

Implements bpp::SymbolList.

Definition at line 354 of file SymbolList.cpp.

const Comments& bpp::SequenceWithAnnotation::getComments ( ) const [inline, virtual, inherited]

Get the comments associated to this sequence.

Returns:
The comments of the sequence.

Implements bpp::Sequence.

Definition at line 290 of file SequenceWithAnnotation.h.

References bpp::SequenceWithAnnotation::comments_.

Referenced by bpp::SequenceWithAnnotation::operator=().

virtual const std::vector<int>& bpp::SymbolList::getContent ( ) const [pure virtual, inherited]
virtual const std::vector<int>& bpp::EdSymbolList::getContent ( ) const [inline, virtual, inherited]

Get the whole content of the list as a vector of int.

Returns:
A reference to the content of the list.

Implements bpp::SymbolList.

Definition at line 635 of file SymbolList.h.

References bpp::EdSymbolList::content_.

Referenced by bpp::AlignmentFilter2MafIterator::analyseCurrentBlock_(), bpp::AlignmentFilterMafIterator::analyseCurrentBlock_(), bpp::SequenceWithQualityTools::invert(), and bpp::EdSymbolList::operator=().

std::string bpp::MafSequence::getDescription ( ) const [inline]
unsigned int bpp::MafSequence::getGenomicSize ( ) const [inline]
virtual const SymbolListListener& bpp::EdSymbolList::getListener ( unsigned int  i) const [inline, virtual, inherited]
virtual SymbolListListener& bpp::EdSymbolList::getListener ( unsigned int  i) [inline, virtual, inherited]

Definition at line 684 of file SymbolList.h.

References bpp::EdSymbolList::listeners_.

const std::string& bpp::SequenceWithAnnotation::getName ( ) const [inline, virtual, inherited]
virtual unsigned int bpp::EdSymbolList::getNumberOfListeners ( ) const [inline, virtual, inherited]
Range<unsigned int> bpp::MafSequence::getRange ( ) const [inline]
unsigned int bpp::MafSequence::getSrcSize ( ) const [inline]
char bpp::MafSequence::getStrand ( ) const [inline]
virtual int bpp::SymbolList::getValue ( unsigned int  pos) const throw (IndexOutOfBoundsException) [pure virtual, inherited]

Get the element at position 'pos' as an int.

Parameters:
posThe position of the character to retrieve.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

Referenced by bpp::SequenceTools::findFirstOf(), bpp::SequenceTools::invert(), and bpp::SequenceTools::invertComplement().

int EdSymbolList::getValue ( unsigned int  pos) const throw (IndexOutOfBoundsException) [virtual, inherited]

Get the element at position 'pos' as an int.

Parameters:
posThe position of the character to retrieve.

Implements bpp::SymbolList.

Definition at line 434 of file SymbolList.cpp.

virtual bool bpp::SequenceWithAnnotation::hasAnnotation ( const std::string &  type) const [inline, virtual, inherited]
bool bpp::MafSequence::hasCoordinates ( ) const [inline]
void SequenceWithAnnotation::merge ( const SequenceWithAnnotation swa) throw (AlphabetMismatchException, Exception) [virtual, inherited]

Merge a sequence with the current one.

Sequences must have the same name and alphabets. Only first sequence's commentaries are kept. Annotations that could not be merged will not be added in the concatenated sequence. See the documentation of each annotation class for more details.

Parameters:
swaThe sequence to merge with.
Exceptions:
AlphabetMismatchExceptionIf the two alphabets do not match.
ExceptionIf the sequence names do not match.

Definition at line 257 of file SequenceWithAnnotation.cpp.

References bpp::SequenceAnnotation::clone(), bpp::SequenceAnnotation::init(), and bpp::SequenceAnnotation::merge().

virtual const int& bpp::SymbolList::operator[] ( unsigned int  i) const [pure virtual, inherited]

Operator [] overloaded for quick access to a character in list.

Parameters:
iThe position to retrieve.
Returns:
The integer value of character at position i.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

virtual int& bpp::SymbolList::operator[] ( unsigned int  i) [pure virtual, inherited]

Operator [] overloaded for quick access to a character in list.

Parameters:
iThe position to retrieve.
Returns:
The integer value of character at position i.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

virtual int& bpp::EdSymbolList::operator[] ( unsigned int  i) [inline, virtual, inherited]

Operator [] overloaded for quick access to a character in list.

Parameters:
iThe position to retrieve.
Returns:
The integer value of character at position i.

Implements bpp::SymbolList.

Definition at line 665 of file SymbolList.h.

References bpp::EdSymbolList::content_.

virtual const int& bpp::EdSymbolList::operator[] ( unsigned int  i) const [inline, virtual, inherited]

Operator [] overloaded for quick access to a character in list.

Parameters:
iThe position to retrieve.
Returns:
The integer value of character at position i.

Implements bpp::SymbolList.

Definition at line 663 of file SymbolList.h.

References bpp::EdSymbolList::content_.

bool bpp::EdSymbolList::propagateEvents ( ) const [inline, protected, inherited]

Definition at line 769 of file SymbolList.h.

References bpp::EdSymbolList::propagateEvents_.

void bpp::EdSymbolList::propagateEvents ( bool  yn) [inline, protected, inherited]

Definition at line 768 of file SymbolList.h.

References bpp::EdSymbolList::propagateEvents_.

void bpp::MafSequence::removeCoordinates ( ) [inline]

Definition at line 105 of file MafSequence.h.

References begin_, and hasCoordinates_.

Referenced by subSequence().

virtual void bpp::EdSymbolList::removeSymbolListListener ( SymbolListListener listener) [inline, virtual, inherited]
void bpp::MafSequence::setChromosome ( const std::string &  chr) [inline]

Definition at line 143 of file MafSequence.h.

References chromosome_, setName(), and species_.

void bpp::SequenceWithAnnotation::setComments ( const Comments &  comments) [inline, virtual, inherited]

Set the comments associated to this sequence.

Parameters:
commentsThe new comments of the sequence.

Implements bpp::Sequence.

Definition at line 297 of file SequenceWithAnnotation.h.

References bpp::SequenceWithAnnotation::comments_.

void bpp::SequenceWithAnnotation::setContent ( const std::vector< std::string > &  list) throw (BadCharException) [inline, virtual, inherited]

Set the whole content of the list.

Parameters:
listThe new content of the list.
See also:
The list constructor for information about the way lists are internaly stored.

Implements bpp::Sequence.

Definition at line 319 of file SequenceWithAnnotation.h.

References bpp::SequenceWithAnnotation::setContent().

void bpp::SequenceWithAnnotation::setContent ( const std::vector< int > &  list) throw (BadIntException) [inline, virtual, inherited]

Set the whole content of the list.

Parameters:
listThe new content of the list.
See also:
The list constructor for information about the way lists are internaly stored.

Implements bpp::Sequence.

Definition at line 315 of file SequenceWithAnnotation.h.

References bpp::SequenceWithAnnotation::setContent().

void SequenceWithAnnotation::setContent ( const std::string &  sequence) throw (BadCharException) [virtual, inherited]

Set the whole content of the sequence.

Parameters:
sequenceThe new content of the sequence.
See also:
The Sequence constructor for information about the way sequences are internaly stored.

Implements bpp::Sequence.

Definition at line 143 of file SequenceWithAnnotation.cpp.

References bpp::StringSequenceTools::codeSequence(), and bpp::TextTools::removeWhiteSpaces().

Referenced by bpp::SequenceWithQualityTools::invert(), bpp::SequenceWithQualityTools::removeGaps(), and bpp::SequenceWithAnnotation::setContent().

virtual void bpp::SymbolList::setElement ( unsigned int  pos,
int  v 
) throw (BadIntException, IndexOutOfBoundsException) [pure virtual, inherited]

Set the element at position 'pos' to character 'v'.

Parameters:
posThe position of the character to set.
vThe value of the element, given as an int.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

void EdSymbolList::setElement ( unsigned int  pos,
const std::string &  c 
) throw (BadCharException, IndexOutOfBoundsException) [virtual, inherited]

Set the element at position 'pos' to character 'c'.

Parameters:
posThe position of the character to set.
cThe value of the element, given as a string.

Implements bpp::SymbolList.

Definition at line 342 of file SymbolList.cpp.

void EdSymbolList::setElement ( unsigned int  pos,
int  v 
) throw (BadIntException, IndexOutOfBoundsException) [virtual, inherited]

Set the element at position 'pos' to character 'v'.

Parameters:
posThe position of the character to set.
vThe value of the element, given as an int.

Implements bpp::SymbolList.

Definition at line 420 of file SymbolList.cpp.

virtual void bpp::SymbolList::setElement ( unsigned int  pos,
const std::string &  c 
) throw (BadCharException, IndexOutOfBoundsException) [pure virtual, inherited]

Set the element at position 'pos' to character 'c'.

Parameters:
posThe position of the character to set.
cThe value of the element, given as a string.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

Referenced by bpp::SequenceTools::invert(), and bpp::SequenceTools::invertComplement().

void bpp::MafSequence::setName ( const std::string &  name) [inline, virtual]

Set the name of this sequence.

Parameters:
nameThe new name of the sequence.

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 122 of file MafSequence.h.

References chromosome_, and species_.

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

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

Definition at line 148 of file MafSequence.h.

References chromosome_, setName(), and species_.

void bpp::MafSequence::setSrcSize ( unsigned int  srcSize) [inline]

Definition at line 155 of file MafSequence.h.

References srcSize_.

void bpp::MafSequence::setStart ( unsigned int  begin) [inline]

Definition at line 141 of file MafSequence.h.

References begin_, and hasCoordinates_.

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

Definition at line 153 of file MafSequence.h.

References strand_.

void SequenceWithAnnotation::setToSizeL ( unsigned int  newSize) [virtual, inherited]

Set up the size of a sequence from the left side.

All new characters are filled with gaps. If the specified size is < to the sequence size, the sequence will be truncated.

Parameters:
newSizeThe new size of the sequence.

Implements bpp::Sequence.

Definition at line 180 of file SequenceWithAnnotation.cpp.

References bpp::EdSymbolList::content_, bpp::EdSymbolList::fireAfterSequenceDeleted(), bpp::EdSymbolList::fireAfterSequenceInserted(), bpp::EdSymbolList::fireBeforeSequenceDeleted(), bpp::EdSymbolList::fireBeforeSequenceInserted(), bpp::EdSymbolList::getAlphabet(), and bpp::Alphabet::getGapCharacterCode().

void SequenceWithAnnotation::setToSizeR ( unsigned int  newSize) [virtual, inherited]

Set up the size of a sequence from the right side.

All new characters are filled with gaps. If the specified size is < to the sequence size, the sequence will be truncated.

Parameters:
newSizeThe new size of the sequence.

Implements bpp::Sequence.

Definition at line 155 of file SequenceWithAnnotation.cpp.

References bpp::EdSymbolList::content_, bpp::EdSymbolList::fireAfterSequenceDeleted(), bpp::EdSymbolList::fireAfterSequenceInserted(), bpp::EdSymbolList::fireBeforeSequenceDeleted(), bpp::EdSymbolList::fireBeforeSequenceInserted(), bpp::EdSymbolList::getAlphabet(), and bpp::Alphabet::getGapCharacterCode().

virtual void bpp::EdSymbolList::shuffle ( ) [inline, virtual, inherited]

Randomly shuffle the content of the list, with linear complexity.

Implements bpp::SymbolList.

Definition at line 667 of file SymbolList.h.

References bpp::EdSymbolList::content_.

virtual void bpp::SymbolList::shuffle ( ) [pure virtual, inherited]

Randomly shuffle the content of the list, with linear complexity.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

virtual std::string bpp::SymbolList::toString ( ) const [pure virtual, inherited]

Convert the list as a string.

This method is useful for dumping a list to a file or to the screen for display.

Returns:
The whole list as a string.

Implemented in bpp::BasicSymbolList, and bpp::EdSymbolList.

Referenced by bpp::AbstractSequenceContainer::toString().

string EdSymbolList::toString ( ) const [virtual, inherited]

Convert the list as a string.

This method is useful for dumping a list to a file or to the screen for display.

Returns:
The whole list as a string.

Implements bpp::SymbolList.

Definition at line 314 of file SymbolList.cpp.

References bpp::EdSymbolList::alphabet_, bpp::EdSymbolList::content_, and bpp::StringSequenceTools::decodeSequence().

Referenced by getDescription(), and bpp::OutputMafIterator::writeBlock().


Member Data Documentation

unsigned int bpp::MafSequence::begin_ [private]

Definition at line 66 of file MafSequence.h.

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

std::string bpp::MafSequence::chromosome_ [private]

Definition at line 68 of file MafSequence.h.

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

std::string bpp::MafSequence::species_ [private]

Definition at line 67 of file MafSequence.h.

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

unsigned int bpp::MafSequence::srcSize_ [private]

Definition at line 71 of file MafSequence.h.

Referenced by getSrcSize(), and setSrcSize().

char bpp::MafSequence::strand_ [private]

Definition at line 69 of file MafSequence.h.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends