bpp-seq3  3.0.0
bpp::Site Class Referenceabstract

The Site class. More...

#include <Bpp/Seq/Site.h>

+ Inheritance diagram for bpp::Site:
+ Collaboration diagram for bpp::Site:

Public Types

typedef int SymbolType
 

Public Member Functions

 Site (std::shared_ptr< const Alphabet > &alphabet)
 Build a new void Site object with the specified alphabet. More...
 
 Site (std::shared_ptr< const Alphabet > &alphabet, int coordinate)
 Build a new void Site object with the specified alphabet and position. More...
 
 Site (const std::vector< std::string > &site, std::shared_ptr< const Alphabet > &alphabet)
 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, std::shared_ptr< const Alphabet > &alphabet, int coordinate)
 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, std::shared_ptr< const Alphabet > &alphabet)
 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, std::shared_ptr< const Alphabet > alphabet, int coordinate)
 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...
 
Siteoperator= (const Site &s)
 The assignment operator. More...
 
virtual ~Site ()
 
double getStateValueAt (size_t sequencePosition, int state) const
 get value of a state at a position More...
 
virtual bool operator== (const SiteInterface &site)
 
virtual bool operator< (const SiteInterface &site)
 
virtual std::shared_ptr< const AlphabetgetAlphabet () const =0
 Get the alphabet associated to the list. More...
 
virtual const Alphabetalphabet () 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...
 
virtual double operator() (size_t position, int state) const =0
 get value of a state at a position More...
 
int getCoordinate () const override
 Get the coordinate associated to this site. More...
 
void setCoordinate (int coordinate) override
 Set the position of this site. More...
 
void setContent (const std::vector< int > &list) override
 
void setContent (const std::vector< std::string > &list) override
 Set the whole content of the list. More...
 
std::string toString () const override
 Convert the list as a string. More...
 
void addElement (const std::string &c) override
 Add a character to the end of the list. More...
 
void addElement (size_t pos, const std::string &c) override
 Add a character at a certain position in the list. More...
 
void addElement (const T &v) override
 
void addElement (const int &v) override
 Add a character to the end of the list. More...
 
void addElement (size_t pos, const int &v) override
 Add a character at a certain position in the list. More...
 
void setElement (size_t pos, const std::string &c) override
 Set the element at position 'pos' to character 'c'. More...
 
void setElement (size_t pos, const T &v) override
 
void setElement (size_t pos, const int &v) override
 Set the element at position 'pos' to character 'c'. More...
 
std::string getChar (size_t pos) const override
 Get the element at position 'pos' as a character. More...
 
double operator() (size_t siteIndex, int state) const override
 get value of a state at a position More...
 
virtual const std::vector< int > & getContent () const override
 
const int & getElement (size_t pos) const override
 Get the element at position 'pos' as a character. More...
 
const int & getValue (size_t pos) const override
 checked access to a character in list. More...
 
const int & operator[] (size_t pos) const override
 Operator [] overloaded for quick access to a character in list. More...
 
int & operator[] (size_t pos) override
 Operator [] overloaded for quick access to a character in list. More...
 
std::shared_ptr< const AlphabetgetAlphabet () const override
 Get the alphabet associated to the list. More...
 
const Alphabetalphabet () const override
 Get the alphabet associated to the list. More...
 
size_t size () const override
 Get the number of elements in the list. More...
 
void deleteElement (size_t pos) override
 Remove the element at position 'pos'. More...
 
void deleteElements (size_t pos, size_t len) override
 Remove the elements at position 'pos'. More...
 
void shuffle () override
 Randomly shuffle the content of the list, with linear complexity. More...
 
The Clonable interface
Siteclone () const
 
Setting/getting the position of the site.
virtual int getCoordinate () const =0
 Get the coordinate associated to this site. More...
 
virtual void setCoordinate (int coordinate)=0
 Set the position of this site. More...
 
Edition methods.
virtual void deleteElement (size_t pos)=0
 Remove the element at position 'pos'. More...
 
virtual void deleteElements (size_t pos, size_t len)=0
 Remove the elements at position 'pos'. More...
 
Provide direct access to the list content.
Warning
These operators allow you to modify the list content. No alphabet checking is performed for your modifications, so use with care, or consider using the setContent() method.
virtual void shuffle ()=0
 Randomly shuffle the content of the list, with linear complexity. More...
 
Acting on the content of the list.
virtual void setContent (const std::vector< std::string > &list)=0
 Set the whole content of the list. More...
 
virtual void setContent (const std::vector< T > &list)=0
 Set the whole content of the list. More...
 
Acting on the content of the list.
virtual void setContent (const std::vector< T > &list)=0
 Set the whole content of the list. More...
 
virtual const std::vector< T > & getContent () const =0
 
Edition methods.
virtual void addElement (const std::string &c)=0
 Add a character to the end of the list. More...
 
virtual void addElement (size_t pos, const std::string &c)=0
 Add a character at a certain position in the list. More...
 
virtual void addElement (const T &c)=0
 Add a character to the end of the list. More...
 
virtual void addElement (size_t pos, const T &c)=0
 Add a character at a certain position in the list. More...
 
virtual void setElement (size_t pos, const std::string &c)=0
 Set the element at position 'pos' to character 'c'. More...
 
virtual void setElement (size_t pos, const T &c)=0
 Set the element at position 'pos' to character 'c'. More...
 
virtual std::string getChar (size_t pos) const =0
 Get the element at position 'pos' as a character. More...
 
Edition methods.
virtual void addElement (const T &c)=0
 Add a character to the end of the list. More...
 
virtual void addElement (size_t pos, const T &c)=0
 Add a character at a certain position in the list. More...
 
virtual void setElement (size_t pos, const T &c)=0
 Set the element at position 'pos' to character 'c'. More...
 
virtual const T & getElement (size_t pos) const =0
 Get the element at position 'pos' as a character. More...
 
Provide direct access to the list content.
Warning
These operators allow you to modify the list content. No alphabet checking is performed for your modifications, so use with care, or consider using the setContent() method.
virtual const T & getValue (size_t pos) const =0
 checked access to a character in list. More...
 
virtual const T & operator[] (size_t pos) const =0
 Operator [] overloaded for quick access to a character in list. More...
 
virtual T & operator[] (size_t pos)=0
 Operator [] overloaded for quick access to a character in list. More...
 

Protected Attributes

std::vector< int > content_
 The list content. More...
 

Private Attributes

int coordinate_
 The position associated with this site. More...
 
std::shared_ptr< const Alphabetalphabet_
 The Alphabet attribute must be initialized in constructor and then can never be changed. More...
 

Detailed Description

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.

Definition at line 69 of file Site.h.

Member Typedef Documentation

◆ SymbolType

Definition at line 31 of file IntSymbolList.h.

Constructor & Destructor Documentation

◆ Site() [1/7]

bpp::Site::Site ( std::shared_ptr< const Alphabet > &  alphabet)
inline

Build a new void Site object with the specified alphabet.

Parameters
alphabetThe alphabet to use.

Definition at line 80 of file Site.h.

Referenced by clone().

◆ Site() [2/7]

bpp::Site::Site ( std::shared_ptr< const Alphabet > &  alphabet,
int  coordinate 
)
inline

Build a new void Site object with the specified alphabet and position.

Parameters
alphabetThe alphabet to use.
coordinateThe coordinate attribute of this site.

Definition at line 92 of file Site.h.

◆ Site() [3/7]

bpp::Site::Site ( const std::vector< std::string > &  site,
std::shared_ptr< const Alphabet > &  alphabet 
)
inline

Build a new Site object with the specified alphabet. The content of the site is initialized from a vector of characters.

Parameters
siteThe content of the site.
alphabetThe alphabet to use.
Exceptions
BadCharExceptionIf the content does not match the specified alphabet.

Definition at line 106 of file Site.h.

◆ Site() [4/7]

bpp::Site::Site ( const std::vector< std::string > &  site,
std::shared_ptr< const Alphabet > &  alphabet,
int  coordinate 
)
inline

Build a new Site object with the specified alphabet and position. The content of the site is initialized from a vector of characters.

Parameters
siteThe content of the site.
alphabetThe alphabet to use.
coordinateThe coordinate attribute of this site.
Exceptions
BadCharExceptionIf the content does not match the specified alphabet.

Definition at line 121 of file Site.h.

◆ Site() [5/7]

bpp::Site::Site ( const std::vector< int > &  site,
std::shared_ptr< const Alphabet > &  alphabet 
)
inline

Build a new Site object with the specified alphabet. The content of the site is initialized from a vector of integers.

Parameters
siteThe content of the site.
alphabetThe alphabet to use.
Exceptions
BadIntExceptionIf the content does not match the specified alphabet.

Definition at line 135 of file Site.h.

◆ Site() [6/7]

bpp::Site::Site ( const std::vector< int > &  site,
std::shared_ptr< const Alphabet alphabet,
int  coordinate 
)
inline

Build a new Site object with the specified alphabet and position. The content of the site is initialized from a vector of integers.

Parameters
siteThe content of the site.
alphabetThe alphabet to use.
coordinateThe coordinate attribute of this site.
Exceptions
BadIntExceptionIf the content does not match the specified alphabet.

Definition at line 150 of file Site.h.

◆ Site() [7/7]

bpp::Site::Site ( const Site site)
inline

The copy constructor.

Definition at line 159 of file Site.h.

◆ ~Site()

virtual bpp::Site::~Site ( )
inlinevirtual

Definition at line 176 of file Site.h.

Member Function Documentation

◆ addElement() [1/11]

void bpp::AbstractTemplateSymbolList< int >::addElement ( const T &  c)
inlineoverrideinherited

Add a character to the end of the list.

Parameters
cThe character to add.

Definition at line 152 of file SymbolList.h.

◆ addElement() [2/11]

void bpp::IntSymbolList::addElement ( const std::string &  c)
inlineoverridevirtualinherited

Add a character to the end of the list.

Parameters
cThe character to add, given as a string.

Implements bpp::IntSymbolListInterface.

Reimplemented in bpp::EventDrivenIntSymbolList.

Definition at line 185 of file IntSymbolList.h.

References bpp::AbstractTemplateSymbolList< int >::content_, and bpp::AbstractTemplateSymbolList< int >::getAlphabet().

◆ addElement() [3/11]

virtual void bpp::IntSymbolListInterface::addElement ( const std::string &  c)
pure virtualinherited

Add a character to the end of the list.

Parameters
cThe character to add, given as a string.

Implemented in bpp::EventDrivenIntSymbolList, and bpp::IntSymbolList.

◆ addElement() [4/11]

template<class T >
virtual void bpp::TemplateCoreSymbolListInterface< T >::addElement ( const T &  c)
pure virtualinherited

Add a character to the end of the list.

Parameters
cThe character to add.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, and bpp::AbstractTemplateSymbolList< T >.

◆ addElement() [5/11]

virtual void bpp::TemplateCoreSymbolListInterface< T >::addElement
inherited

Add a character to the end of the list.

Parameters
cThe character to add.

Referenced by bpp::SequenceWithQuality::addElement().

◆ addElement() [6/11]

void bpp::AbstractTemplateSymbolList< T >::addElement
inlineoverrideinherited

Definition at line 152 of file SymbolList.h.

Referenced by bpp::SequenceWithQuality::addElement().

◆ addElement() [7/11]

void bpp::AbstractTemplateSymbolList< int >::addElement ( size_t  pos,
const T &  c 
)
inlineoverrideinherited

Add a character at a certain position in the list.

Parameters
posThe position where to insert the element.
cThe character to add.

Definition at line 157 of file SymbolList.h.

◆ addElement() [8/11]

void bpp::IntSymbolList::addElement ( size_t  pos,
const std::string &  c 
)
inlineoverridevirtualinherited

Add a character at a certain position in the list.

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

Implements bpp::IntSymbolListInterface.

Reimplemented in bpp::EventDrivenIntSymbolList.

Definition at line 192 of file IntSymbolList.h.

References bpp::AbstractTemplateSymbolList< int >::content_, bpp::AbstractTemplateSymbolList< int >::getAlphabet(), and bpp::AbstractTemplateSymbolList< int >::size().

◆ addElement() [9/11]

virtual void bpp::IntSymbolListInterface::addElement ( size_t  pos,
const std::string &  c 
)
pure virtualinherited

Add a character at a certain position in the list.

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

Implemented in bpp::EventDrivenIntSymbolList, and bpp::IntSymbolList.

◆ addElement() [10/11]

template<class T >
virtual void bpp::TemplateCoreSymbolListInterface< T >::addElement ( size_t  pos,
const T &  c 
)
pure virtualinherited

Add a character at a certain position in the list.

Parameters
posThe position where to insert the element.
cThe character to add.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, and bpp::AbstractTemplateSymbolList< T >.

◆ addElement() [11/11]

virtual void bpp::TemplateCoreSymbolListInterface< T >::addElement
inherited

Add a character at a certain position in the list.

Parameters
posThe position where to insert the element.
cThe character to add.

◆ alphabet() [1/2]

◆ alphabet() [2/2]

const Alphabet& bpp::AbstractTemplateSymbolList< int >::alphabet ( ) const
inlineoverridevirtualinherited

Get the alphabet associated to the list.

Returns
A const reference to the alphabet.
See also
Alphabet class.

Implements bpp::CruxSymbolListInterface.

Definition at line 122 of file SymbolList.h.

◆ clone()

◆ deleteElement() [1/2]

void bpp::AbstractTemplateSymbolList< int >::deleteElement ( size_t  pos)
inlineoverridevirtualinherited

Remove the element at position 'pos'.

Parameters
posThe position of the element to remove.

Implements bpp::CruxSymbolListInterface.

Reimplemented in bpp::AbstractTemplateEventDrivenSymbolList< int >.

Definition at line 138 of file SymbolList.h.

◆ deleteElement() [2/2]

virtual void bpp::CruxSymbolListInterface::deleteElement ( size_t  pos)
pure virtualinherited

◆ deleteElements() [1/2]

void bpp::AbstractTemplateSymbolList< int >::deleteElements ( size_t  pos,
size_t  len 
)
inlineoverridevirtualinherited

Remove the elements at position 'pos'.

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

Implements bpp::CruxSymbolListInterface.

Reimplemented in bpp::AbstractTemplateEventDrivenSymbolList< int >.

Definition at line 145 of file SymbolList.h.

◆ deleteElements() [2/2]

virtual void bpp::CruxSymbolListInterface::deleteElements ( size_t  pos,
size_t  len 
)
pure virtualinherited

Remove the elements at position 'pos'.

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

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, bpp::AbstractTemplateEventDrivenSymbolList< int >, bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ getAlphabet() [1/2]

virtual std::shared_ptr<const Alphabet> bpp::CruxSymbolListInterface::getAlphabet ( ) const
pure virtualinherited

Get the alphabet associated to the list.

Returns
A const pointer to the alphabet.
See also
Alphabet class.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

Referenced by bpp::Sequence::append(), bpp::SequenceWithAnnotation::append(), bpp::SequenceTools::areSequencesIdentical(), bpp::SymbolListTools::areSymbolListsIdentical(), bpp::SequenceTools::bowkerTest(), bpp::SymbolListTools::changeGapsToUnknownCharacters(), bpp::SymbolListTools::changeUnresolvedCharactersToGaps(), bpp::SequenceTools::combineSequences(), bpp::SequenceWithQualityTools::complement(), bpp::SequenceTools::complement(), bpp::SiteContainerTools::computeSimilarity(), bpp::SequenceTools::concatenate(), bpp::SequenceWithQualityTools::concatenate(), bpp::SequenceTools::findFirstOf(), bpp::SequenceTools::getCDS(), bpp::SequenceTools::getComplement(), bpp::SymbolListTools::getCountsResolveUnknowns(), bpp::SymbolListTools::getGCContent(), bpp::SymbolListTools::getNumberOfDistinctPositions(), bpp::SymbolListTools::getNumberOfPositionsWithoutGap(), bpp::SequenceTools::getNumberOfUnresolvedSites(), bpp::SequenceTools::getPercentIdentity(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::SequenceTools::getSequenceWithoutGaps(), bpp::SequenceTools::getSequenceWithoutStops(), bpp::SymbolListTools::hasGap(), bpp::SymbolListTools::hasUnknown(), bpp::SymbolListTools::hasUnresolved(), bpp::SequenceTools::invertComplement(), bpp::SymbolListTools::isComplete(), bpp::SymbolListTools::isConstant(), bpp::SymbolListTools::isGapOnly(), bpp::SymbolListTools::isGapOrUnresolvedOnly(), bpp::SymbolListTools::jointEntropy(), bpp::SequenceWithAnnotation::merge(), bpp::SymbolListTools::mutualInformation(), bpp::SymbolListTools::numberOfGaps(), bpp::SymbolListTools::numberOfUnresolved(), bpp::ProbabilisticSymbolList::operator=(), bpp::AbstractTemplateSymbolList< T >::operator=(), bpp::SequenceWithQualityTools::removeGaps(), bpp::SequenceTools::removeGaps(), bpp::SequenceTools::removeStops(), bpp::SequenceTools::replaceStopsWithGaps(), bpp::WordAlphabet::reverse(), bpp::NucleicAcidsReplication::reverse(), bpp::SequenceWithQualityTools::reverseTranscript(), bpp::SequenceTools::RNYslice(), bpp::SequenceTools::subseq(), bpp::SequenceWithQualityTools::subseq(), bpp::SequenceTools::subtractHaplotype(), bpp::SequenceWithQualityTools::transcript(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::WordAlphabet::translate(), and bpp::SymbolListTools::variabilityShannon().

◆ getAlphabet() [2/2]

std::shared_ptr<const Alphabet> bpp::AbstractTemplateSymbolList< int >::getAlphabet ( ) const
inlineoverridevirtualinherited

Get the alphabet associated to the list.

Returns
A const pointer to the alphabet.
See also
Alphabet class.

Implements bpp::CruxSymbolListInterface.

Definition at line 120 of file SymbolList.h.

◆ getChar() [1/2]

virtual std::string bpp::IntSymbolListInterface::getChar ( size_t  pos) const
pure virtualinherited

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

Parameters
posThe position of the character to retrieve.

Implemented in bpp::Sequence, bpp::EventDrivenIntSymbolList, and bpp::IntSymbolList.

◆ getChar() [2/2]

string IntSymbolList::getChar ( size_t  pos) const
overridevirtualinherited

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

Parameters
posThe position of the character to retrieve.

Implements bpp::IntSymbolListInterface.

Reimplemented in bpp::Sequence, and bpp::EventDrivenIntSymbolList.

Definition at line 52 of file IntSymbolList.cpp.

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

◆ getContent() [1/2]

◆ getContent() [2/2]

virtual const std::vector<int >& bpp::AbstractTemplateSymbolList< int >::getContent ( ) const
inlineoverridevirtualinherited

Implements bpp::TemplateCoreSymbolListInterface< T >.

Definition at line 131 of file SymbolList.h.

◆ getCoordinate() [1/2]

virtual int bpp::CoreSiteInterface::getCoordinate ( ) const
pure virtualinherited

Get the coordinate associated to this site.

Returns
The coordinate of this site.

Implemented in bpp::AbstractCoreSite.

Referenced by bpp::SiteInterface::operator<(), bpp::AbstractCoreSite::operator=(), and bpp::SiteInterface::operator==().

◆ getCoordinate() [2/2]

int bpp::AbstractCoreSite::getCoordinate ( ) const
inlineoverridevirtualinherited

Get the coordinate associated to this site.

Returns
The coordinate of this site.

Implements bpp::CoreSiteInterface.

Definition at line 144 of file CoreSite.h.

References bpp::AbstractCoreSite::coordinate_.

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

◆ getElement() [1/2]

template<class T >
virtual const T& bpp::TemplateCoreSymbolListInterface< T >::getElement ( size_t  pos) const
pure virtualinherited

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

Parameters
posThe position of the character to retrieve.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ getElement() [2/2]

const int & bpp::AbstractTemplateSymbolList< int >::getElement ( size_t  pos) const
inlineoverridevirtualinherited

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

Parameters
posThe position of the character to retrieve.

Implements bpp::TemplateCoreSymbolListInterface< T >.

Definition at line 173 of file SymbolList.h.

◆ getStateValueAt()

double bpp::Site::getStateValueAt ( size_t  position,
int  state 
) const
inlinevirtual

get value of a state at a position

Parameters
positionposition in the list
statestate in the alphabet
Returns
The state value at the given position.

Reimplemented from bpp::IntSymbolList.

Definition at line 187 of file Site.h.

References bpp::AbstractTemplateSymbolList< int >::getAlphabet(), and bpp::AbstractTemplateSymbolList< int >::size().

Referenced by bpp::CompressedVectorSiteContainer::getStateValueAt(), and bpp::CompressedVectorSiteContainer::operator()().

◆ getValue() [1/2]

◆ getValue() [2/2]

const int & bpp::AbstractTemplateSymbolList< int >::getValue ( size_t  pos) const
inlineoverridevirtualinherited

checked access to a character in list.

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implements bpp::TemplateCoreSymbolListInterface< T >.

Definition at line 180 of file SymbolList.h.

◆ operator()() [1/2]

virtual double bpp::CruxSymbolListInterface::operator() ( size_t  position,
int  state 
) const
pure virtualinherited

get value of a state at a position

Short-cut for getStateValueAt.

Parameters
positionposition in the list
statestate in the alphabet
Returns
The state value at the given position.

Implemented in bpp::ProbabilisticSymbolList, and bpp::IntSymbolList.

◆ operator()() [2/2]

double bpp::IntSymbolList::operator() ( size_t  position,
int  state 
) const
inlineoverridevirtualinherited

get value of a state at a position

Short-cut for getStateValueAt.

Parameters
positionposition in the list
statestate in the alphabet
Returns
The state value at the given position.

Implements bpp::CruxSymbolListInterface.

Definition at line 218 of file IntSymbolList.h.

References bpp::AbstractTemplateSymbolList< int >::content_, and bpp::AbstractTemplateSymbolList< int >::getAlphabet().

◆ operator<()

virtual bool bpp::SiteInterface::operator< ( const SiteInterface site)
inlinevirtualinherited

Definition at line 51 of file Site.h.

References bpp::CoreSiteInterface::getCoordinate().

◆ operator=()

Site& bpp::Site::operator= ( const Site s)
inline

◆ operator==()

virtual bool bpp::SiteInterface::operator== ( const SiteInterface site)
inlinevirtualinherited

◆ operator[]() [1/4]

template<class T >
virtual const T& bpp::TemplateCoreSymbolListInterface< T >::operator[] ( size_t  pos) const
pure virtualinherited

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

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ operator[]() [2/4]

const int & bpp::AbstractTemplateSymbolList< int >::operator[] ( size_t  pos) const
inlineoverridevirtualinherited

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

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implements bpp::TemplateCoreSymbolListInterface< T >.

Definition at line 187 of file SymbolList.h.

◆ operator[]() [3/4]

int & bpp::AbstractTemplateSymbolList< int >::operator[] ( size_t  pos)
inlineoverridevirtualinherited

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

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implements bpp::TemplateCoreSymbolListInterface< T >.

Definition at line 189 of file SymbolList.h.

◆ operator[]() [4/4]

template<class T >
virtual T& bpp::TemplateCoreSymbolListInterface< T >::operator[] ( size_t  pos)
pure virtualinherited

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

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ setContent() [1/5]

void IntSymbolList::setContent ( const std::vector< int > &  list)
overridevirtualinherited

◆ setContent() [2/5]

void IntSymbolList::setContent ( const std::vector< std::string > &  list)
overridevirtualinherited

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 internally stored.

Implements bpp::IntSymbolListInterface.

Reimplemented in bpp::SequenceWithAnnotation, bpp::Sequence, and bpp::EventDrivenIntSymbolList.

Definition at line 15 of file IntSymbolList.cpp.

References bpp::AbstractTemplateSymbolList< T >::setContent().

◆ setContent() [3/5]

virtual void bpp::IntSymbolListInterface::setContent ( const std::vector< std::string > &  list)
pure virtualinherited

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 internally stored.

Implemented in bpp::SequenceInterface, bpp::SequenceWithAnnotation, bpp::Sequence, bpp::EventDrivenIntSymbolList, and bpp::IntSymbolList.

◆ setContent() [4/5]

template<class T >
virtual void bpp::TemplateCoreSymbolListInterface< T >::setContent ( const std::vector< T > &  list)
pure virtualinherited

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 internally stored.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, and bpp::AbstractTemplateSymbolList< T >.

◆ setContent() [5/5]

virtual void bpp::TemplateCoreSymbolListInterface< T >::setContent
inherited

◆ setCoordinate() [1/2]

void bpp::AbstractCoreSite::setCoordinate ( int  coordinate)
inlineoverridevirtualinherited

Set the position of this site.

Parameters
coordinateThe new position of the site.

Implements bpp::CoreSiteInterface.

Definition at line 146 of file CoreSite.h.

References bpp::AbstractCoreSite::coordinate_.

Referenced by bpp::CompressedVectorSiteContainer::reindexSites(), and bpp::CompressedVectorSiteContainer::setSiteCoordinates().

◆ setCoordinate() [2/2]

virtual void bpp::CoreSiteInterface::setCoordinate ( int  coordinate)
pure virtualinherited

Set the position of this site.

Parameters
coordinateThe new position of the site.

Implemented in bpp::AbstractCoreSite.

◆ setElement() [1/6]

void bpp::AbstractTemplateSymbolList< int >::setElement ( size_t  pos,
const T &  c 
)
inlineoverrideinherited

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

Parameters
posThe position of the character to set.
cThe value of the element.

Definition at line 165 of file SymbolList.h.

◆ setElement() [2/6]

void bpp::IntSymbolList::setElement ( size_t  pos,
const std::string &  c 
)
inlineoverridevirtualinherited

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::IntSymbolListInterface.

Reimplemented in bpp::EventDrivenIntSymbolList.

Definition at line 201 of file IntSymbolList.h.

References bpp::AbstractTemplateSymbolList< int >::content_, bpp::AbstractTemplateSymbolList< int >::getAlphabet(), and bpp::AbstractTemplateSymbolList< int >::size().

◆ setElement() [3/6]

virtual void bpp::IntSymbolListInterface::setElement ( size_t  pos,
const std::string &  c 
)
pure virtualinherited

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::EventDrivenIntSymbolList, and bpp::IntSymbolList.

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

◆ setElement() [4/6]

template<class T >
virtual void bpp::TemplateCoreSymbolListInterface< T >::setElement ( size_t  pos,
const T &  c 
)
pure virtualinherited

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

Parameters
posThe position of the character to set.
cThe value of the element.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, and bpp::AbstractTemplateSymbolList< T >.

◆ setElement() [5/6]

virtual void bpp::TemplateCoreSymbolListInterface< T >::setElement
inherited

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

Parameters
posThe position of the character to set.
cThe value of the element.

◆ setElement() [6/6]

void bpp::AbstractTemplateSymbolList< T >::setElement
inlineoverrideinherited

Definition at line 165 of file SymbolList.h.

◆ shuffle() [1/2]

void bpp::AbstractTemplateSymbolList< int >::shuffle ( )
inlineoverridevirtualinherited

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

Implements bpp::CruxSymbolListInterface.

Definition at line 191 of file SymbolList.h.

◆ shuffle() [2/2]

virtual void bpp::CruxSymbolListInterface::shuffle ( )
pure virtualinherited

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

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ size() [1/2]

virtual size_t bpp::CruxSymbolListInterface::size ( ) const
pure virtualinherited

Get the number of elements in the list.

Returns
The number of sites in the list.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

Referenced by bpp::AbstractTemplateSymbolList< T >::AbstractTemplateSymbolList(), bpp::SequenceWithQuality::addElement(), bpp::SequenceWithAnnotation::append(), bpp::SequenceTools::areSequencesIdentical(), bpp::SymbolListTools::areSymbolListsIdentical(), bpp::SequenceTools::bowkerTest(), bpp::SymbolListTools::changeGapsToUnknownCharacters(), bpp::SymbolListTools::changeUnresolvedCharactersToGaps(), bpp::SequenceTools::combineSequences(), bpp::SequenceTools::complement(), bpp::SiteContainerTools::computeSimilarity(), bpp::SequenceTools::concatenate(), bpp::SequenceTools::findFirstOf(), bpp::SequenceTools::getCDS(), bpp::GeneticCode::getCodingSequence(), bpp::SymbolListTools::getCounts(), bpp::SymbolListTools::getCountsResolveUnknowns(), bpp::SymbolListTools::getFrequencies(), bpp::SymbolListTools::getGCContent(), bpp::SymbolListTools::getMajorAllele(), bpp::SymbolListTools::getMajorAlleleFrequency(), bpp::SymbolListTools::getMinorAllele(), bpp::SymbolListTools::getMinorAlleleFrequency(), bpp::SequenceTools::getNumberOfCompleteSites(), bpp::SymbolListTools::getNumberOfDistinctCharacters(), bpp::SymbolListTools::getNumberOfDistinctPositions(), bpp::SymbolListTools::getNumberOfPositionsWithoutGap(), bpp::SequenceTools::getNumberOfSites(), bpp::SequenceTools::getNumberOfUnresolvedSites(), bpp::SequenceTools::getPercentIdentity(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::SequenceTools::getSequenceWithCompleteSites(), bpp::SequenceTools::getSequenceWithoutGaps(), bpp::SequenceTools::getSequenceWithoutStops(), bpp::SymbolListTools::hasGap(), bpp::SymbolListTools::hasSingleton(), bpp::SymbolListTools::hasUnknown(), bpp::SymbolListTools::hasUnresolved(), bpp::SymbolListTools::heterozygosity(), bpp::SequenceTools::invert(), bpp::SequenceTools::invertComplement(), bpp::SymbolListTools::isComplete(), bpp::SymbolListTools::isConstant(), bpp::SymbolListTools::isDoubleton(), bpp::SymbolListTools::isGapOnly(), bpp::SymbolListTools::isGapOrUnresolvedOnly(), bpp::SymbolListTools::isParsimonyInformativeSite(), bpp::SymbolListTools::isTriplet(), bpp::SequenceMask::isValidWith(), bpp::SequenceQuality::isValidWith(), bpp::SymbolListTools::jointEntropy(), bpp::SymbolListTools::mutualInformation(), bpp::SymbolListTools::numberOfGaps(), bpp::SymbolListTools::numberOfUnresolved(), bpp::AbstractTemplateSymbolList< T >::operator=(), bpp::SiteInterface::operator==(), bpp::SequenceWithQualityTools::removeGaps(), bpp::SequenceTools::removeGaps(), bpp::SequenceTools::removeStops(), bpp::SequenceTools::replaceStopsWithGaps(), bpp::CodonAlphabet::reverse(), bpp::WordAlphabet::reverse(), bpp::NucleicAcidsReplication::reverse(), bpp::AbstractReverseTransliterator::reverse(), bpp::SequenceTools::RNYslice(), bpp::SequenceWalker::SequenceWalker(), bpp::SequenceTools::subseq(), bpp::SequenceWithQualityTools::subseq(), bpp::SequenceTools::subtractHaplotype(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::CodonAlphabet::translate(), bpp::WordAlphabet::translate(), bpp::SymbolListTools::variabilityFactorial(), and bpp::SymbolListTools::variabilityShannon().

◆ size() [2/2]

size_t bpp::AbstractTemplateSymbolList< int >::size ( ) const
inlineoverridevirtualinherited

Get the number of elements in the list.

Returns
The number of sites in the list.

Implements bpp::CruxSymbolListInterface.

Definition at line 124 of file SymbolList.h.

◆ toString() [1/2]

virtual std::string bpp::CruxSymbolListInterface::toString ( ) const
pure virtualinherited

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::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, bpp::Sequence, bpp::ProbabilisticSymbolList, bpp::EventDrivenIntSymbolList, and bpp::IntSymbolList.

◆ toString() [2/2]

std::string bpp::IntSymbolList::toString ( ) const
inlineoverridevirtualinherited

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.

Reimplemented from bpp::AbstractTemplateSymbolList< int >.

Reimplemented in bpp::Sequence, and bpp::EventDrivenIntSymbolList.

Definition at line 179 of file IntSymbolList.h.

References bpp::AbstractTemplateSymbolList< int >::content_, bpp::StringSequenceTools::decodeSequence(), and bpp::AbstractTemplateSymbolList< int >::getAlphabet().

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

Member Data Documentation

◆ alphabet_

std::shared_ptr<const Alphabet> bpp::AbstractTemplateSymbolList< int >::alphabet_
privateinherited

The Alphabet attribute must be initialized in constructor and then can never be changed.

To apply another alphabet to a list you'll have to create a new list.

Definition at line 41 of file SymbolList.h.

◆ content_

std::vector<int > bpp::AbstractTemplateSymbolList< int >::content_
protectedinherited

The list content.

Definition at line 47 of file SymbolList.h.

◆ coordinate_

int bpp::AbstractCoreSite::coordinate_
privateinherited

The position associated with this site.

Definition at line 85 of file CoreSite.h.

Referenced by bpp::AbstractCoreSite::getCoordinate(), bpp::AbstractCoreSite::operator=(), and bpp::AbstractCoreSite::setCoordinate().


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