bpp-seq3  3.0.0
bpp::VectorSiteContainer Class Referenceabstract

The VectorSiteContainer class. More...

#include <Bpp/Seq/Container/VectorSiteContainer.h>

+ Inheritance diagram for bpp::VectorSiteContainer:
+ Collaboration diagram for bpp::VectorSiteContainer:

Public Member Functions

 VectorSiteContainer (const std::vector< const CruxSymbolListSite * > &vs, const Alphabet *alpha, bool checkPositions=true)
 Build a new container from a set of sites. More...
 
 VectorSiteContainer (const std::vector< const Site * > &vs, const Alphabet *alpha, bool checkPositions=true)
 
 VectorSiteContainer (size_t size, const Alphabet *alpha)
 Build a new empty container with specified size. More...
 
 VectorSiteContainer (const std::vector< std::string > &names, const Alphabet *alpha)
 Build a new empty container with specified sequence names. More...
 
 VectorSiteContainer (const Alphabet *alpha)
 Build a new empty container. More...
 
 VectorSiteContainer (const VectorSiteContainer &vsc)
 
 VectorSiteContainer (const SiteContainer &sc)
 
 VectorSiteContainer (const OrderedSequenceContainer &osc)
 
 VectorSiteContainer (const SequenceContainer &sc)
 
 VectorSiteContainer (const AlignedValuesContainer &avc)
 
VectorSiteContaineroperator= (const VectorSiteContainer &vsc)
 
VectorSiteContaineroperator= (const SiteContainer &sc)
 
VectorSiteContaineroperator= (const OrderedSequenceContainer &osc)
 
VectorSiteContaineroperator= (const SequenceContainer &sc)
 
virtual ~VectorSiteContainer ()
 
void addSequence (const Sequence &sequence, bool checkName=true)
 Add a sequence to the container. More...
 
void addSequence (const Sequence &sequence, size_t sequenceIndex, bool checkName=true)
 
void setSequence (const std::string &name, const Sequence &sequence, bool checkName)
 Replace a sequence in the container. More...
 
void setSequence (size_t sequenceIndex, const Sequence &sequence, bool checkName)
 Replace a sequence in the container. More...
 
std::string toString (const std::string &name) const
 Convert a particular sequence to a string. More...
 
const CommentsgetComments (const std::string &name) const
 Get comments of a particular sequence. More...
 
const CommentsgetComments () const
 Get the comments. More...
 
void setComments (const std::string &name, const Comments &comments)
 Set the comments of a particular sequence. More...
 
void setComments (const Comments &comments)
 Set the comments. More...
 
virtual const AlphabetgetAlphabet () const =0
 Get container's alphabet. More...
 
virtual double getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const=0
 get value of a state in a position More...
 
virtual const CommentsgetGeneralComments () const =0
 Get the comments of this container. More...
 
virtual void setGeneralComments (const Comments &comments)=0
 Set the comments of this container. More...
 
virtual void deleteGeneralComments ()=0
 Delete the comments associated to this container. More...
 
void clearComments ()
 
size_t getSize () const
 the size More...
 
bool isAvailablePosition (size_t objectIndex) const
 
void setSize (size_t size)
 
void nullify ()
 Nullify all elements. More...
 
size_t getSize () const
 Get the number of objects in the container. More...
 
void setSize (size_t size)
 
void changeName (const std::string &okey, const std::string &nkey)
 change the key of an object. More...
 
bool isAvailableName (std::string objectName) const
 Return if the name is in the map keys and the mapped object is nullptr or empty. More...
 
bool isAvailablePosition (size_t objectIndex) const
 
void nullify ()
 Nullify all elements. More...
 
The Clonable interface.
VectorSiteContainerclone () const
 
The SiteContainer interface implementation:
const SitegetSite (size_t siteIndex) const
 Get a site from the container. More...
 
const CruxSymbolListSitegetSymbolListSite (size_t siteIndex) const
 Get a CruxSymbolListSite from a given position. More...
 
SitegetSite (size_t siteIndex)
 
CruxSymbolListSitegetSymbolListSite (size_t siteIndex)
 
void setSite (size_t siteIndex, const Site &site, bool checkPosition=true)
 Set a site in the container. More...
 
std::shared_ptr< SiteremoveSite (size_t siteIndex)
 Remove a site from the container. More...
 
void deleteSite (size_t siteIndex)
 Delete a site from the container. More...
 
void addSite (const Site &site, bool checkPosition=true)
 Add a site in the container. More...
 
void addSite (const Site &site, int position, bool checkPosition=true)
 Add a site in the container. More...
 
void addSite (const Site &site, size_t siteIndex, bool checkPosition=true)
 Add a site in the container. More...
 
void addSite (const Site &site, size_t siteIndex, int position, bool checkPosition=true)
 Add a site in the container. More...
 
From AlignedValuesContainer interface
void deleteSites (size_t siteIndex, size_t length)
 Remove a continuous range of sites in the container. More...
 
size_t getNumberOfSites () const
 Get the number of aligned positions in the container. More...
 
void reindexSites ()
 Set all positions attributes. More...
 
Vint getSitePositions () const
 Get all position attributes of sites. More...
 
void setSitePositions (Vint vPositions)
 Set all position attributes of sites. More...
 
The SequenceContainer interface.
void setComments (size_t sequenceIndex, const Comments &comments)
 
const SequencegetSequence (size_t sequenceIndex) const
 Retrieve a sequence object from the container. More...
 
const SequencegetSequence (const std::string &name) const
 Retrieve a sequence object from the container. More...
 
bool hasSequence (const std::string &name) const
 Check if a sequence with a given name is present in the container. More...
 
size_t getSequencePosition (const std::string &name) const
 Get the position of a sequence in sequence container from its name. More...
 
std::shared_ptr< SequenceremoveSequence (size_t sequenceIndex)
 Extract (and remove) a sequence from the container. More...
 
std::shared_ptr< SequenceremoveSequence (const std::string &name)
 Extract (and remove) a sequence from the container. More...
 
size_t getNumberOfSequences () const
 Get the number of sequences in the container. More...
 
std::vector< std::string > getSequenceNames () const
 Get all the names of the sequences in the container. More...
 
void setSequenceNames (const std::vector< std::string > &names, bool checkNames=true)
 Set all sequence names. More...
 
void clear ()
 Delete all objects in the container. More...
 
VectorSiteContainercreateEmptyContainer () const
 Return a copy of this container, but with no data inside. More...
 
int & valueAt (const std::string &sequenceName, size_t elementIndex)
 Element access function. More...
 
const int & valueAt (const std::string &sequenceName, size_t elementIndex) const
 Element access function. More...
 
int & operator() (const std::string &sequenceName, size_t elementIndex)
 Element access operator. More...
 
const int & operator() (const std::string &sequenceName, size_t elementIndex) const
 Element access operator. More...
 
int & valueAt (size_t sequenceIndex, size_t elementIndex)
 Element access operator. More...
 
const int & valueAt (size_t sequenceIndex, size_t elementIndex) const
 Element access operator. More...
 
int & operator() (size_t sequenceIndex, size_t elementIndex)
 Element access operator. More...
 
const int & operator() (size_t sequenceIndex, size_t elementIndex) const
 Element access operator. More...
 
virtual void setComments (size_t sequenceIndex, const Comments &comments)=0
 
SequencedValuesContainer methods.
double getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const
 get value of a state in a position More...
 
double operator() (size_t siteIndex, const std::string &sequenceName, int state) const
 
OrderedValuesContainer methods.
double getStateValueAt (size_t siteIndex, size_t sequenceIndex, int state) const
 
double operator() (size_t siteIndex, size_t sequenceIndex, int state) const
 
From the OrderedSequenceContainer interface
virtual std::string toString (size_t sequenceIndex) const
 
virtual const CommentsgetComments (size_t sequenceIndex) const
 
virtual const std::string & getName (size_t sequenceIndex) const
 Get the name of a particular row of the alignement (aka sequence). More...
 
SequenceContainer methods.
virtual std::string toString (size_t sequenceIndex) const=0
 
virtual const CommentsgetComments (size_t sequenceIndex) const=0
 
virtual const SequencegetSequence (const std::string &name) const=0
 Retrieve a sequence object from the container. More...
 
virtual void setSequence (const std::string &name, const Sequence &sequence, bool checkName)=0
 Replace a sequence in the container. More...
 
virtual std::shared_ptr< SequenceremoveSequence (const std::string &name)=0
 Extract (and remove) a sequence from the container. More...
 
From the SequencedValuesContainer interface
const AlphabetgetAlphabet () const
 Get container's alphabet. More...
 
const CommentsgetGeneralComments () const
 Get the comments of this container. More...
 
void setGeneralComments (const Comments &comments)
 Set the comments of this container. More...
 
void deleteGeneralComments ()
 Delete the comments associated to this container. More...
 

Protected Member Functions

void realloc (size_t n)
 
const std::shared_ptr< SitegetObject (size_t objectIndex) const
 Retrieve an object from the container. Set as protected since they will be public under T specific names. More...
 
std::shared_ptr< SitegetObject (size_t objectIndex)
 
void addObject (std::shared_ptr< Site > object, size_t objectIndex, bool checkPosition=false)
 Add an object. More...
 
void insertObject (std::shared_ptr< Site > object, size_t objectIndex)
 Insert an object. More...
 
std::shared_ptr< SiteremoveObject (size_t objectIndex)
 Extract and remove a object from the container. More...
 
void deleteObject (size_t objectIndex)
 Delete an object from the container. More...
 
void deleteObjects (size_t objectIndex, size_t length)
 
void appendObject (std::shared_ptr< Site > object)
 
std::shared_ptr< SitegetObject_ (size_t objectIndex) const
 
void addObject_ (std::shared_ptr< Site > object, size_t objectIndex, bool checkPosition=false) const
 
size_t getNumberOfObjects () const
 
size_t getObjectPosition (const std::string &name) const
 Link between position & name. More...
 
std::string getObjectName (size_t objectIndex) const
 
const std::shared_ptr< SequencegetObject (size_t objectIndex) const
 Retrieve an object from the container. Set as protected since they will be public under T specific names. More...
 
std::shared_ptr< SequencegetObject (size_t objectIndex)
 
const std::shared_ptr< SequencegetObject (const std::string &name) const
 Get a object. More...
 
std::shared_ptr< SequencegetObject (const std::string &name)
 
bool hasObject (const std::string &name) const
 Check if a object with a given name is present in the container. More...
 
std::vector< std::string > getObjectNames () const
 
void setObjectNames (const std::vector< std::string > &names)
 
void setObjectName (size_t pos, const std::string &name)
 
void addObject (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name, bool check=false)
 
virtual void addObject (std::shared_ptr< T > object, size_t objectIndex, const std::string &name, bool check=false)=0
 
void addObject (std::shared_ptr< T > object, const std::string &name, bool checkName=false)
 Set a object. More...
 
void addObject (std::shared_ptr< T > object, size_t objectIndex, bool checkPosition=false)
 Add an object. More...
 
void insertObject (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name)
 
virtual void insertObject (std::shared_ptr< T > object, size_t objectIndex, const std::string &name)=0
 
void insertObject (std::shared_ptr< T > object, size_t objectIndex)
 Insert an object. More...
 
void appendObject (std::shared_ptr< Sequence > object, const std::string &name, bool check=true)
 
void appendObject (std::shared_ptr< T > object)
 
std::shared_ptr< SequenceremoveObject (size_t objectIndex)
 Extract and remove a object from the container. More...
 
std::shared_ptr< SequenceremoveObject (const std::string &name)
 Remove and returns a object. More...
 
void deleteObject (size_t objectIndex)
 Delete an object from the container. More...
 
void deleteObject (const std::string &name)
 Remove a object. More...
 
void addObject_ (std::shared_ptr< Sequence > object, size_t objectIndex, const std::string &name, bool check=false) const
 
void addObject_ (std::shared_ptr< T > object, const std::string &name, bool checkName=false) const
 
void addObject_ (std::shared_ptr< T > object, size_t objectIndex, bool checkPosition=false) const
 
void deleteObjects (size_t objectIndex, size_t length)
 
std::shared_ptr< T > getObject_ (size_t objectIndex) const
 

Protected Attributes

const Alphabetalphabet_
 The container's alphabet. More...
 
Comments comments_
 
std::vector< std::shared_ptr< Site > > positions_
 
std::vector< std::shared_ptr< T > > positions_
 

Private Attributes

std::vector< std::string > vNames_
 
std::map< std::string, size_t > mNames_
 
std::map< std::string, std::shared_ptr< T > > mObjects_
 

Detailed Description

The VectorSiteContainer class.

Sites are stored in a std::vector of pointers. Site access is hence in $O(1)$, and sequence access in $O(l)$, where $l$ is the number of sites in the container.

Sequences are built & stored on the fly, with a cache for time efficiency.

See VectorSequenceContainer for an alternative implementation.

See also
Sequence, Site, AlignedSequenceContainer

Definition at line 75 of file VectorSiteContainer.h.

Constructor & Destructor Documentation

◆ VectorSiteContainer() [1/10]

VectorSiteContainer::VectorSiteContainer ( const std::vector< const CruxSymbolListSite * > &  vs,
const Alphabet alpha,
bool  checkPositions = true 
)

Build a new container from a set of sites.

Parameters
vsA std::vector of sites.
alphaThe common alphabet for all sites.
checkPositionsCheck for the redundancy of site position tag. This may turn to be very time consuming!
Exceptions
ExceptionIf sites differ in size or in alphabet.

Class constructors:

Definition at line 53 of file VectorSiteContainer.cpp.

References addSite(), and bpp::TextTools::toString().

Referenced by clone(), and createEmptyContainer().

◆ VectorSiteContainer() [2/10]

VectorSiteContainer::VectorSiteContainer ( const std::vector< const Site * > &  vs,
const Alphabet alpha,
bool  checkPositions = true 
)

Definition at line 81 of file VectorSiteContainer.cpp.

References addSite(), and bpp::TextTools::toString().

◆ VectorSiteContainer() [3/10]

VectorSiteContainer::VectorSiteContainer ( size_t  size,
const Alphabet alpha 
)

Build a new empty container with specified size.

Parameters
sizeNumber of sequences in the container.
alphaThe alphabet for this container.

Definition at line 108 of file VectorSiteContainer.cpp.

References bpp::TextTools::toString().

◆ VectorSiteContainer() [4/10]

VectorSiteContainer::VectorSiteContainer ( const std::vector< std::string > &  names,
const Alphabet alpha 
)

Build a new empty container with specified sequence names.

Parameters
namesSequence names. This will set the number of sequences in the container.
alphaThe alphabet for this container.

Definition at line 121 of file VectorSiteContainer.cpp.

References bpp::VectorMappedContainer< T >::appendObject().

◆ VectorSiteContainer() [5/10]

VectorSiteContainer::VectorSiteContainer ( const Alphabet alpha)

Build a new empty container.

Parameters
alphaThe alphabet for this container.

Definition at line 134 of file VectorSiteContainer.cpp.

◆ VectorSiteContainer() [6/10]

VectorSiteContainer::VectorSiteContainer ( const VectorSiteContainer vsc)

Definition at line 142 of file VectorSiteContainer.cpp.

References addSite(), getNumberOfSites(), and getSite().

◆ VectorSiteContainer() [7/10]

◆ VectorSiteContainer() [8/10]

◆ VectorSiteContainer() [9/10]

VectorSiteContainer::VectorSiteContainer ( const SequenceContainer sc)

◆ VectorSiteContainer() [10/10]

◆ ~VectorSiteContainer()

virtual bpp::VectorSiteContainer::~VectorSiteContainer ( )
inlinevirtual

Definition at line 131 of file VectorSiteContainer.h.

References clear().

Member Function Documentation

◆ addObject() [1/5]

void bpp::VectorMappedContainer< Sequence >::addObject ( std::shared_ptr< T >  object,
size_t  objectIndex,
const std::string &  name,
bool  check = false 
)
inlineprotectedinherited

Definition at line 226 of file VectorMappedContainer.h.

◆ addObject() [2/5]

void bpp::VectorPositionedContainer< Site >::addObject ( std::shared_ptr< T >  object,
size_t  objectIndex,
bool  checkPosition = false 
)
inlineprotectedinherited

Add an object.

Parameters
objectThe object to add.
objectIndexThe new position of the object
checkPositionLook if the position is empty.

Definition at line 192 of file VectorPositionedContainer.h.

◆ addObject() [3/5]

template<class T >
void bpp::MappedNamedContainer< T >::addObject ( std::shared_ptr< T >  object,
const std::string &  name,
bool  checkName = false 
)
inlineprotectedinherited

Set a object.

Parameters
nameThe key of the object.
objectThe new object that will be associated to the key.
checkNameTell is the object name must be checked.

Definition at line 140 of file MappedNamedContainer.h.

References bpp::MappedNamedContainer< T >::hasObject(), and bpp::MappedNamedContainer< T >::mObjects_.

Referenced by bpp::VectorMappedContainer< T >::addObject(), bpp::VectorMappedContainer< T >::appendObject(), and bpp::VectorMappedContainer< T >::insertObject().

◆ addObject() [4/5]

template<class T >
void bpp::VectorPositionedContainer< T >::addObject ( std::shared_ptr< T >  object,
size_t  objectIndex,
bool  checkPosition = false 
)
inlineprotectedinherited

Add an object.

Parameters
objectThe object to add.
objectIndexThe new position of the object
checkPositionLook if the position is empty.

Definition at line 192 of file VectorPositionedContainer.h.

References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.

Referenced by bpp::VectorMappedContainer< T >::addObject(), bpp::AlignedSequenceContainer::getSite(), bpp::CompressedVectorSiteContainer::setSite(), and setSite().

◆ addObject() [5/5]

template<class T >
virtual void bpp::PositionedNamedContainer< T >::addObject ( std::shared_ptr< T >  object,
size_t  objectIndex,
const std::string &  name,
bool  check = false 
)
protectedpure virtualinherited

◆ addObject_() [1/4]

void bpp::VectorMappedContainer< Sequence >::addObject_ ( std::shared_ptr< T >  object,
size_t  objectIndex,
const std::string &  name,
bool  check = false 
) const
inlineprotectedinherited

Definition at line 298 of file VectorMappedContainer.h.

◆ addObject_() [2/4]

void bpp::VectorPositionedContainer< Site >::addObject_ ( std::shared_ptr< T >  object,
size_t  objectIndex,
bool  checkPosition = false 
) const
inlineprotectedinherited

Definition at line 258 of file VectorPositionedContainer.h.

◆ addObject_() [3/4]

template<class T >
void bpp::MappedNamedContainer< T >::addObject_ ( std::shared_ptr< T >  object,
const std::string &  name,
bool  checkName = false 
) const
inlineprotectedinherited

◆ addObject_() [4/4]

template<class T >
void bpp::VectorPositionedContainer< T >::addObject_ ( std::shared_ptr< T >  object,
size_t  objectIndex,
bool  checkPosition = false 
) const
inlineprotectedinherited

◆ addSequence() [1/2]

void VectorSiteContainer::addSequence ( const Sequence sequence,
bool  checkName = true 
)
virtual

Add a sequence to the container.

Parameters
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.
Exceptions
ExceptionAny other kind of exception, if the name of the sequence is already used, are whatever else depending on the implementation.

Implements bpp::SequenceContainer.

Definition at line 633 of file VectorSiteContainer.cpp.

References bpp::Site::addElement(), bpp::VectorMappedContainer< T >::appendObject(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), bpp::CoreSequence::getComments(), bpp::CoreSequence::getName(), getNumberOfSequences(), getNumberOfSites(), getSite(), bpp::CoreSymbolList< T >::getValue(), realloc(), bpp::CruxSymbolList::size(), and bpp::TextTools::toString().

Referenced by bpp::SequenceApplicationTools::getSiteContainer(), operator=(), and VectorSiteContainer().

◆ addSequence() [2/2]

◆ addSite() [1/4]

◆ addSite() [2/4]

void VectorSiteContainer::addSite ( const Site site,
int  position,
bool  checkPosition = true 
)
virtual

Add a site in the container.

Parameters
siteThe site to add.
positionThe new position of the site, to superseed the one in 'site'.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

Implements bpp::SiteContainer.

Definition at line 361 of file VectorSiteContainer.cpp.

References bpp::VectorPositionedContainer< T >::appendObject(), bpp::Site::clone(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), getNumberOfSequences(), getNumberOfSites(), bpp::AbstractCoreSite::getPosition(), getSite(), bpp::VectorPositionedContainer< T >::nullify(), bpp::CruxSymbolList::size(), and bpp::TextTools::toString().

◆ addSite() [3/4]

void VectorSiteContainer::addSite ( const Site site,
size_t  siteIndex,
bool  checkPosition = true 
)
virtual

Add a site in the container.

Parameters
siteThe site to add.
siteIndexThe position where to insert the site.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

Implements bpp::SiteContainer.

Definition at line 395 of file VectorSiteContainer.cpp.

References bpp::Site::clone(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), bpp::OrderedSequenceContainer::getComments(), getNumberOfSequences(), getNumberOfSites(), bpp::AbstractCoreSite::getPosition(), getSite(), bpp::VectorPositionedContainer< T >::insertObject(), bpp::CruxSymbolList::size(), and bpp::TextTools::toString().

◆ addSite() [4/4]

void VectorSiteContainer::addSite ( const Site site,
size_t  siteIndex,
int  position,
bool  checkPosition = true 
)
virtual

Add a site in the container.

Parameters
siteThe site to add.
siteIndexThe position where to insert the site.
positionThe new position of the site, to superseed the one in 'site'.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

Implements bpp::SiteContainer.

Definition at line 437 of file VectorSiteContainer.cpp.

References bpp::Site::clone(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), bpp::OrderedSequenceContainer::getComments(), getNumberOfSequences(), getNumberOfSites(), bpp::AbstractCoreSite::getPosition(), getSite(), bpp::VectorPositionedContainer< T >::insertObject(), bpp::CruxSymbolList::size(), and bpp::TextTools::toString().

◆ appendObject() [1/3]

void bpp::VectorMappedContainer< Sequence >::appendObject ( std::shared_ptr< T >  object,
const std::string &  name,
bool  check = true 
)
inlineprotectedinherited

Definition at line 250 of file VectorMappedContainer.h.

◆ appendObject() [2/3]

void bpp::VectorPositionedContainer< Site >::appendObject ( std::shared_ptr< T >  object)
inlineprotectedinherited

Definition at line 246 of file VectorPositionedContainer.h.

◆ appendObject() [3/3]

◆ changeName()

template<class T >
void bpp::MappedNamedContainer< T >::changeName ( const std::string &  okey,
const std::string &  nkey 
)
inlineinherited

change the key of an object.

Parameters
okeyThe present key of the object.
nkeyThe next key of the object.

Definition at line 199 of file MappedNamedContainer.h.

References bpp::MappedNamedContainer< T >::hasObject(), and bpp::MappedNamedContainer< T >::mObjects_.

Referenced by bpp::VectorMappedContainer< T >::setObjectName(), bpp::VectorMappedContainer< T >::setObjectNames(), bpp::VectorProbabilisticSiteContainer::setSequence(), and setSequence().

◆ clear()

void VectorSiteContainer::clear ( )
virtual

Delete all objects in the container.

Reimplemented from bpp::MappedNamedContainer< T >.

Definition at line 688 of file VectorSiteContainer.cpp.

References bpp::VectorMappedContainer< T >::clear(), and bpp::VectorPositionedContainer< T >::clear().

Referenced by operator=(), realloc(), and ~VectorSiteContainer().

◆ clearComments()

◆ clone()

VectorSiteContainer* bpp::VectorSiteContainer::clone ( ) const
inlinevirtual

Implements bpp::SiteContainer.

Definition at line 139 of file VectorSiteContainer.h.

References VectorSiteContainer().

◆ createEmptyContainer()

VectorSiteContainer * VectorSiteContainer::createEmptyContainer ( ) const
virtual

Return a copy of this container, but with no data inside.

This method creates a new SequencedValuesContainer objet. The class of this container depends on the derivative class.

Returns
A new empty container, with the same alphabet as this one.

Implements bpp::SequencedValuesContainer.

Definition at line 716 of file VectorSiteContainer.cpp.

References bpp::AbstractValuesContainer::getAlphabet(), bpp::AbstractValuesContainer::getGeneralComments(), bpp::AbstractValuesContainer::setGeneralComments(), and VectorSiteContainer().

◆ deleteGeneralComments() [1/2]

void bpp::AbstractValuesContainer::deleteGeneralComments ( )
inlinevirtualinherited

Delete the comments associated to this container.

Implements bpp::SequencedValuesContainer.

Definition at line 115 of file AbstractValuesContainer.h.

References bpp::Commentable::clearComments().

◆ deleteGeneralComments() [2/2]

virtual void bpp::SequencedValuesContainer::deleteGeneralComments ( )
pure virtualinherited

Delete the comments associated to this container.

Implemented in bpp::AbstractValuesContainer, and bpp::AbstractProbabilisticSequenceContainer.

◆ deleteObject() [1/3]

void bpp::VectorMappedContainer< Sequence >::deleteObject ( const std::string &  name)
inlineprotectedvirtualinherited

Remove a object.

Parameters
nameThe key of the object.

Reimplemented from bpp::MappedNamedContainer< T >.

Definition at line 293 of file VectorMappedContainer.h.

◆ deleteObject() [2/3]

void bpp::VectorMappedContainer< Sequence >::deleteObject ( size_t  objectIndex)
inlineprotectedvirtualinherited

Delete an object from the container.

Parameters
objectIndexThe index of the object in the container.

Reimplemented from bpp::VectorPositionedContainer< T >.

Definition at line 273 of file VectorMappedContainer.h.

◆ deleteObject() [3/3]

void bpp::VectorPositionedContainer< Site >::deleteObject ( size_t  objectIndex)
inlineprotectedvirtualinherited

Delete an object from the container.

Parameters
objectIndexThe index of the object in the container.

Implements bpp::PositionedContainer< T >.

Definition at line 230 of file VectorPositionedContainer.h.

◆ deleteObjects() [1/2]

void bpp::VectorPositionedContainer< Site >::deleteObjects ( size_t  objectIndex,
size_t  length 
)
inlineprotectedinherited

Definition at line 238 of file VectorPositionedContainer.h.

◆ deleteObjects() [2/2]

template<class T >
void bpp::VectorPositionedContainer< T >::deleteObjects ( size_t  objectIndex,
size_t  length 
)
inlineprotectedinherited

◆ deleteSite()

void bpp::VectorSiteContainer::deleteSite ( size_t  siteIndex)
inlinevirtual

Delete a site from the container.

The site is deleted (ie the container is shortened).

Parameters
siteIndexThe position of the site in the container.
Exceptions
IndexOutOfBoundsExceptionIf the specified site does not exists.

Implements bpp::SiteContainer.

Definition at line 174 of file VectorSiteContainer.h.

References bpp::VectorPositionedContainer< T >::deleteObject().

◆ deleteSites()

void bpp::VectorSiteContainer::deleteSites ( size_t  siteIndex,
size_t  length 
)
inlinevirtual

Remove a continuous range of sites in the container.

Parameters
siteIndexThe position of the first site in the container.
lengthThe length of the region to delete, starting at pposition siteIndex.
Exceptions
IndexOutOfBoundsExceptionIf the specified range is not valid.

Implements bpp::AlignedValuesContainer.

Definition at line 191 of file VectorSiteContainer.h.

References bpp::VectorPositionedContainer< T >::deleteObjects().

◆ getAlphabet() [1/2]

const Alphabet* bpp::AbstractValuesContainer::getAlphabet ( ) const
inlinevirtualinherited

Get container's alphabet.

Returns
The alphabet associated to this container.

Implements bpp::SequencedValuesContainer.

Definition at line 99 of file AbstractValuesContainer.h.

References bpp::AbstractValuesContainer::alphabet_.

Referenced by bpp::VectorProbabilisticSequenceContainer::addSequence(), bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::VectorSequenceContainer::addSequence(), addSequence(), bpp::CompressedVectorSiteContainer::addSite(), bpp::AlignedSequenceContainer::addSite(), addSite(), bpp::VectorProbabilisticSiteContainer::addSite(), bpp::Pasta::appendSequencesFromStream(), bpp::AlignedSequenceContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::createEmptyContainer(), bpp::VectorProbabilisticSequenceContainer::createEmptyContainer(), bpp::VectorProbabilisticSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), createEmptyContainer(), bpp::CompressedVectorSiteContainer::getSequence(), getSequence(), bpp::VectorProbabilisticSiteContainer::getSequence(), bpp::AlignedSequenceContainer::getSite(), bpp::CompressedVectorSiteContainer::getStateValueAt(), bpp::VectorProbabilisticSiteContainer::getStateValueAt(), getStateValueAt(), bpp::VectorProbabilisticSequenceContainer::getStateValueAt(), bpp::VectorSequenceContainer::getStateValueAt(), bpp::CompressedVectorSiteContainer::operator()(), bpp::VectorProbabilisticSiteContainer::operator()(), operator()(), bpp::VectorProbabilisticSequenceContainer::operator()(), bpp::VectorSequenceContainer::operator()(), bpp::VectorProbabilisticSiteContainer::realloc(), realloc(), bpp::CompressedVectorSiteContainer::removeSite(), bpp::CompressedVectorSiteContainer::setComments(), bpp::VectorProbabilisticSiteContainer::setSequence(), bpp::VectorProbabilisticSequenceContainer::setSequence(), setSequence(), bpp::VectorSequenceContainer::setSequence(), bpp::AlignedSequenceContainer::setSite(), bpp::CompressedVectorSiteContainer::setSite(), and setSite().

◆ getAlphabet() [2/2]

virtual const Alphabet* bpp::SequencedValuesContainer::getAlphabet ( ) const
pure virtualinherited

Get container's alphabet.

Returns
The alphabet associated to this container.

Implemented in bpp::AbstractValuesContainer.

Referenced by bpp::Clustal::appendAlignmentFromStream(), bpp::DCSE::appendAlignmentFromStream(), bpp::NexusIOSequence::appendAlignmentFromStream(), bpp::Fasta::appendSequencesFromStream(), bpp::GenBank::appendSequencesFromStream(), bpp::Mase::appendSequencesFromStream(), bpp::SiteContainerTools::changeGapsToUnknownCharacters(), bpp::SiteContainerTools::changeUnresolvedCharactersToGaps(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getCodonPosition(), bpp::SiteContainerTools::getCompleteSites(), bpp::SiteContainerTools::getConsensus(), bpp::SequenceContainerTools::getFrequencies(), bpp::SiteContainerTools::getSelectedPositions(), bpp::MaseTools::getSelectedSequences(), bpp::SiteContainerTools::getSelectedSites(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SiteContainerTools::getSitesWithoutGaps(), bpp::SequenceContainerTools::merge(), bpp::SiteContainerTools::merge(), bpp::AbstractSequenceContainer::operator=(), bpp::Phylip::readInterleaved(), bpp::Phylip::readSequential(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::SiteContainerTools::sampleSites(), bpp::Phylip::writeInterleaved(), and bpp::Phylip::writeSequential().

◆ getComments() [1/4]

◆ getComments() [2/4]

const Comments& bpp::AbstractSequenceContainer::getComments ( const std::string &  name) const
inlinevirtualinherited

Get comments of a particular sequence.

Parameters
nameThe name of the sequence.
Returns
The comments associated to sequence with name 'name'.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequencedValuesContainer.

Definition at line 111 of file AbstractSequenceContainer.h.

References bpp::CoreSequence::getComments(), and bpp::OrderedSequenceContainer::getSequence().

◆ getComments() [3/4]

virtual const Comments& bpp::AbstractSequenceContainer::getComments ( size_t  sequenceIndex) const
inlinevirtualinherited

◆ getComments() [4/4]

◆ getGeneralComments() [1/2]

const Comments& bpp::AbstractValuesContainer::getGeneralComments ( ) const
inlinevirtualinherited

◆ getGeneralComments() [2/2]

◆ getName()

virtual const std::string& bpp::AbstractSequenceContainer::getName ( size_t  sequenceIndex) const
inlinevirtualinherited

Get the name of a particular row of the alignement (aka sequence).

Parameters
sequenceIndexThe position of the sequence.
Returns
The name of the sequence at position 'sequenceIndex'.
Exceptions
IndexOutOfBoundsExceptionIf the position does not match any sequence in the container.

Implements bpp::OrderedValuesContainer.

Definition at line 127 of file AbstractSequenceContainer.h.

References bpp::CoreSequence::getName(), and bpp::OrderedSequenceContainer::getSequence().

Referenced by bpp::VectorSequenceContainer::getSequenceNames(), and bpp::VectorSequenceContainer::hasSequenceByName().

◆ getNumberOfObjects()

size_t bpp::VectorMappedContainer< Sequence >::getNumberOfObjects ( ) const
inlineprotectedinherited

Definition at line 144 of file VectorMappedContainer.h.

◆ getNumberOfSequences()

size_t bpp::VectorSiteContainer::getNumberOfSequences ( ) const
inlinevirtual

Get the number of sequences in the container.

Returns
The number of sequences in the container.

Implements bpp::SequencedValuesContainer.

Definition at line 255 of file VectorSiteContainer.h.

References bpp::VectorMappedContainer< T >::getNumberOfObjects().

Referenced by addSequence(), addSite(), getSequence(), bpp::SequenceApplicationTools::getSiteContainer(), getStateValueAt(), setSequence(), setSite(), and valueAt().

◆ getNumberOfSites()

size_t bpp::VectorSiteContainer::getNumberOfSites ( ) const
inlinevirtual

◆ getObject() [1/6]

std::shared_ptr<Sequence > bpp::VectorMappedContainer< Sequence >::getObject ( const std::string &  name)
inlineprotectedvirtualinherited

Reimplemented from bpp::MappedNamedContainer< T >.

Definition at line 188 of file VectorMappedContainer.h.

◆ getObject() [2/6]

const std::shared_ptr<Sequence > bpp::VectorMappedContainer< Sequence >::getObject ( const std::string &  name) const
inlineprotectedvirtualinherited

Get a object.

Parameters
nameThe key of the object to retrieve.
Returns
The object associated to the given key.

Reimplemented from bpp::MappedNamedContainer< T >.

Definition at line 183 of file VectorMappedContainer.h.

◆ getObject() [3/6]

std::shared_ptr<Sequence > bpp::VectorMappedContainer< Sequence >::getObject ( size_t  objectIndex)
inlineprotectedvirtualinherited

Reimplemented from bpp::VectorPositionedContainer< T >.

Definition at line 172 of file VectorMappedContainer.h.

◆ getObject() [4/6]

std::shared_ptr<Site > bpp::VectorPositionedContainer< Site >::getObject ( size_t  objectIndex)
inlineprotectedvirtualinherited

Implements bpp::PositionedContainer< T >.

Definition at line 177 of file VectorPositionedContainer.h.

◆ getObject() [5/6]

const std::shared_ptr<Sequence > bpp::VectorMappedContainer< Sequence >::getObject ( size_t  objectIndex) const
inlineprotectedvirtualinherited

Retrieve an object from the container. Set as protected since they will be public under T specific names.

Parameters
objectIndexThe position of the object.
Returns
A reference toward the Object object with corresponding name.

Reimplemented from bpp::VectorPositionedContainer< T >.

Definition at line 167 of file VectorMappedContainer.h.

◆ getObject() [6/6]

const std::shared_ptr<Site > bpp::VectorPositionedContainer< Site >::getObject ( size_t  objectIndex) const
inlineprotectedvirtualinherited

Retrieve an object from the container. Set as protected since they will be public under T specific names.

Parameters
objectIndexThe position of the object.
Returns
A reference toward the Object object with corresponding name.

Implements bpp::PositionedContainer< T >.

Definition at line 170 of file VectorPositionedContainer.h.

◆ getObject_() [1/2]

std::shared_ptr<Site > bpp::VectorPositionedContainer< Site >::getObject_ ( size_t  objectIndex) const
inlineprotectedinherited

Definition at line 251 of file VectorPositionedContainer.h.

◆ getObject_() [2/2]

template<class T >
std::shared_ptr<T> bpp::VectorPositionedContainer< T >::getObject_ ( size_t  objectIndex) const
inlineprotectedinherited

◆ getObjectName()

std::string bpp::VectorMappedContainer< Sequence >::getObjectName ( size_t  objectIndex) const
inlineprotectedvirtualinherited

Implements bpp::PositionedNamedContainer< T >.

Definition at line 158 of file VectorMappedContainer.h.

◆ getObjectNames()

std::vector<std::string> bpp::VectorMappedContainer< Sequence >::getObjectNames ( ) const
inlineprotectedvirtualinherited
Returns
All objects keys.

Reimplemented from bpp::MappedNamedContainer< T >.

Definition at line 198 of file VectorMappedContainer.h.

◆ getObjectPosition()

size_t bpp::VectorMappedContainer< Sequence >::getObjectPosition ( const std::string &  name) const
inlineprotectedvirtualinherited

Link between position & name.

Implements bpp::PositionedNamedContainer< T >.

Definition at line 149 of file VectorMappedContainer.h.

◆ getSequence() [1/3]

const Sequence & VectorSiteContainer::getSequence ( const std::string &  name) const
virtual

Retrieve a sequence object from the container.

Parameters
nameThe name of the sequence.
Returns
A reference toward the Sequence with corresponding name.

Implements bpp::SequenceContainer.

Definition at line 547 of file VectorSiteContainer.cpp.

References bpp::OrderedSequenceContainer::getSequence(), and getSequencePosition().

◆ getSequence() [2/3]

◆ getSequence() [3/3]

const Sequence & VectorSiteContainer::getSequence ( size_t  sequenceIndex) const
virtual

◆ getSequenceNames()

std::vector<std::string> bpp::VectorSiteContainer::getSequenceNames ( ) const
inlinevirtual

Get all the names of the sequences in the container.

Returns
A vector of strings with all sequence names.

Implements bpp::SequencedValuesContainer.

Definition at line 260 of file VectorSiteContainer.h.

References bpp::VectorMappedContainer< T >::getObjectNames().

Referenced by bpp::SequenceApplicationTools::getAlignedContainer().

◆ getSequencePosition()

size_t bpp::VectorSiteContainer::getSequencePosition ( const std::string &  name) const
inlinevirtual

Get the position of a sequence in sequence container from its name.

Parameters
nameThe name of the sequence.
Returns
The position of the sequence with name 'name', if it exists.
Exceptions
SequenceNotFoundExceptionIf no sequence with name 'name' could be found.

Implements bpp::OrderedValuesContainer.

Definition at line 245 of file VectorSiteContainer.h.

References bpp::VectorMappedContainer< T >::getObjectPosition().

Referenced by getSequence(), operator()(), removeSequence(), setSequence(), and valueAt().

◆ getSite() [1/2]

Site& bpp::VectorSiteContainer::getSite ( size_t  siteIndex)
inlinevirtual

◆ getSite() [2/2]

const Site& bpp::VectorSiteContainer::getSite ( size_t  siteIndex) const
inlinevirtual

Get a site from the container.

Parameters
siteIndexThe position of the site in the container.
Returns
A site objet corresponding to site i in the alignment.
Exceptions
IndexOutOfBoundsExceptionIf the specified site does not exists.

Implements bpp::SiteContainer.

Definition at line 147 of file VectorSiteContainer.h.

References bpp::VectorPositionedContainer< T >::getObject().

Referenced by addSequence(), addSite(), bpp::SiteContainerTools::getCompleteSites(), getSequence(), getSitePositions(), bpp::SiteContainerTools::getSitesWithoutGaps(), getSymbolListSite(), operator=(), reindexSites(), removeSequence(), bpp::SiteContainerTools::sampleSites(), setSequence(), setSite(), setSitePositions(), and VectorSiteContainer().

◆ getSitePositions()

Vint VectorSiteContainer::getSitePositions ( ) const
virtual

Get all position attributes of sites.

Returns
A vector with all site positions.

Implements bpp::AlignedValuesContainer.

Definition at line 493 of file VectorSiteContainer.cpp.

References getNumberOfSites(), bpp::AbstractCoreSite::getPosition(), and getSite().

◆ getSize() [1/2]

size_t bpp::VectorMappedContainer< Sequence >::getSize ( ) const
inlinevirtualinherited

Get the number of objects in the container.

Returns
The number of objects in the container.

Reimplemented from bpp::MappedNamedContainer< T >.

Definition at line 133 of file VectorMappedContainer.h.

◆ getSize() [2/2]

size_t bpp::VectorPositionedContainer< Site >::getSize ( ) const
inlinevirtualinherited

the size

Implements bpp::PositionedContainer< T >.

Definition at line 129 of file VectorPositionedContainer.h.

◆ getStateValueAt() [1/3]

double bpp::VectorSiteContainer::getStateValueAt ( size_t  siteIndex,
const std::string &  sequenceName,
int  state 
) const
inlinevirtual

get value of a state in a position

Parameters
siteIndexindex of the site
sequenceNamename of the sequence in the container
statestate in the alphabet

Implements bpp::SequencedValuesContainer.

Definition at line 324 of file VectorSiteContainer.h.

References bpp::AbstractValuesContainer::getAlphabet(), getNumberOfSites(), bpp::Alphabet::isResolvedIn(), and valueAt().

◆ getStateValueAt() [2/3]

virtual double bpp::SequencedValuesContainer::getStateValueAt
inherited

get value of a state in a position

Parameters
siteIndexindex of the site
sequenceNamename of the sequence in the container
statestate in the alphabet

◆ getStateValueAt() [3/3]

double bpp::VectorSiteContainer::getStateValueAt ( size_t  siteIndex,
size_t  sequenceIndex,
int  state 
) const
inlinevirtual

◆ getSymbolListSite() [1/2]

CruxSymbolListSite& bpp::VectorSiteContainer::getSymbolListSite ( size_t  siteIndex)
inlinevirtual

Implements bpp::SiteContainer.

Definition at line 162 of file VectorSiteContainer.h.

References getSite().

◆ getSymbolListSite() [2/2]

const CruxSymbolListSite& bpp::VectorSiteContainer::getSymbolListSite ( size_t  siteIndex) const
inlinevirtual

Get a CruxSymbolListSite from a given position.

Parameters
siteIndexThe position

Implements bpp::SiteContainer.

Definition at line 152 of file VectorSiteContainer.h.

References getSite().

◆ hasObject()

bool bpp::VectorMappedContainer< Sequence >::hasObject ( const std::string &  name) const
inlineprotectedvirtualinherited

Check if a object with a given name is present in the container.

Parameters
nameThe name of the object.
Returns
True if a object with the given name is present in the container.

Reimplemented from bpp::MappedNamedContainer< T >.

Definition at line 193 of file VectorMappedContainer.h.

◆ hasSequence()

bool bpp::VectorSiteContainer::hasSequence ( const std::string &  name) const
inlinevirtual

Check if a sequence with a given name is present in the container.

Parameters
nameThe name of the sequence.
Returns
True if a sequence with the given name is present in the container.

Implements bpp::SequencedValuesContainer.

Definition at line 235 of file VectorSiteContainer.h.

References bpp::VectorMappedContainer< T >::hasObject().

◆ insertObject() [1/4]

void bpp::VectorMappedContainer< Sequence >::insertObject ( std::shared_ptr< T >  object,
size_t  objectIndex,
const std::string &  name 
)
inlineprotectedinherited

Definition at line 235 of file VectorMappedContainer.h.

◆ insertObject() [2/4]

void bpp::VectorPositionedContainer< Site >::insertObject ( std::shared_ptr< T >  object,
size_t  objectIndex 
)
inlineprotectedinherited

Insert an object.

Parameters
objectThe object to add.
objectIndexThe new position of the object

Definition at line 209 of file VectorPositionedContainer.h.

◆ insertObject() [3/4]

template<class T >
void bpp::VectorPositionedContainer< T >::insertObject ( std::shared_ptr< T >  object,
size_t  objectIndex 
)
inlineprotectedinherited

Insert an object.

Parameters
objectThe object to add.
objectIndexThe new position of the object

Definition at line 209 of file VectorPositionedContainer.h.

References bpp::VectorPositionedContainer< T >::getSize(), and bpp::VectorPositionedContainer< T >::positions_.

Referenced by bpp::AlignedSequenceContainer::addSite(), addSite(), and bpp::VectorMappedContainer< T >::insertObject().

◆ insertObject() [4/4]

template<class T >
virtual void bpp::PositionedNamedContainer< T >::insertObject ( std::shared_ptr< T >  object,
size_t  objectIndex,
const std::string &  name 
)
protectedpure virtualinherited

◆ isAvailableName()

template<class T >
bool bpp::MappedNamedContainer< T >::isAvailableName ( std::string  objectName) const
inlineinherited

Return if the name is in the map keys and the mapped object is nullptr or empty.

Definition at line 228 of file MappedNamedContainer.h.

References bpp::MappedNamedContainer< T >::getObject(), and bpp::MappedNamedContainer< T >::hasObject().

Referenced by bpp::CompressedVectorSiteContainer::getSequence(), getSequence(), and bpp::VectorProbabilisticSiteContainer::getSequence().

◆ isAvailablePosition() [1/2]

bool bpp::VectorPositionedContainer< Site >::isAvailablePosition ( size_t  objectIndex) const
inlineinherited

Definition at line 134 of file VectorPositionedContainer.h.

◆ isAvailablePosition() [2/2]

template<class T >
bool bpp::VectorPositionedContainer< T >::isAvailablePosition ( size_t  objectIndex) const
inlineinherited

◆ nullify() [1/2]

void bpp::VectorPositionedContainer< Site >::nullify ( )
inlineinherited

Nullify all elements.

Definition at line 163 of file VectorPositionedContainer.h.

◆ nullify() [2/2]

◆ operator()() [1/6]

int& bpp::VectorSiteContainer::operator() ( const std::string &  sequenceName,
size_t  elementIndex 
)
inlinevirtual

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

Implements bpp::SequenceContainer.

Definition at line 286 of file VectorSiteContainer.h.

References getSequencePosition().

◆ operator()() [2/6]

const int& bpp::VectorSiteContainer::operator() ( const std::string &  sequenceName,
size_t  elementIndex 
) const
inlinevirtual

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

Implements bpp::SequenceContainer.

Definition at line 291 of file VectorSiteContainer.h.

References getSequencePosition().

◆ operator()() [3/6]

int& bpp::VectorSiteContainer::operator() ( size_t  sequenceIndex,
size_t  elementIndex 
)
inlinevirtual

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

Implements bpp::OrderedSequenceContainer.

Definition at line 310 of file VectorSiteContainer.h.

◆ operator()() [4/6]

const int& bpp::VectorSiteContainer::operator() ( size_t  sequenceIndex,
size_t  elementIndex 
) const
inlinevirtual

Element access operator.

Allows direct access to the data stored in the container. This method is faster then the valueAt function, but input parameters are not checked!

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

Implements bpp::OrderedSequenceContainer.

Definition at line 314 of file VectorSiteContainer.h.

◆ operator()() [5/6]

double bpp::VectorSiteContainer::operator() ( size_t  siteIndex,
const std::string &  sequenceName,
int  state 
) const
inlinevirtual

◆ operator()() [6/6]

double bpp::VectorSiteContainer::operator() ( size_t  siteIndex,
size_t  sequenceIndex,
int  state 
) const
inlinevirtual

◆ operator=() [1/4]

◆ operator=() [2/4]

◆ operator=() [3/4]

◆ operator=() [4/4]

◆ realloc()

void VectorSiteContainer::realloc ( size_t  n)
protected

◆ reindexSites()

void VectorSiteContainer::reindexSites ( )
virtual

◆ removeObject() [1/3]

std::shared_ptr<Sequence > bpp::VectorMappedContainer< Sequence >::removeObject ( const std::string &  name)
inlineprotectedvirtualinherited

Remove and returns a object.

Parameters
nameThe key of the object.
Returns
The object previously associated to the given key.

Reimplemented from bpp::MappedNamedContainer< T >.

Definition at line 288 of file VectorMappedContainer.h.

◆ removeObject() [2/3]

std::shared_ptr<Sequence > bpp::VectorMappedContainer< Sequence >::removeObject ( size_t  objectIndex)
inlineprotectedvirtualinherited

Extract and remove a object from the container.

Parameters
objectIndexThe position of the object.
Returns
A smart pointer toward the removed object.

Reimplemented from bpp::VectorPositionedContainer< T >.

Definition at line 259 of file VectorMappedContainer.h.

◆ removeObject() [3/3]

std::shared_ptr<Site > bpp::VectorPositionedContainer< Site >::removeObject ( size_t  objectIndex)
inlineprotectedvirtualinherited

Extract and remove a object from the container.

Parameters
objectIndexThe position of the object.
Returns
A smart pointer toward the removed object.

Implements bpp::PositionedContainer< T >.

Definition at line 218 of file VectorPositionedContainer.h.

◆ removeSequence() [1/3]

std::shared_ptr< Sequence > VectorSiteContainer::removeSequence ( const std::string &  name)
virtual

Extract (and remove) a sequence from the container.

Parameters
nameThe name of the sequence.

Implements bpp::SequenceContainer.

Definition at line 624 of file VectorSiteContainer.cpp.

References getSequencePosition(), and bpp::OrderedSequenceContainer::removeSequence().

◆ removeSequence() [2/3]

virtual std::shared_ptr<Sequence> bpp::SequenceContainer::removeSequence
inherited

Extract (and remove) a sequence from the container.

Parameters
nameThe name of the sequence.

Referenced by removeSequence(), bpp::VectorSequenceContainer::removeSequenceByKey(), and bpp::VectorSequenceContainer::removeSequenceByName().

◆ removeSequence() [3/3]

std::shared_ptr< Sequence > VectorSiteContainer::removeSequence ( size_t  sequenceIndex)
virtual

Extract (and remove) a sequence from the container.

Parameters
sequenceIndexThe position of the sequence.

Implements bpp::OrderedSequenceContainer.

Definition at line 612 of file VectorSiteContainer.cpp.

References bpp::CruxSymbolList::deleteElement(), getNumberOfSites(), bpp::OrderedSequenceContainer::getSequence(), getSite(), and bpp::VectorMappedContainer< T >::removeObject().

◆ removeSite()

std::shared_ptr<Site> bpp::VectorSiteContainer::removeSite ( size_t  siteIndex)
inlinevirtual

Remove a site from the container.

The site is deleted (ie the container is shortened) and a pointer toward it is returned.

Parameters
siteIndexThe position of the site in the container.
Returns
A pointer toward the given site in the alignment.
Exceptions
IndexOutOfBoundsExceptionIf the specified site does not exists.

Implements bpp::SiteContainer.

Definition at line 169 of file VectorSiteContainer.h.

References bpp::VectorPositionedContainer< T >::removeObject().

◆ setComments() [1/4]

◆ setComments() [2/4]

void bpp::AbstractSequenceContainer::setComments ( const std::string &  name,
const Comments comments 
)
inlinevirtualinherited

Set the comments of a particular sequence.

Parameters
nameThe name of the sequence.
commentsThe comments to set to sequence with name 'name'.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequencedValuesContainer.

Definition at line 116 of file AbstractSequenceContainer.h.

References bpp::OrderedValuesContainer::getSequencePosition(), and bpp::OrderedSequenceContainer::setComments().

◆ setComments() [3/4]

void VectorSiteContainer::setComments ( size_t  sequenceIndex,
const Comments comments 
)
virtual

◆ setComments() [4/4]

virtual void bpp::OrderedValuesContainer::setComments

◆ setGeneralComments() [1/2]

◆ setGeneralComments() [2/2]

virtual void bpp::SequencedValuesContainer::setGeneralComments ( const Comments comments)
pure virtualinherited

Set the comments of this container.

Parameters
commentsThe comments to be associated to this container.

Implemented in bpp::AbstractValuesContainer, and bpp::AbstractProbabilisticSequenceContainer.

Referenced by bpp::Clustal::appendAlignmentFromStream(), bpp::Fasta::appendSequencesFromStream(), and bpp::Mase::appendSequencesFromStream().

◆ setObjectName()

void bpp::VectorMappedContainer< Sequence >::setObjectName ( size_t  pos,
const std::string &  name 
)
inlineprotectedinherited

Definition at line 219 of file VectorMappedContainer.h.

◆ setObjectNames()

void bpp::VectorMappedContainer< Sequence >::setObjectNames ( const std::vector< std::string > &  names)
inlineprotectedinherited

Definition at line 203 of file VectorMappedContainer.h.

◆ setSequence() [1/3]

void VectorSiteContainer::setSequence ( const std::string &  name,
const Sequence sequence,
bool  checkName 
)
virtual

Replace a sequence in the container.

Parameters
nameThe name of the sequence.
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.

Implements bpp::SequenceContainer.

Definition at line 556 of file VectorSiteContainer.cpp.

References getSequencePosition(), and bpp::OrderedSequenceContainer::setSequence().

◆ setSequence() [2/3]

virtual void bpp::SequenceContainer::setSequence
inherited

Replace a sequence in the container.

Parameters
nameThe name of the sequence.
sequenceThe sequence to add.
checkNameTell if the container must check if the name of the sequence is already used in the container before adding it.

Referenced by setSequence(), bpp::VectorSequenceContainer::setSequence(), and bpp::AlignedSequenceContainer::setSequence().

◆ setSequence() [3/3]

void VectorSiteContainer::setSequence ( size_t  sequenceIndex,
const Sequence sequence,
bool  checkName 
)
virtual

◆ setSequenceNames()

void bpp::VectorSiteContainer::setSequenceNames ( const std::vector< std::string > &  names,
bool  checkNames = true 
)
inlinevirtual

Set all sequence names.

Parameters
namesA vector of strings with all sequence names. Its size must be strictly equal to the the size of the container (the number of sequences).
checkNamesTell if the container must check if the name of the sequence is already used in the container before adding it.
Exceptions
ExceptionIf there are redundant names in the input vector.

Implements bpp::SequencedValuesContainer.

Definition at line 265 of file VectorSiteContainer.h.

References bpp::VectorMappedContainer< T >::setObjectNames().

Referenced by bpp::SiteContainerTools::getSelectedSites(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), and bpp::SiteContainerTools::resolveDottedAlignment().

◆ setSite()

void VectorSiteContainer::setSite ( size_t  siteIndex,
const Site site,
bool  checkPosition = true 
)
virtual

Set a site in the container.

Parameters
siteIndexThe position of the site in the container.
siteThe site to set.
checkPositionLook if the position of the new site match a position attribute in the container.
Exceptions
ExceptionIf the specified site does not exists or is not correct.

Implements bpp::SiteContainer.

Definition at line 283 of file VectorSiteContainer.cpp.

References bpp::VectorPositionedContainer< T >::addObject(), bpp::Site::clone(), bpp::AbstractValuesContainer::getAlphabet(), bpp::CruxSymbolList::getAlphabet(), bpp::Alphabet::getAlphabetType(), bpp::OrderedSequenceContainer::getComments(), getNumberOfSequences(), getNumberOfSites(), bpp::AbstractCoreSite::getPosition(), getSite(), and bpp::CruxSymbolList::size().

◆ setSitePositions()

void VectorSiteContainer::setSitePositions ( Vint  vPositions)
virtual

Set all position attributes of sites.

Parameters
vPositionsA vector with all site positions.

Implements bpp::AlignedValuesContainer.

Definition at line 505 of file VectorSiteContainer.cpp.

References getNumberOfSites(), getSite(), and bpp::AbstractCoreSite::setPosition().

◆ setSize() [1/2]

void bpp::VectorPositionedContainer< Site >::setSize ( size_t  size)
inlinevirtualinherited

Reimplemented from bpp::PositionedContainer< T >.

Definition at line 139 of file VectorPositionedContainer.h.

◆ setSize() [2/2]

◆ toString() [1/3]

std::string bpp::AbstractSequenceContainer::toString ( const std::string &  name) const
inlinevirtualinherited

Convert a particular sequence to a string.

Parameters
nameThe name of the sequence.
Returns
A string describing the content of the sequence.
Exceptions
SequenceNotFoundExceptionIf the name does not match any sequence in the container.

Implements bpp::SequencedValuesContainer.

Definition at line 106 of file AbstractSequenceContainer.h.

References bpp::OrderedSequenceContainer::getSequence(), and bpp::CruxSymbolList::toString().

◆ toString() [2/3]

virtual std::string bpp::AbstractSequenceContainer::toString ( size_t  sequenceIndex) const
inlinevirtualinherited

◆ toString() [3/3]

virtual std::string bpp::OrderedValuesContainer::toString
inherited

◆ valueAt() [1/4]

int& bpp::VectorSiteContainer::valueAt ( const std::string &  sequenceName,
size_t  elementIndex 
)
inlinevirtual

Element access function.

Allows direct access to the data stored in the container.

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

Implements bpp::OrderedSequenceContainer.

Definition at line 274 of file VectorSiteContainer.h.

References getNumberOfSites(), and getSequencePosition().

Referenced by getStateValueAt(), and operator()().

◆ valueAt() [2/4]

const int& bpp::VectorSiteContainer::valueAt ( const std::string &  sequenceName,
size_t  elementIndex 
) const
inlinevirtual

Element access function.

Allows direct access to the data stored in the container.

Parameters
sequenceNameThe sequence name.
elementIndexThe element position within the sequence.

Implements bpp::OrderedSequenceContainer.

Definition at line 280 of file VectorSiteContainer.h.

References getNumberOfSites(), and getSequencePosition().

◆ valueAt() [3/4]

int& bpp::VectorSiteContainer::valueAt ( size_t  sequenceIndex,
size_t  elementIndex 
)
inlinevirtual

Element access operator.

Allows direct access to the data stored in the container.

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

Implements bpp::OrderedSequenceContainer.

Definition at line 296 of file VectorSiteContainer.h.

References getNumberOfSequences(), and getNumberOfSites().

◆ valueAt() [4/4]

const int& bpp::VectorSiteContainer::valueAt ( size_t  sequenceIndex,
size_t  elementIndex 
) const
inlinevirtual

Element access operator.

Allows direct access to the data stored in the container.

Parameters
sequenceIndexThe sequence position.
elementIndexThe element position within the sequence.

Implements bpp::OrderedSequenceContainer.

Definition at line 303 of file VectorSiteContainer.h.

References getNumberOfSequences(), and getNumberOfSites().

Member Data Documentation

◆ alphabet_

const Alphabet* bpp::AbstractValuesContainer::alphabet_
protectedinherited

◆ comments_

Comments bpp::Commentable::comments_
protectedinherited

◆ mNames_

std::map<std::string, size_t> bpp::VectorMappedContainer< Sequence >::mNames_
privateinherited

Definition at line 86 of file VectorMappedContainer.h.

◆ mObjects_

◆ positions_ [1/2]

std::vector< std::shared_ptr<Site > > bpp::VectorPositionedContainer< Site >::positions_
protectedinherited

Definition at line 73 of file VectorPositionedContainer.h.

◆ positions_ [2/2]

◆ vNames_

std::vector<std::string> bpp::VectorMappedContainer< Sequence >::vNames_
privateinherited

Definition at line 79 of file VectorMappedContainer.h.


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