bpp-seq
2.2.0
|
The SymbolList interface. More...
#include <Bpp/Seq/SymbolList.h>
Public Member Functions | |
virtual | ~SymbolList () |
virtual const Alphabet * | getAlphabet () const =0 |
Get the alphabet associated to the list. More... | |
virtual size_t | size () const =0 |
Get the number of elements in the list. More... | |
virtual std::string | toString () const =0 |
Convert the list as a string. More... | |
The Clonable interface | |
SymbolList * | clone () const =0 |
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. More... | |
virtual void | setContent (const std::vector< int > &list)=0 throw (BadIntException) |
Set the whole content of the list. More... | |
virtual void | setContent (const std::vector< std::string > &list)=0 throw (BadCharException) |
Set the whole content of the list. More... | |
Edition methods. | |
virtual void | addElement (const std::string &c)=0 throw (BadCharException) |
Add a character to the end of the list. More... | |
virtual void | addElement (size_t pos, const std::string &c)=0 throw (BadCharException, IndexOutOfBoundsException) |
Add a character at a certain position in the list. More... | |
virtual void | setElement (size_t pos, const std::string &c)=0 throw (BadCharException, IndexOutOfBoundsException) |
Set the element at position 'pos' to character 'c'. More... | |
virtual void | deleteElement (size_t pos)=0 throw (IndexOutOfBoundsException) |
Delete the element at position 'pos'. More... | |
virtual void | deleteElements (size_t pos, size_t len)=0 throw (IndexOutOfBoundsException) |
Delete the elements at position 'pos'. More... | |
virtual std::string | getChar (size_t pos) const =0 throw (IndexOutOfBoundsException) |
Get the element at position 'pos' as a character. More... | |
virtual void | addElement (int v)=0 throw (BadIntException) |
Add a character to the end of the list. More... | |
virtual void | addElement (size_t pos, int v)=0 throw (BadIntException, IndexOutOfBoundsException) |
Add a character at a certain position in the list. More... | |
virtual void | setElement (size_t pos, int v)=0 throw (BadIntException, IndexOutOfBoundsException) |
Set the element at position 'pos' to character 'v'. More... | |
virtual int | getValue (size_t pos) const =0 throw (IndexOutOfBoundsException) |
Get the element at position 'pos' as an int. More... | |
Provide direct access to the list content. | |
| |
virtual const int & | operator[] (size_t i) const =0 |
Operator [] overloaded for quick access to a character in list. More... | |
virtual int & | operator[] (size_t i)=0 |
Operator [] overloaded for quick access to a character in list. More... | |
virtual void | shuffle ()=0 |
Randomly shuffle the content of the list, with linear complexity. More... | |
|
inlinevirtual |
Definition at line 76 of file SymbolList.h.
|
pure virtual |
Add a character to the end of the list.
c | The character to add, given as a string. |
Implemented in bpp::SequenceWithQuality, bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::SequenceTools::getPutativeHaplotypes(), bpp::AbstractReverseTransliterator::reverse(), and bpp::AbstractTransliterator::translate().
|
pure virtual |
Add a character at a certain position in the list.
pos | The postion where to insert the element. |
c | The character to add, given as a string. |
Implemented in bpp::SequenceWithQuality, bpp::EdSymbolList, and bpp::BasicSymbolList.
|
pure virtual |
Add a character to the end of the list.
v | The character to add, given as an int. |
Implemented in bpp::SequenceWithQuality, bpp::EdSymbolList, and bpp::BasicSymbolList.
|
pure virtual |
Add a character at a certain position in the list.
pos | The postion where to insert the element. |
v | The character to add, given as an int. |
Implemented in bpp::SequenceWithQuality, bpp::EdSymbolList, and bpp::BasicSymbolList.
|
pure virtual |
Implemented in bpp::EdSymbolList, bpp::SequenceWithQuality, bpp::BasicSequence, bpp::BasicSymbolList, bpp::SequenceWithAnnotation, bpp::Site, and bpp::Sequence.
|
pure virtual |
Delete the element at position 'pos'.
pos | The position of the element to delete. |
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::SequenceTools::getCDS(), bpp::SequenceTools::removeGaps(), and bpp::VectorSiteContainer::removeSequence().
|
pure virtual |
Delete the elements at position 'pos'.
pos | The position of the first element to delete. |
len | The length of the region to delete. |
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
|
pure virtual |
Get the alphabet associated to the list.
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::SymbolListTools::changeGapsToUnknownCharacters(), bpp::SymbolListTools::changeUnresolvedCharactersToGaps(), bpp::SequenceTools::findFirstOf(), bpp::SequenceTools::getCDS(), bpp::SymbolListTools::getCounts(), bpp::SequenceTools::getNumberOfCompleteSites(), bpp::SequenceTools::getNumberOfSites(), bpp::SequenceTools::getNumberOfUnresolvedSites(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::SequenceTools::getSequenceWithCompleteSites(), bpp::SequenceTools::getSequenceWithoutGaps(), bpp::SequenceTools::invertComplement(), bpp::BasicSymbolList::operator=(), bpp::EdSymbolList::operator=(), and bpp::SequenceTools::removeGaps().
|
pure virtual |
Get the element at position 'pos' as a character.
pos | The position of the character to retrieve. |
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::SiteContainerTools::resolveDottedAlignment().
|
pure virtual |
Get the whole content of the list as a vector of int.
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::SequenceWithQualityTools::complement(), bpp::AbstractSequenceContainer::getContent(), bpp::SymbolListTools::getCounts(), bpp::BasicSymbolList::operator=(), bpp::EdSymbolList::operator=(), bpp::SequenceWithQualityTools::reverseTranscript(), and bpp::SequenceWithQualityTools::transcript().
|
pure virtual |
Get the element at position 'pos' as an int.
pos | The position of the character to retrieve. |
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::SequenceTools::findFirstOf(), bpp::SequenceTools::invert(), and bpp::SequenceTools::invertComplement().
|
pure virtual |
Operator [] overloaded for quick access to a character in list.
i | The position to retrieve. |
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
|
pure virtual |
Operator [] overloaded for quick access to a character in list.
i | The position to retrieve. |
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
|
pure virtual |
Set the whole content of the list.
list | The new content of the list. |
Implemented in bpp::EdSymbolList, bpp::BasicSequence, bpp::BasicSymbolList, bpp::SequenceWithAnnotation, and bpp::Sequence.
|
pure virtual |
Set the whole content of the list.
list | The new content of the list. |
Implemented in bpp::EdSymbolList, bpp::BasicSequence, bpp::BasicSymbolList, bpp::SequenceWithAnnotation, and bpp::Sequence.
|
pure virtual |
Set the element at position 'pos' to character 'c'.
pos | The position of the character to set. |
c | The value of the element, given as a string. |
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::SequenceTools::invert(), and bpp::SequenceTools::invertComplement().
|
pure virtual |
Set the element at position 'pos' to character 'v'.
pos | The position of the character to set. |
v | The value of the element, given as an int. |
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
|
pure virtual |
Randomly shuffle the content of the list, with linear complexity.
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
|
pure virtual |
Get the number of elements in the list.
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::SymbolListTools::changeGapsToUnknownCharacters(), bpp::SymbolListTools::changeUnresolvedCharactersToGaps(), bpp::SequenceTools::findFirstOf(), bpp::SiteContainerTools::getAlignmentPositions(), bpp::SequenceTools::getCDS(), bpp::GeneticCode::getCodingSequence(), bpp::SymbolListTools::getFrequencies(), bpp::SequenceTools::getNumberOfCompleteSites(), bpp::SequenceTools::getNumberOfSites(), bpp::SequenceTools::getNumberOfUnresolvedSites(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceTools::getSequenceWithCompleteSites(), bpp::SequenceTools::getSequenceWithoutGaps(), bpp::SequenceMask::init(), bpp::SequenceQuality::init(), bpp::SequenceTools::invert(), bpp::SequenceTools::invertComplement(), bpp::SequenceTools::removeGaps(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::SequenceContainerTools::sequencesHaveTheSameLength(), and bpp::SequenceWalker::SequenceWalker().
|
pure virtual |
Convert the list as a string.
This method is useful for dumping a list to a file or to the screen for display.
Implemented in bpp::EdSymbolList, and bpp::BasicSymbolList.
Referenced by bpp::AbstractSequenceContainer::toString().