|
bpp-seq
2.2.0
|
#include <Bpp/Seq/Site.h>
Inheritance diagram for bpp::Site:
Collaboration diagram for bpp::Site:Public Member Functions | |
| Site (const Alphabet *alpha) | |
| Build a new void Site object with the specified alphabet. More... | |
| Site (const Alphabet *alpha, int position) | |
| Build a new void Site object with the specified alphabet and position. More... | |
| Site (const std::vector< std::string > &site, const Alphabet *alpha) throw (BadCharException) | |
| Build a new Site object with the specified alphabet. The content of the site is initialized from a vector of characters. More... | |
| Site (const std::vector< std::string > &site, const Alphabet *alpha, int position) throw (BadCharException) | |
| Build a new Site object with the specified alphabet and position. The content of the site is initialized from a vector of characters. More... | |
| Site (const std::vector< int > &site, const Alphabet *alpha) throw (BadIntException) | |
| Build a new Site object with the specified alphabet. The content of the site is initialized from a vector of integers. More... | |
| Site (const std::vector< int > &site, const Alphabet *alpha, int position) throw (BadIntException) | |
| Build a new Site object with the specified alphabet and position. The content of the site is initialized from a vector of integers. More... | |
| Site (const Site &site) | |
| The copy constructor. More... | |
| Site & | operator= (const Site &s) |
| The assignment operator. More... | |
| virtual | ~Site () |
| virtual const Alphabet * | getAlphabet () const |
| Get the alphabet associated to the list. More... | |
| virtual size_t | size () const |
| Get the number of elements in the list. More... | |
| virtual const std::vector< int > & | getContent () const |
| Get the whole content of the list as a vector of int. More... | |
| virtual void | setContent (const std::vector< int > &list) throw (BadIntException) |
| Set the whole content of the list. More... | |
| virtual void | setContent (const std::vector< std::string > &list) throw (BadCharException) |
| Set the whole content of the list. More... | |
| virtual std::string | toString () const |
| Convert the list as a string. More... | |
| virtual void | addElement (const std::string &c) throw (BadCharException) |
| Add a character to the end of the list. More... | |
| virtual void | addElement (size_t pos, const std::string &c) throw (BadCharException, IndexOutOfBoundsException) |
| Add a character at a certain position in the list. More... | |
| virtual void | addElement (int v) throw (BadIntException) |
| Add a character to the end of the list. More... | |
| virtual void | addElement (size_t pos, int v) throw (BadIntException, IndexOutOfBoundsException) |
| Add a character at a certain position in the list. More... | |
| virtual void | setElement (size_t pos, const std::string &c) throw (BadCharException, IndexOutOfBoundsException) |
| Set the element at position 'pos' to character 'c'. More... | |
| virtual void | setElement (size_t pos, int v) throw (BadIntException, IndexOutOfBoundsException) |
| Set the element at position 'pos' to character 'v'. More... | |
| virtual void | deleteElement (size_t pos) throw (IndexOutOfBoundsException) |
| Delete the element at position 'pos'. More... | |
| virtual void | deleteElements (size_t pos, size_t len) throw (IndexOutOfBoundsException) |
| Delete the elements at position 'pos'. More... | |
| virtual std::string | getChar (size_t pos) const throw (IndexOutOfBoundsException) |
| Get the element at position 'pos' as a character. More... | |
| virtual int | getValue (size_t pos) const throw (IndexOutOfBoundsException) |
| Get the element at position 'pos' as an int. More... | |
| virtual const int & | operator[] (size_t i) const |
| Operator [] overloaded for quick access to a character in list. More... | |
| virtual int & | operator[] (size_t i) |
| Operator [] overloaded for quick access to a character in list. More... | |
| virtual void | shuffle () |
| Randomly shuffle the content of the list, with linear complexity. More... | |
The Clonable interface | |
| Site * | clone () const |
Setting/getting the position of the site. | |
| virtual int | getPosition () const |
| Get the position of this site. More... | |
| virtual void | setPosition (int position) |
| Set the position of this site. More... | |
Protected Attributes | |
| std::vector< int > | content_ |
| The list content. More... | |
Private Attributes | |
| int | position_ |
| The position associated to this site. More... | |
The Site class.
Define specific attributes and methods for sites manipulation. It is very similar to the Sequence object (a site is a vertical sequence!), and characters at each position are coded as integers. Sites have a 'position' attribute. This attribute stands for an indice in a an alignment, and may be used as a unique identifier, in the same manner that names identify sequence objects. But for now, we do not allow to construct a Site directly from a string. This should not be a constraint, since you never read sites directly from a file.
| Site::Site | ( | const Alphabet * | alpha | ) |
| Site::Site | ( | const Alphabet * | alpha, |
| int | position | ||
| ) |
| Site::Site | ( | const std::vector< std::string > & | site, |
| const Alphabet * | alpha | ||
| ) | |||
| throw | ( | BadCharException | |
| ) | |||
Build a new Site object with the specified alphabet. The content of the site is initialized from a vector of characters.
| site | The content of the site. |
| alpha | The alphabet to use. |
| BadCharException | If the content does not match the specified alphabet. |
| Site::Site | ( | const std::vector< std::string > & | site, |
| const Alphabet * | alpha, | ||
| int | position | ||
| ) | |||
| throw | ( | BadCharException | |
| ) | |||
Build a new Site object with the specified alphabet and position. The content of the site is initialized from a vector of characters.
| site | The content of the site. |
| alpha | The alphabet to use. |
| position | The position attribute for this site. |
| BadCharException | If the content does not match the specified alphabet. |
| Site::Site | ( | const std::vector< int > & | site, |
| const Alphabet * | alpha | ||
| ) | |||
| throw | ( | BadIntException | |
| ) | |||
Build a new Site object with the specified alphabet. The content of the site is initialized from a vector of integers.
| site | The content of the site. |
| alpha | The alphabet to use. |
| BadIntException | If the content does not match the specified alphabet. |
| Site::Site | ( | const std::vector< int > & | site, |
| const Alphabet * | alpha, | ||
| int | position | ||
| ) | |||
| throw | ( | BadIntException | |
| ) | |||
Build a new Site object with the specified alphabet and position. The content of the site is initialized from a vector of integers.
| site | The content of the site. |
| alpha | The alphabet to use. |
| position | The position attribute for this site. |
| BadIntException | If the content does not match the specified alphabet. |
|
virtualinherited | ||||||||||||||
Add a character to the end of the list.
| c | The character to add, given as a string. |
Implements bpp::SymbolList.
Definition at line 121 of file SymbolList.cpp.
Referenced by bpp::NucleicAcidsReplication::reverse(), and bpp::NucleicAcidsReplication::translate().
|
virtualinherited | ||||||||||||||||||||||||
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. |
Implements bpp::SymbolList.
Definition at line 128 of file SymbolList.cpp.
|
virtualinherited | ||||||||||||||
Add a character to the end of the list.
| v | The character to add, given as an int. |
Implements bpp::SymbolList.
Definition at line 181 of file SymbolList.cpp.
|
virtualinherited | ||||||||||||||||||||||||
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. |
Implements bpp::SymbolList.
Definition at line 190 of file SymbolList.cpp.
|
inlinevirtual |
|
virtualinherited | ||||||||||||||
Delete the element at position 'pos'.
| pos | The position of the element to delete. |
Implements bpp::SymbolList.
Definition at line 163 of file SymbolList.cpp.
Referenced by bpp::AlignedSequenceContainer::removeSite().
|
virtualinherited | ||||||||||||||||||||
Delete the elements at position 'pos'.
| pos | The position of the first element to delete. |
| len | The length of the region to delete. |
Implements bpp::SymbolList.
Definition at line 172 of file SymbolList.cpp.
|
inlinevirtualinherited |
Get the alphabet associated to the list.
Implements bpp::SymbolList.
Definition at line 348 of file SymbolList.h.
References bpp::BasicSymbolList::alphabet_.
Referenced by bpp::SiteTools::areSitesIdentical(), bpp::SiteTools::hasGap(), bpp::SiteTools::hasUnknown(), bpp::SiteTools::isComplete(), bpp::SiteTools::isGapOnly(), bpp::SiteTools::isGapOrUnresolvedOnly(), bpp::BasicSymbolList::operator=(), bpp::BasicSequence::setToSizeL(), bpp::BasicSequence::setToSizeR(), and bpp::AbstractTransliterator::translate().
|
virtualinherited | ||||||||||||||
Get the element at position 'pos' as a character.
| pos | The position of the character to retrieve. |
Implements bpp::SymbolList.
Definition at line 145 of file SymbolList.cpp.
Referenced by bpp::SiteContainerTools::resolveDottedAlignment().
|
inlinevirtualinherited |
Get the whole content of the list as a vector of int.
Implements bpp::SymbolList.
Definition at line 352 of file SymbolList.h.
References bpp::BasicSymbolList::content_.
Referenced by operator=(), and bpp::BasicSymbolList::operator=().
|
inlinevirtual |
Get the position of this site.
Definition at line 162 of file Site.h.
References position_.
Referenced by bpp::SiteContainerTools::merge(), bpp::operator<(), operator=(), bpp::operator==(), and bpp::SiteContainerTools::resolveDottedAlignment().
|
virtualinherited | ||||||||||||||
Get the element at position 'pos' as an int.
| pos | The position of the character to retrieve. |
Implements bpp::SymbolList.
Definition at line 212 of file SymbolList.cpp.
Referenced by bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::CodonSiteTools::isFourFoldDegenerated(), and bpp::CodonSiteTools::numberOfSubsitutions().
The assignment operator.
Definition at line 70 of file Site.cpp.
References bpp::BasicSymbolList::content_, bpp::BasicSymbolList::getContent(), getPosition(), and position_.
|
inlinevirtualinherited |
Operator [] overloaded for quick access to a character in list.
| i | The position to retrieve. |
Implements bpp::SymbolList.
Definition at line 380 of file SymbolList.h.
References bpp::BasicSymbolList::content_.
|
inlinevirtualinherited |
Operator [] overloaded for quick access to a character in list.
| i | The position to retrieve. |
Implements bpp::SymbolList.
Definition at line 382 of file SymbolList.h.
References bpp::BasicSymbolList::content_.
|
virtualinherited | ||||||||||||||
Set the whole content of the list.
| list | The new content of the list. |
Implements bpp::SymbolList.
Reimplemented in bpp::BasicSequence.
Definition at line 101 of file SymbolList.cpp.
Referenced by bpp::BasicSequence::setContent().
|
virtualinherited | ||||||||||||||
Set the whole content of the list.
| list | The new content of the list. |
Implements bpp::SymbolList.
Reimplemented in bpp::BasicSequence.
Definition at line 85 of file SymbolList.cpp.
|
virtualinherited | ||||||||||||||||||||||||
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. |
Implements bpp::SymbolList.
Definition at line 136 of file SymbolList.cpp.
|
virtualinherited | ||||||||||||||||||||||||
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. |
Implements bpp::SymbolList.
Definition at line 201 of file SymbolList.cpp.
|
inlinevirtual |
Set the position of this site.
| position | The new position of the site. |
Definition at line 169 of file Site.h.
References position_.
Referenced by bpp::VectorSiteContainer::addSite().
|
inlinevirtualinherited |
Randomly shuffle the content of the list, with linear complexity.
Implements bpp::SymbolList.
Definition at line 384 of file SymbolList.h.
References bpp::BasicSymbolList::content_.
|
inlinevirtualinherited |
Get the number of elements in the list.
Implements bpp::SymbolList.
Definition at line 350 of file SymbolList.h.
References bpp::BasicSymbolList::content_.
Referenced by bpp::SiteTools::areSitesIdentical(), bpp::CompressedVectorSiteContainer::getSiteIndex_(), bpp::SiteTools::hasGap(), bpp::SiteTools::hasUnknown(), bpp::SiteTools::isComplete(), bpp::CodonSiteTools::isFourFoldDegenerated(), bpp::SiteTools::isGapOnly(), bpp::SiteTools::isGapOrUnresolvedOnly(), bpp::CodonSiteTools::numberOfSubsitutions(), bpp::operator==(), and bpp::WordAlphabet::reverse().
|
virtualinherited |
Convert the list as a string.
This method is useful for dumping a list to a file or to the screen for display.
Implements bpp::SymbolList.
Definition at line 114 of file SymbolList.cpp.
References bpp::BasicSymbolList::alphabet_, bpp::BasicSymbolList::content_, and bpp::StringSequenceTools::decodeSequence().
|
protectedinherited |
The list content.
Definition at line 280 of file SymbolList.h.
Referenced by bpp::BasicSymbolList::getContent(), operator=(), bpp::BasicSymbolList::operator=(), bpp::BasicSymbolList::operator[](), bpp::BasicSequence::setToSizeL(), bpp::BasicSequence::setToSizeR(), bpp::BasicSymbolList::shuffle(), bpp::BasicSymbolList::size(), and bpp::BasicSymbolList::toString().
|
private |
The position associated to this site.
Definition at line 68 of file Site.h.
Referenced by getPosition(), operator=(), and setPosition().