5 #ifndef BPP_SEQ_CONTAINER_COMPRESSEDVECTORSITECONTAINER_H
6 #define BPP_SEQ_CONTAINER_COMPRESSEDVECTORSITECONTAINER_H
61 std::vector< std::unique_ptr<Site>>& vs,
62 std::shared_ptr<const Alphabet>&
alphabet);
72 std::shared_ptr<const Alphabet>&
alphabet);
81 const std::vector<std::string>& names,
82 std::shared_ptr<const Alphabet>&
alphabet);
116 const Site&
site(
size_t sitePosition)
const override
121 void setSite(
size_t sitePosition, std::unique_ptr<Site>&
site,
bool checkCoordinate =
true)
override;
123 std::unique_ptr<Site>
removeSite(
size_t sitePosition)
override;
125 void deleteSite(
size_t sitePosition)
override;
127 void addSite(std::unique_ptr<Site>&
site,
bool checkCoordinate =
false)
override;
129 void addSite(std::unique_ptr<Site>&
site,
size_t sitePosition,
bool checkCoordinate =
false)
override;
131 void deleteSites(
size_t sitePosition,
size_t length)
override;
221 const std::string&
sequenceKey(
size_t sequencePosition)
const override
308 const int&
valueAt(
size_t sequencePosition,
size_t sitePosition)
const override
310 return site(sitePosition)[sequencePosition];
313 int&
valueAt(
size_t sequencePosition,
size_t sitePosition)
override
334 double getStateValueAt(
size_t sitePosition,
size_t sequencePosition,
int state)
const override
339 double operator()(
size_t sitePosition,
size_t sequencePosition,
int state)
const override
Partial implementation of the SequenceContainer interface.
const Alphabet & alphabet() const override
std::shared_ptr< const Alphabet > getAlphabet() const override
A low memory, yet restricted, version of the VectorSiteContainer class.
std::vector< size_t > index_
const int & valueAt(const std::string &sequenceKey, size_t sitePosition) const override
size_t getNumberOfSites() const override
Get the number of aligned positions in the container.
std::vector< std::string > getSequenceKeys() const override
std::vector< std::string > sequenceNames_
int & valueAt(size_t sequencePosition, size_t sitePosition) override
Get the content of the dataset at a specific position (sequence position, site position).
std::unique_ptr< Site > removeSite(size_t sitePosition) override
Remove a site from the container.
size_t getNumberOfUniqueSites() const
size_t getNumberOfSequences() const override
Get the number of sequences in the container.
void deleteSequence(size_t sequencePosition) override
Remove and delete a sequence from the container.
const std::string & sequenceKey(size_t sequencePosition) const override
Get the key associated to a given sequence.
void setSequence(size_t sequencePosition, std::unique_ptr< Sequence > &sequence, const std::string &sequenceKey) override
void setSequenceNames(const std::vector< std::string > &names, bool updateKeys) override
Batch-set all sequence names.
const Site & site(size_t sitePosition) const override
Get a site from the container.
size_t getSiteIndex_(const Site &site)
void setSiteCoordinates(const Vint &coordinates) override
Set all coordinates of sites.
void reindexSites() override
Set all coordinate attributes.
VectorMappedContainer< Sequence > sequenceContainer_
const Sequence & sequence(size_t sequenceIndex) const override
Retrieve a sequence object from the container.
CompressedVectorSiteContainer(std::vector< std::unique_ptr< Site >> &vs, std::shared_ptr< const Alphabet > &alphabet)
Build a new container from a set of sites.
void setSequenceKeys(const std::vector< std::string > &sequenceKeys) override
Reset all sequence keys.
std::unique_ptr< Sequence > removeSequence(size_t sequencePosition) override
Remove a sequence from the container.
Site & getSite_(size_t sitePosition)
Vint getSiteCoordinates() const override
Get all coordinates of sites.
std::vector< Comments > sequenceComments_
std::unique_ptr< Sequence > removeSequence(const std::string &sequenceKey) override
int & valueAt(const std::string &sequenceKey, size_t sitePosition) override
std::vector< Comments > getSequenceComments() const override
void deleteSequence(const std::string &sequenceKey) override
Remove and delete a sequence from the container.
virtual ~CompressedVectorSiteContainer()
void clear() override
Delete all data in the container.
VectorPositionedContainer< Site > siteContainer_
bool hasSequence(const std::string &name) const override
Check if a certain key is associated to a sequence in the container.
void insertSequence(size_t sequencePosition, std::unique_ptr< Sequence > &sequence, const std::string &sequenceKey) override
size_t getSequencePosition(const std::string &sequenceKey) const override
Get the position of a sequence with a given key in the container.
std::vector< std::string > getSequenceNames() const override
const int & valueAt(size_t sequencePosition, size_t sitePosition) const override
Get the content of the dataset at a specific position (sequence position, site position).
double operator()(size_t sitePosition, const std::string &sequenceKey, int state) const override
Get the value of a state at a given position.
CompressedVectorSiteContainer * clone() const override
void setSequence(size_t sequencePosition, std::unique_ptr< Sequence > &sequence) override
CompressedVectorSiteContainer & operator=(const CompressedVectorSiteContainer &vsc)
const Sequence & sequence(const std::string &sequenceKey) const override
Retrieve a sequence object from the container.
void addSite(std::unique_ptr< Site > &site, bool checkCoordinate=false) override
Add a site in the container.
double getStateValueAt(size_t sitePosition, size_t sequencePosition, int state) const override
Get value of a state at a given position.
void deleteSites(size_t sitePosition, size_t length) override
Remove a continuous range of sites in the container.
void deleteSite(size_t sitePosition) override
Delete a site from the container.
void setSite(size_t sitePosition, std::unique_ptr< Site > &site, bool checkCoordinate=true) override
Set a site in the container.
double operator()(size_t sitePosition, size_t sequencePosition, int state) const override
Get the value of a state at a given position.
CompressedVectorSiteContainer * createEmptyContainer() const override
Return a copy of this container, but with no data inside.
void setSequence(const std::string &sequenceKey, std::unique_ptr< Sequence > &sequence) override
void addSequence(const std::string &sequenceKey, std::unique_ptr< Sequence > &sequence) override
double getStateValueAt(size_t sitePosition, const std::string &sequenceKey, int state) const override
Get the value of a state at a given position.
A basic implementation of the Sequence interface.
double getStateValueAt(size_t sequencePosition, int state) const
get value of a state at a position
The SiteContainer interface.
The template VectorMappedContainer class.
The template VectorPositionedContainer class.
This alphabet is used to deal NumericAlphabet.