bpp-seq3  3.0.0
SequenceData.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_SEQ_CONTAINER_SEQUENCEDATA_H
6 #define BPP_SEQ_CONTAINER_SEQUENCEDATA_H
7 
8 #include <Bpp/Clonable.h>
9 
10 #include "../Alphabet/Alphabet.h"
11 #include "../Commentable.h"
12 #include "../CoreSequence.h"
13 
14 // From the STL:
15 #include <string>
16 
17 namespace bpp
18 {
26 template<class HashType = std::string>
28  public virtual Clonable,
29  public virtual Commentable
30 {
31 public:
34 
36 
37 public:
43  virtual const Alphabet& alphabet() const = 0;
44 
50  virtual std::shared_ptr<const Alphabet> getAlphabet() const = 0;
51 
57  virtual size_t getNumberOfSequences() const = 0;
58 
62  virtual std::vector<HashType> getSequenceKeys() const = 0;
63 
67  virtual void setSequenceKeys(const std::vector<HashType>& sequenceKeys) = 0;
68 
76  virtual double getStateValueAt(size_t sitePosition, const HashType& sequenceKey, int state) const = 0;
77 
87  virtual double operator()(size_t sitePosition, const HashType& sequenceKey, int state) const = 0;
88 
96  virtual double getStateValueAt(size_t sitePosition, size_t sequencePosition, int state) const = 0;
97 
107  virtual double operator()(size_t sitePosition, size_t sequencePosition, int state) const = 0;
108 
112  virtual void clear() = 0;
113 
123 
130  virtual bool hasSequence(const HashType& sequenceKey) const = 0;
131 
132 
146  virtual const CoreSequenceInterface& sequence(const HashType& sequenceKey) const = 0;
147 
153  virtual void deleteSequence(const HashType& sequenceKey) = 0;
154 
169  virtual const CoreSequenceInterface& sequence(size_t sequencePosition) const = 0;
170 
176  virtual void deleteSequence(size_t sequencePosition) = 0;
177 
195  virtual const HashType& sequenceKey(size_t sequencePosition) const = 0;
196 
203  virtual size_t getSequencePosition(const HashType& sequenceKey) const = 0;
204 
216  virtual std::vector<std::string> getSequenceNames() const = 0;
217 
224  virtual void setSequenceNames(const std::vector<std::string>& names, bool updateKeys) = 0;
225 
229  virtual std::vector<Comments> getSequenceComments() const = 0;
231 };
232 
234 } // end of namespace bpp.
235 #endif // BPP_SEQ_CONTAINER_SEQUENCEDATA_H
The Alphabet interface.
Definition: Alphabet.h:99
The core sequence interface.
Definition: CoreSequence.h:28
The SequenceData interface.
Definition: SequenceData.h:30
virtual void deleteSequence(const HashType &sequenceKey)=0
Remove and delete a sequence from the container.
virtual std::vector< Comments > getSequenceComments() const =0
virtual bool hasSequence(const HashType &sequenceKey) const =0
Check if a certain key is associated to a sequence in the container.
virtual double getStateValueAt(size_t sitePosition, size_t sequencePosition, int state) const =0
Get value of a state at a given position.
virtual TemplateSequenceDataInterface< HashType > * createEmptyContainer() const =0
Return a copy of this container, but with no data inside.
virtual void setSequenceNames(const std::vector< std::string > &names, bool updateKeys)=0
Batch-set all sequence names.
virtual void clear()=0
Delete all data in the container.
virtual std::vector< std::string > getSequenceNames() const =0
virtual double operator()(size_t sitePosition, size_t sequencePosition, int state) const =0
Get the value of a state at a given position.
virtual size_t getNumberOfSequences() const =0
Get the number of sequences in the container.
virtual double operator()(size_t sitePosition, const HashType &sequenceKey, int state) const =0
Get the value of a state at a given position.
virtual const CoreSequenceInterface & sequence(size_t sequencePosition) const =0
Retrieve a sequence object from the container.
virtual const HashType & sequenceKey(size_t sequencePosition) const =0
Get the key associated to a given sequence.
virtual std::vector< HashType > getSequenceKeys() const =0
virtual double getStateValueAt(size_t sitePosition, const HashType &sequenceKey, int state) const =0
Get the value of a state at a given position.
virtual const CoreSequenceInterface & sequence(const HashType &sequenceKey) const =0
Retrieve a sequence object from the container.
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
Get a pointer toward the container's alphabet.
virtual void setSequenceKeys(const std::vector< HashType > &sequenceKeys)=0
Reset all sequence keys.
virtual void deleteSequence(size_t sequencePosition)=0
Remove and delete a sequence from the container.
virtual const Alphabet & alphabet() const =0
Get the container's alphabet.
TemplateSequenceDataInterface< HashType > * clone() const override=0
virtual size_t getSequencePosition(const HashType &sequenceKey) const =0
Get the position of a sequence with a given key in the container.
This alphabet is used to deal NumericAlphabet.