bpp-seq
2.2.0
|
Aligned sequences container. More...
#include <Bpp/Seq/Container/AlignedSequenceContainer.h>
Public Member Functions | |
AlignedSequenceContainer (const Alphabet *alpha) | |
Build a new empty container with the specified alphabet. More... | |
AlignedSequenceContainer (const AlignedSequenceContainer &asc) | |
Copy constructor. More... | |
AlignedSequenceContainer (const SiteContainer &sc) | |
Convert any SiteContainer object into a AlignedSequenceContainer object. More... | |
AlignedSequenceContainer (const OrderedSequenceContainer &osc) throw (SequenceNotAlignedException) | |
Try to coerce an OrderedSequenceContainer object into an AlignedSequenceContainer object. More... | |
AlignedSequenceContainer & | operator= (const AlignedSequenceContainer &asc) |
AlignedSequenceContainer & | operator= (const SiteContainer &sc) |
AlignedSequenceContainer & | operator= (const OrderedSequenceContainer &osc) throw (SequenceNotAlignedException) |
virtual | ~AlignedSequenceContainer () |
The Clonable interface. | |
AlignedSequenceContainer * | clone () const |
The SiteContainer interface implementation: | |
const Site & | getSite (size_t siteIndex) const throw (IndexOutOfBoundsException) |
Get a site from the container. More... | |
void | setSite (size_t siteIndex, const Site &site, bool checkPosition=true) throw (Exception) |
Set a site in the container. More... | |
Site * | removeSite (size_t siteIndex) throw (IndexOutOfBoundsException) |
Remove a site from the container. More... | |
void | deleteSite (size_t siteIndex) throw (IndexOutOfBoundsException) |
Delete a site in the container. More... | |
void | deleteSites (size_t siteIndex, size_t length) throw (IndexOutOfBoundsException, Exception) |
Delete a continuous range of sites in the container. More... | |
void | addSite (const Site &site, bool checkPosition=true) throw (Exception) |
Add a site in the container. More... | |
void | addSite (const Site &site, int position, bool checkPosition=true) throw (Exception) |
Add a site in the container. More... | |
void | addSite (const Site &site, size_t siteIndex, bool checkPosition=true) throw (Exception) |
Add a site in the container. More... | |
void | addSite (const Site &site, size_t siteIndex, int position, bool checkPosition=true) throw (Exception) |
Add a site in the container. More... | |
size_t | getNumberOfSites () const |
Get the number of sites in the container. More... | |
Vint | getSitePositions () const |
Get all position attributes of sites. More... | |
void | reindexSites () |
Set all positions attributes. More... | |
void | clear () |
Delete all sequences in the container. More... | |
AlignedSequenceContainer * | createEmptyContainer () const |
Return a copy of this container, but with no sequence inside. More... | |
Redefinition of VectorSequenceContainer methods, to check for sequence lengths. | |
void | setSequence (const std::string &name, const Sequence &sequence, bool checkName=true) throw (Exception) |
Replace a sequence in the container. More... | |
void | setSequence (size_t sequenceIndex, const Sequence &sequence, bool checkName=true) throw (Exception) |
Replace a sequence in the container. More... | |
void | addSequence (const Sequence &sequence, bool checkName=true) throw (Exception) |
Add a sequence at the end of the container. More... | |
void | addSequence (const Sequence &sequence, size_t sequenceIndex, bool checkName=true) throw (Exception) |
Add a sequence to the container at a particular position. More... | |
The SequenceContainer interface. | |
bool | hasSequence (const std::string &name) const |
Check if a sequence with a given name is present in the container. More... | |
const Sequence & | getSequence (const std::string &name) const throw (SequenceNotFoundException) |
Retrieve a sequence object from the container. More... | |
Sequence * | removeSequence (const std::string &name) throw (SequenceNotFoundException) |
Extract (and remove) a sequence from the container. More... | |
void | deleteSequence (const std::string &name) throw (SequenceNotFoundException) |
Delete a sequence of the container. More... | |
size_t | getNumberOfSequences () const |
Get the number of sequences in the container. More... | |
std::vector< std::string > | getSequencesNames () const |
Get all the names of the sequences in the container. More... | |
void | setSequencesNames (const std::vector< std::string > &names, bool checkNames=true) throw (Exception) |
Set all sequence names. More... | |
int & | valueAt (const std::string &sequenceName, size_t elementIndex) throw (SequenceNotFoundException, IndexOutOfBoundsException) |
Element access function. More... | |
const int & | valueAt (const std::string &sequenceName, size_t elementIndex) const throw (SequenceNotFoundException, IndexOutOfBoundsException) |
Element access function. More... | |
int & | valueAt (size_t sequenceIndex, size_t elementIndex) throw (IndexOutOfBoundsException) |
Element access operator. More... | |
const int & | valueAt (size_t sequenceIndex, size_t elementIndex) const throw (IndexOutOfBoundsException) |
Element access operator. 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 & | 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... | |
The OrderedSequenceContainer interface. | |
const Sequence & | getSequence (size_t sequenceIndex) const throw (IndexOutOfBoundsException) |
Retrieve a sequence object from the container. More... | |
Sequence * | removeSequence (size_t sequenceIndex) throw (IndexOutOfBoundsException) |
Extract (and remove) a sequence from the container. More... | |
void | deleteSequence (size_t sequenceIndex) throw (IndexOutOfBoundsException) |
Delete a sequence of the container. More... | |
void | setComments (const std::string &name, const Comments &comments) throw (SequenceNotFoundException) |
Set the comments of a particular sequence. More... | |
void | setComments (size_t sequenceIndex, const Comments &comments) throw (IndexOutOfBoundsException) |
Set the comments of a particular sequence. More... | |
size_t | getSequencePosition (const std::string &name) const throw (SequenceNotFoundException) |
Get the position of a sequence in sequence container from its name. More... | |
From the SequenceContainer interface | |
const Alphabet * | getAlphabet () const |
Get sequence container's alphabet. More... | |
const std::vector< int > & | getContent (const std::string &name) const throw (SequenceNotFoundException) |
Get the content of a sequence. More... | |
std::string | toString (const std::string &name) const throw (SequenceNotFoundException) |
Convert a particular sequence to a string. More... | |
const Comments & | getComments (const std::string &name) const throw (SequenceNotFoundException) |
Get comments of a particular sequence. More... | |
const Comments & | getGeneralComments () 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... | |
From the OrderedSequenceContainer interface | |
virtual const std::vector< int > & | getContent (size_t sequenceIndex) const throw (IndexOutOfBoundsException) |
Get the content of a sequence. More... | |
virtual std::string | toString (size_t sequenceIndex) const throw (IndexOutOfBoundsException) |
Convert a particular sequence to a string. More... | |
virtual const Comments & | getComments (size_t sequenceIndex) const throw (IndexOutOfBoundsException) |
Get comments of a particular sequence. More... | |
virtual const std::string & | getName (size_t sequenceIndex) const throw (IndexOutOfBoundsException) |
Get the name of a particular sequence. More... | |
Protected Member Functions | |
bool | checkSize_ (const Sequence &sequence) |
Check sequence's size before insertion in sequence container. More... | |
AbstractSequenceContainer methods. | |
Sequence & | getSequence_ (size_t i) throw (IndexOutOfBoundsException) |
Sequence & | getSequence_ (const std::string &name) throw (SequenceNotFoundException) |
Private Attributes | |
std::vector< int > | positions_ |
size_t | length_ |
std::vector< Site * > | sites_ |
Aligned sequences container.
This class inherits from the VectorSequenceContainer and add site access. Sequence addition methods are re-defined to check for sequence lengths. Sequence access is in , and site access in
, where
is the number of sequences in the container.
See VectorSiteContainer for an alternative implementation.
Definition at line 68 of file AlignedSequenceContainer.h.
|
inline |
Build a new empty container with the specified alphabet.
alpha | The alphabet to use. |
Definition at line 95 of file AlignedSequenceContainer.h.
References reindexSites().
Referenced by clone().
|
inline |
Copy constructor.
asc | The container to copy. |
Definition at line 109 of file AlignedSequenceContainer.h.
|
inline |
Convert any SiteContainer object into a AlignedSequenceContainer object.
sc | The container to copy. |
Definition at line 121 of file AlignedSequenceContainer.h.
AlignedSequenceContainer::AlignedSequenceContainer | ( | const OrderedSequenceContainer & | osc | ) | |
throw | ( | SequenceNotAlignedException | |||
) |
Try to coerce an OrderedSequenceContainer object into an AlignedSequenceContainer object.
Sequences in osc will be considered alligned, and have the same number of sites.
osc | The ordered container to coerce. |
SequenceNotAlignedException | If sequences in osc do not have the same length. |
Definition at line 54 of file AlignedSequenceContainer.cpp.
|
virtual |
Class destructor:
Definition at line 121 of file AlignedSequenceContainer.cpp.
|
virtual |
Add a sequence at the end of the container.
The sequence is copied into the container. If checkNames is set to true, the method check if the name of the sequence is already used in the container, and sends an exception if it is the case. Otherwise, do not check the name: the method is hence faster, but use it at your own risks!
sequence | The sequence to add. |
checkName | Tell if the method must check the name of the sequence before adding it. |
Exception | If the sequence couldn't be added to the container. |
Reimplemented from bpp::VectorSequenceContainer.
Definition at line 474 of file AlignedSequenceContainer.cpp.
References bpp::VectorSequenceContainer::addSequence().
Referenced by bpp::SiteContainerTools::alignNW().
|
virtual |
Add a sequence to the container at a particular position.
The sequence is copied into the container. If checkName is set to true, the method check if the name of the sequence is already used in the container, and sends an exception if it is the case. Otherwise, do not check the name: the method is hence faster, but use it at your own risks!
sequence | The sequence to add. |
sequenceIndex | The position where to insert the new sequence. All the following sequences will be pushed. |
checkName | Tell if the method must check the name of the sequence before adding it. |
Exception | If the sequence couldn't be added to the container. |
Reimplemented from bpp::VectorSequenceContainer.
Definition at line 491 of file AlignedSequenceContainer.cpp.
References bpp::VectorSequenceContainer::addSequence().
|
virtual |
Add a site in the container.
site | The site to add. |
checkPosition | Look if the position of the new site match a position attribute in the container. |
Exception | If the specified site does not exists or is not correct. |
Implements bpp::SiteContainer.
Definition at line 271 of file AlignedSequenceContainer.cpp.
|
virtual |
Add a site in the container.
site | The site to add. |
position | The new position of the site, to superseed the one in 'site'. |
checkPosition | Look if the position of the new site match a position attribute in the container. |
Exception | If the specified site does not exists or is not correct. |
Implements bpp::SiteContainer.
Definition at line 312 of file AlignedSequenceContainer.cpp.
|
virtual |
Add a site in the container.
site | The site to add. |
siteIndex | The position where to insert the site. |
checkPosition | Look if the position of the new site match a position attribute in the container. |
Exception | If the specified site does not exists or is not correct. |
Implements bpp::SiteContainer.
Definition at line 352 of file AlignedSequenceContainer.cpp.
|
virtual |
Add a site in the container.
site | The site to add. |
siteIndex | The position where to insert the site. |
position | The new position of the site, to superseed the one in 'site'. |
checkPosition | Look if the position of the new site match a position attribute in the container. |
Exception | If the specified site does not exists or is not correct. |
Implements bpp::SiteContainer.
Definition at line 394 of file AlignedSequenceContainer.cpp.
|
inlineprotected |
Check sequence's size before insertion in sequence container.
sequence | The sequence to check. |
Definition at line 195 of file AlignedSequenceContainer.h.
References length_.
|
virtual |
Delete all sequences in the container.
Implements bpp::SequenceContainer.
Definition at line 506 of file AlignedSequenceContainer.cpp.
References bpp::VectorSequenceContainer::clear().
|
inlinevirtual |
Implements bpp::SiteContainer.
Definition at line 151 of file AlignedSequenceContainer.h.
References AlignedSequenceContainer().
|
virtual |
Return a copy of this container, but with no sequence inside.
This method creates a new SequenceContainer objet. The class of this container depends on the derivative class.
Implements bpp::SequenceContainer.
Definition at line 514 of file AlignedSequenceContainer.cpp.
References bpp::AbstractSequenceContainer::setGeneralComments().
|
inlinevirtualinherited |
Delete the comments associated to this container.
Implements bpp::SequenceContainer.
Definition at line 150 of file AbstractSequenceContainer.h.
References bpp::AbstractSequenceContainer::comments_.
|
inlinevirtualinherited |
Delete a sequence of the container.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 180 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequencePosition().
|
virtualinherited |
Delete a sequence of the container.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 272 of file VectorSequenceContainer.cpp.
|
virtual |
Delete a site in the container.
siteIndex | The position of the site in the container. |
IndexOutOfBoundsException | If the specified site does not exists. |
Implements bpp::SiteContainer.
Definition at line 220 of file AlignedSequenceContainer.cpp.
|
virtual |
Delete a continuous range of sites in the container.
siteIndex | The position of the first site in the container. |
length | The length of the region to delete, starting at pposition siteIndex. |
IndexOutOfBoundsException | If the specified range is not valid. |
Implements bpp::SiteContainer.
Definition at line 243 of file AlignedSequenceContainer.cpp.
|
inlinevirtualinherited |
Get sequence container's alphabet.
Implements bpp::SequenceContainer.
Definition at line 123 of file AbstractSequenceContainer.h.
References bpp::AbstractSequenceContainer::alphabet_.
Referenced by bpp::MapSequenceContainer::createEmptyContainer(), bpp::VectorSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::createEmptyContainer(), and bpp::VectorSiteContainer::realloc().
|
inlinevirtualinherited |
Get comments of a particular sequence.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 134 of file AbstractSequenceContainer.h.
References bpp::Sequence::getComments(), and bpp::OrderedSequenceContainer::getSequence().
Referenced by bpp::CompressedVectorSiteContainer::CompressedVectorSiteContainer(), bpp::VectorSiteContainer::operator=(), bpp::CompressedVectorSiteContainer::operator=(), and bpp::VectorSiteContainer::VectorSiteContainer().
|
inlinevirtualinherited |
Get comments of a particular sequence.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 177 of file AbstractSequenceContainer.h.
References bpp::Sequence::getComments(), and bpp::OrderedSequenceContainer::getSequence().
|
inlinevirtualinherited |
Get the content of a sequence.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 124 of file AbstractSequenceContainer.h.
References bpp::SymbolList::getContent(), and bpp::OrderedSequenceContainer::getSequence().
Referenced by bpp::SequenceContainerTools::getCodonPosition().
|
inlinevirtualinherited |
Get the content of a sequence.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 167 of file AbstractSequenceContainer.h.
References bpp::SymbolList::getContent(), and bpp::OrderedSequenceContainer::getSequence().
|
inlinevirtualinherited |
Get the comments of this container.
Implements bpp::SequenceContainer.
Definition at line 140 of file AbstractSequenceContainer.h.
References bpp::AbstractSequenceContainer::comments_.
Referenced by bpp::MapSequenceContainer::createEmptyContainer(), bpp::VectorSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), and bpp::CompressedVectorSiteContainer::createEmptyContainer().
|
inlinevirtualinherited |
Get the name of a particular sequence.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 162 of file AbstractSequenceContainer.h.
References bpp::Sequence::getName(), and bpp::OrderedSequenceContainer::getSequence().
Referenced by bpp::VectorSequenceContainer::getSequencesNames(), and bpp::VectorSequenceContainer::hasSequence().
|
inlinevirtualinherited |
Get the number of sequences in the container.
Implements bpp::OrderedSequenceContainer.
Definition at line 185 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::sequences_.
Referenced by bpp::VectorSequenceContainer::operator=(), and bpp::VectorSequenceContainer::VectorSequenceContainer().
|
inlinevirtual |
Get the number of sites in the container.
Implements bpp::SiteContainer.
Definition at line 168 of file AlignedSequenceContainer.h.
References length_.
Referenced by operator=().
|
virtualinherited |
Retrieve a sequence object from the container.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 181 of file VectorSequenceContainer.cpp.
Referenced by bpp::VectorSequenceContainer::operator()(), bpp::VectorSequenceContainer::operator=(), bpp::VectorSequenceContainer::valueAt(), and bpp::VectorSequenceContainer::VectorSequenceContainer().
|
virtualinherited |
Retrieve a sequence object from the container.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 158 of file VectorSequenceContainer.cpp.
|
protectedinherited |
Definition at line 194 of file VectorSequenceContainer.cpp.
Referenced by bpp::VectorSequenceContainer::operator()(), and bpp::VectorSequenceContainer::valueAt().
|
protectedinherited |
Definition at line 204 of file VectorSequenceContainer.cpp.
|
virtualinherited |
Get the position of a sequence in sequence container from its name.
name | The name of the sequence. |
SequenceNotFoundException | If no sequence with name 'name' could be found. |
Implements bpp::OrderedSequenceContainer.
Definition at line 217 of file VectorSequenceContainer.cpp.
Referenced by bpp::VectorSequenceContainer::deleteSequence(), bpp::VectorSequenceContainer::removeSequence(), and bpp::VectorSequenceContainer::setSequence().
|
virtualinherited |
Get all the names of the sequences in the container.
Implements bpp::OrderedSequenceContainer.
Definition at line 332 of file VectorSequenceContainer.cpp.
References bpp::AbstractSequenceContainer::getName(), and bpp::VectorSequenceContainer::sequences_.
|
virtual |
Get a site from the container.
siteIndex | The position of the site in the container. |
IndexOutOfBoundsException | If the specified site does not exists. |
Implements bpp::SiteContainer.
Definition at line 133 of file AlignedSequenceContainer.cpp.
|
inlinevirtual |
Get all position attributes of sites.
Implements bpp::SiteContainer.
Definition at line 169 of file AlignedSequenceContainer.h.
References positions_.
Referenced by operator=().
|
virtualinherited |
Check if a sequence with a given name is present in the container.
name | The name of the sequence. |
Implements bpp::SequenceContainer.
Definition at line 168 of file VectorSequenceContainer.cpp.
References bpp::AbstractSequenceContainer::getName(), and bpp::VectorSequenceContainer::sequences_.
|
inlinevirtualinherited |
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!
sequenceName | The sequence name. |
elementIndex | The element position within the sequence. |
Implements bpp::SequenceContainer.
Definition at line 202 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequence_().
|
inlinevirtualinherited |
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!
sequenceName | The sequence name. |
elementIndex | The element position within the sequence. |
Implements bpp::SequenceContainer.
Definition at line 207 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequence().
|
inlinevirtualinherited |
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!
sequenceIndex | The sequence position. |
elementIndex | The element position within the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 222 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequence_().
|
inlinevirtualinherited |
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!
sequenceIndex | The sequence position. |
elementIndex | The element position within the sequence. |
Implements bpp::OrderedSequenceContainer.
Definition at line 226 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequence().
AlignedSequenceContainer & AlignedSequenceContainer::operator= | ( | const AlignedSequenceContainer & | asc | ) |
Definition at line 79 of file AlignedSequenceContainer.cpp.
References getNumberOfSites(), getSitePositions(), and bpp::VectorSequenceContainer::operator=().
AlignedSequenceContainer & AlignedSequenceContainer::operator= | ( | const SiteContainer & | sc | ) |
Definition at line 93 of file AlignedSequenceContainer.cpp.
References bpp::SiteContainer::getNumberOfSites(), bpp::SiteContainer::getSitePositions(), and bpp::VectorSequenceContainer::operator=().
AlignedSequenceContainer & AlignedSequenceContainer::operator= | ( | const OrderedSequenceContainer & | osc | ) | |
throw | ( | SequenceNotAlignedException | |||
) |
Definition at line 107 of file AlignedSequenceContainer.cpp.
References bpp::VectorSequenceContainer::operator=().
|
virtual |
Set all positions attributes.
Implements bpp::SiteContainer.
Definition at line 435 of file AlignedSequenceContainer.cpp.
Referenced by AlignedSequenceContainer().
|
inlinevirtualinherited |
Extract (and remove) a sequence from the container.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 175 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequencePosition().
|
virtualinherited |
Extract (and remove) a sequence from the container.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 258 of file VectorSequenceContainer.cpp.
|
virtual |
Remove a site from the container.
The site is not deleted, a pointer toward it is returned.
siteIndex | The position of the site in the container. |
IndexOutOfBoundsException | If the specified site does not exists. |
Implements bpp::SiteContainer.
Definition at line 190 of file AlignedSequenceContainer.cpp.
References bpp::BasicSymbolList::deleteElement().
|
inlinevirtualinherited |
Set the comments of a particular sequence.
name | The name of the sequence. |
comments | The comments to set to sequence with name 'name'. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Reimplemented from bpp::AbstractSequenceContainer.
Definition at line 238 of file VectorSequenceContainer.h.
References bpp::AbstractSequenceContainer::setComments().
|
virtualinherited |
Set the comments of a particular sequence.
sequenceIndex | The position of the sequence. |
comments | The comments to set to sequence with position 'i'. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::AbstractSequenceContainer.
Definition at line 384 of file VectorSequenceContainer.cpp.
|
inlinevirtualinherited |
Set the comments of this container.
comments | The comments to be associated to this container. |
Implements bpp::SequenceContainer.
Definition at line 145 of file AbstractSequenceContainer.h.
References bpp::AbstractSequenceContainer::comments_.
Referenced by createEmptyContainer(), bpp::MapSequenceContainer::createEmptyContainer(), bpp::VectorSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::createEmptyContainer(), bpp::SiteContainerTools::getSelectedSites(), and bpp::VectorSequenceContainer::VectorSequenceContainer().
|
virtual |
Replace a sequence in the container.
name | The name of the sequence. |
sequence | The sequence to add. |
checkName | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Exception | Any other kind of exception, if the name of the sequence is already used, are whatever else depending on the implementation. |
Implements bpp::OrderedSequenceContainer.
Definition at line 461 of file AlignedSequenceContainer.cpp.
References bpp::VectorSequenceContainer::setSequence().
|
virtual |
Replace a sequence in the container.
sequenceIndex | The position of the sequence. |
sequence | The sequence to add. |
checkName | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Exception | Any other kind of exception. |
Implements bpp::OrderedSequenceContainer.
Definition at line 446 of file AlignedSequenceContainer.cpp.
References bpp::VectorSequenceContainer::setSequence().
|
virtualinherited |
Set all sequence names.
names | A vector of strings with all sequence names. Its size must be strictly equal to the the size of the container (the number of sequences). |
checkNames | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
Exception | If there are redundant names in the input vector. |
Implements bpp::OrderedSequenceContainer.
Definition at line 344 of file VectorSequenceContainer.cpp.
|
virtual |
Set a site in the container.
siteIndex | The position of the site in the container. |
site | The site to set. |
checkPosition | Look if the position of the new site match a position attribute in the container. |
Exception | If the specified site does not exists or is not correct. |
Implements bpp::SiteContainer.
Definition at line 154 of file AlignedSequenceContainer.cpp.
|
inlinevirtualinherited |
Convert a particular sequence to a string.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 129 of file AbstractSequenceContainer.h.
References bpp::OrderedSequenceContainer::getSequence(), and bpp::SymbolList::toString().
|
inlinevirtualinherited |
Convert a particular sequence to a string.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::OrderedSequenceContainer.
Definition at line 172 of file AbstractSequenceContainer.h.
References bpp::OrderedSequenceContainer::getSequence(), and bpp::SymbolList::toString().
|
inlinevirtualinherited |
Element access function.
Allows direct access to the data stored in the container.
sequenceName | The sequence name. |
elementIndex | The element position within the sequence. |
SequenceNotFoundException | If no corresponding sequence is found in the container. |
IndexOutOfBoundsException | If the element position is not valid. |
Implements bpp::OrderedSequenceContainer.
Definition at line 192 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequence_().
|
inlinevirtualinherited |
Element access function.
Allows direct access to the data stored in the container.
sequenceName | The sequence name. |
elementIndex | The element position within the sequence. |
SequenceNotFoundException | If no corresponding sequence is found in the container. |
IndexOutOfBoundsException | If the element position is not valid. |
Implements bpp::OrderedSequenceContainer.
Definition at line 197 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequence().
|
inlinevirtualinherited |
Element access operator.
Allows direct access to the data stored in the container.
sequenceIndex | The sequence position. |
elementIndex | The element position within the sequence. |
IndexOutOfBoundsException | If a position is not valid. |
Implements bpp::OrderedSequenceContainer.
Definition at line 212 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequence_().
|
inlinevirtualinherited |
Element access operator.
Allows direct access to the data stored in the container.
sequenceIndex | The sequence position. |
elementIndex | The element position within the sequence. |
IndexOutOfBoundsException | If a position is not valid. |
Implements bpp::OrderedSequenceContainer.
Definition at line 217 of file VectorSequenceContainer.h.
References bpp::VectorSequenceContainer::getSequence().
|
private |
Definition at line 76 of file AlignedSequenceContainer.h.
Referenced by checkSize_(), and getNumberOfSites().
|
private |
Definition at line 74 of file AlignedSequenceContainer.h.
Referenced by getSitePositions().
|
mutableprivate |
This is used in order to implement the SiteContainer interface. A SiteContainer is expected to work on Site objects, but this class – since it is a VectorSequenceContainer – has its data sored as Sequence object. When the SiteContainer method getSite() is invoked it creates a new Site object and send the address of it. To avoid memory leaks, this object is put into a std::vector so that it can be destroyed when the container is destroyed.
Definition at line 87 of file AlignedSequenceContainer.h.