bpp::MafSequence Class Reference

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

#include <Bpp/Seq/Io/MafIterator.h>

Inheritance diagram for bpp::MafSequence:
Inheritance graph
[legend]
Collaboration diagram for bpp::MafSequence:
Collaboration graph
[legend]

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 67 of file MafIterator.h.


Constructor & Destructor Documentation

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

Definition at line 80 of file MafIterator.h.

References size_.

Referenced by clone(), and subSequence().

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

Definition at line 86 of file MafIterator.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 97 of file MafIterator.h.

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

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

Definition at line 106 of file MafIterator.h.


Member Function Documentation

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

Add a new annotation to the sequence.

Parameters:
anno The 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:
Exception If 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::SequenceWithAnnotationTools::createMaskAnnotation(), bpp::MafAlignmentParser::nextBlock(), bpp::SequenceWithQuality::SequenceWithQuality(), and subSequence().

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

Add a character at a certain position in the list.

Parameters:
pos The postion where to insert the element.
v The character to add, given as an int.

Implements bpp::SymbolList.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 406 of file SymbolList.cpp.

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

Add a character to the end of the list.

Parameters:
v The 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,
const std::string &  c 
) throw (BadCharException, IndexOutOfBoundsException) [virtual, inherited]

Add a character at a certain position in the list.

Parameters:
pos The postion where to insert the element.
c The 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 ( const std::string &  c  )  throw (BadCharException) [virtual, inherited]

Add a character to the end of the list.

Parameters:
c The character to add, given as a string.

Implements bpp::SymbolList.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 321 of file SymbolList.cpp.

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:
pos The postion where to insert the element.
v The character to add, given as an int.

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:
v The character to add, given as an int.

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

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:
pos The postion where to insert the element.
c The character to add, given as a string.

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

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

Add a character to the end of the list.

Parameters:
c The 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::EdSymbolList::addSymbolListListener ( SymbolListListener listener  )  [inline, virtual, inherited]

Definition at line 657 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 176 of file MafIterator.h.

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

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

Reimplemented from bpp::EdSymbolList.

Definition at line 180 of file MafIterator.h.

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

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

Reimplemented from bpp::EdSymbolList.

Definition at line 178 of file MafIterator.h.

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

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

Reimplemented from bpp::EdSymbolList.

Definition at line 182 of file MafIterator.h.

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

Append the specified content to the sequence.

Parameters:
content The content to append to the sequence.
Exceptions:
BadCharException If 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 SequenceWithAnnotation::append ( const std::vector< std::string > &  content  )  throw (BadCharException) [virtual, inherited]

Append the specified content to the sequence.

Parameters:
content The content to append to the sequence.
Exceptions:
BadCharException If 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::vector< int > &  content  )  throw (BadIntException) [virtual, inherited]

Append the specified content to the sequence.

Parameters:
content The content to append to the sequence.
Exceptions:
BadIntException If the content does not match the current alphabet.

Implements bpp::Sequence.

Reimplemented in bpp::SequenceWithQuality.

Definition at line 206 of file SequenceWithAnnotation.cpp.

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

Reimplemented from bpp::EdSymbolList.

Definition at line 175 of file MafIterator.h.

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

Reimplemented from bpp::EdSymbolList.

Definition at line 179 of file MafIterator.h.

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

Reimplemented from bpp::EdSymbolList.

Definition at line 177 of file MafIterator.h.

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

Reimplemented from bpp::EdSymbolList.

Definition at line 181 of file MafIterator.h.

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

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 104 of file MafIterator.h.

References MafSequence().

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

Delete the element at position 'pos'.

Parameters:
pos The position of the element to delete.

Implements bpp::SymbolList.

Definition at line 369 of file SymbolList.cpp.

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

Delete the element at position 'pos'.

Parameters:
pos The position of the element to delete.

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

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

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

Delete the elements at position 'pos'.

Parameters:
pos The position of the first element to delete.
len The length of the region to delete.

Implements bpp::SymbolList.

Definition at line 381 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:
pos The position of the first element to delete.
len The length of the region to delete.

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

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 const Alphabet* bpp::SymbolList::getAlphabet (  )  const [pure virtual, inherited]
virtual SequenceAnnotation& bpp::SequenceWithAnnotation::getAnnotation ( const std::string &  type  )  [inline, virtual, inherited]
virtual const SequenceAnnotation& bpp::SequenceWithAnnotation::getAnnotation ( const std::string &  type  )  const [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().

Referenced by subSequence().

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

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

Parameters:
pos The position of the character to retrieve.

Implements bpp::SymbolList.

Definition at line 354 of file SymbolList.cpp.

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:
pos The position of the character to retrieve.

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

Referenced by bpp::AbstractSequencePositionIterator::getChar(), and bpp::SiteContainerTools::resolveDottedAlignment().

const std::string& bpp::MafSequence::getChromosome (  )  const [inline]
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::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 603 of file SymbolList.h.

References bpp::EdSymbolList::content_.

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

virtual const std::vector<int>& bpp::SymbolList::getContent (  )  const [pure virtual, inherited]
std::string bpp::MafSequence::getDescription (  )  const [inline]
unsigned int bpp::MafSequence::getGenomicSize (  )  const [inline]

Definition at line 143 of file MafIterator.h.

References size_.

Referenced by bpp::MafAlignmentParser::nextBlock(), and bpp::OutputMafIterator::writeBlock().

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

Definition at line 652 of file SymbolList.h.

References bpp::EdSymbolList::listeners_.

virtual const SymbolListListener& bpp::EdSymbolList::getListener ( unsigned int  i  )  const [inline, virtual, inherited]
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]
const std::string& bpp::MafSequence::getSpecies (  )  const [inline]
unsigned int bpp::MafSequence::getSrcSize (  )  const [inline]

Definition at line 145 of file MafIterator.h.

References srcSize_.

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

char bpp::MafSequence::getStrand (  )  const [inline]
int EdSymbolList::getValue ( unsigned int  pos  )  const throw (IndexOutOfBoundsException) [virtual, inherited]

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

Parameters:
pos The position of the character to retrieve.

Implements bpp::SymbolList.

Definition at line 434 of file SymbolList.cpp.

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

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

Parameters:
pos The position of the character to retrieve.

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

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

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:
swa The sequence to merge with.
Exceptions:
AlphabetMismatchException If the two alphabets do not match.
Exception If the sequence names do not match.

Definition at line 257 of file SequenceWithAnnotation.cpp.

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

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

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

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

Implements bpp::SymbolList.

Definition at line 633 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:
i The position to retrieve.
Returns:
The integer value of character at position i.

Implements bpp::SymbolList.

Definition at line 631 of file SymbolList.h.

References bpp::EdSymbolList::content_.

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

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

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

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

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

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

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

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

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

Definition at line 737 of file SymbolList.h.

References bpp::EdSymbolList::propagateEvents_.

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

Definition at line 736 of file SymbolList.h.

References bpp::EdSymbolList::propagateEvents_.

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

Definition at line 111 of file MafIterator.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 149 of file MafIterator.h.

References chromosome_, setName(), and species_.

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

Set the comments associated to this sequence.

Parameters:
comments The 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:
list The 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:
list The 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:
sequence The 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().

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

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

Parameters:
pos The position of the character to set.
v The value of the element, given as an int.

Implements bpp::SymbolList.

Definition at line 420 of file SymbolList.cpp.

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:
pos The position of the character to set.
c The value of the element, given as a string.

Implements bpp::SymbolList.

Definition at line 342 of file SymbolList.cpp.

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:
pos The position of the character to set.
v The value of the element, given as an int.

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

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:
pos The position of the character to set.
c The 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:
name The new name of the sequence.

Reimplemented from bpp::SequenceWithAnnotation.

Definition at line 128 of file MafIterator.h.

References chromosome_, and species_.

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

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

Definition at line 154 of file MafIterator.h.

References chromosome_, setName(), and species_.

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

Definition at line 161 of file MafIterator.h.

References srcSize_.

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

Definition at line 147 of file MafIterator.h.

References begin_, and hasCoordinates_.

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

Definition at line 159 of file MafIterator.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:
newSize The 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:
newSize The 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 635 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 unsigned int bpp::EdSymbolList::size (  )  const [inline, virtual, inherited]
virtual unsigned int bpp::SymbolList::size (  )  const [pure virtual, inherited]
unsigned int bpp::MafSequence::start (  )  const throw (Exception) [inline]
unsigned int bpp::MafSequence::stop (  )  const [inline]
MafSequence * MafSequence::subSequence ( unsigned int  startAt,
unsigned int  length 
) const
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(), subSequence(), and bpp::OutputMafIterator::writeBlock().

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().


Member Data Documentation

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

Definition at line 72 of file MafIterator.h.

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

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

Definition at line 74 of file MafIterator.h.

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

std::vector<int> bpp::EdSymbolList::content_ [protected, inherited]
std::vector<SymbolListListener*> bpp::EdSymbolList::listeners_ [protected, inherited]
unsigned int bpp::MafSequence::size_ [private]
std::string bpp::MafSequence::species_ [private]

Definition at line 73 of file MafIterator.h.

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

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

Definition at line 77 of file MafIterator.h.

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

char bpp::MafSequence::strand_ [private]

Definition at line 75 of file MafIterator.h.

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


The documentation for this class was generated from the following files:
Generated on Wed Feb 29 14:50:37 2012 for bpp-seq by  doxygen 1.6.3