5 #ifndef BPP_SEQ_SEQUENCE_H
6 #define BPP_SEQ_SEQUENCE_H
57 virtual void setContent(
const std::string& sequence) = 0;
59 virtual void setContent(
const std::vector<std::string>& list)
override = 0;
61 virtual void setContent(
const std::vector<int>& list)
override = 0;
77 virtual void append(
const std::vector<int>& content) = 0;
85 virtual void append(
const std::vector<std::string>& content) = 0;
93 virtual void append(
const std::string& content) = 0;
147 const std::string& name,
148 const std::string& sequence,
149 std::shared_ptr<const Alphabet>& alpha) :
174 const std::string& name,
175 const std::string& sequence,
177 std::shared_ptr<const Alphabet>& alpha) :
198 const std::string& name,
199 const std::vector<std::string>& sequence,
200 std::shared_ptr<const Alphabet>& alpha) :
219 const std::string& name,
220 const std::vector<std::string>& sequence,
222 std::shared_ptr<const Alphabet>& alpha) :
237 const std::string& name,
238 const std::vector<int>& sequence,
239 std::shared_ptr<const Alphabet>& alpha) :
255 const std::string& name,
256 const std::vector<int>& sequence,
258 std::shared_ptr<const Alphabet>& alpha) :
327 void setContent(
const std::string& sequence)
override;
331 void setContent(
const std::vector<std::string>& list)
override
346 std::string
getChar(
size_t pos)
const override
357 void append(
const std::vector<int>& content)
override;
359 void append(
const std::vector<std::string>& content)
override;
361 void append(
const std::string& content)
override;
369 return getAlphabet()->isResolvedIn((*
this)[sitePosition], state) ? 1. : 0.;
A partial implementation of the CoreSequence interface.
AbstractCoreSequence & operator=(const AbstractCoreSequence &s)
A partial implementation of a SymbolList object.
virtual const std::vector< int > & getContent() const override
std::shared_ptr< const Alphabet > getAlphabet() const override
size_t size() const override
The core sequence interface.
The specific IntSymbolList interface.
virtual void setContent(const std::vector< T > &list)=0
Set the whole content of the list.
A basic IntSymbolList object.
void addElement(const T &c) override
IntSymbolList & operator=(const IntSymbolListInterface &list)
The generic assignment operator.
std::string getChar(size_t pos) const override
Get the element at position 'pos' as a character.
std::string toString() const override
Convert the list as a string.
virtual void append(const SequenceInterface &seq)=0
Append the content of the sequence.
virtual ~SequenceInterface()
virtual void setContent(const std::vector< std::string > &list) override=0
Set the whole content of the list.
virtual void append(const std::vector< int > &content)=0
Append the specified content to the sequence.
virtual void setContent(const std::vector< int > &list) override=0
SequenceInterface * clone() const override=0
virtual void append(const std::string &content)=0
Append the specified content to the sequence.
virtual void setContent(const std::string &sequence)=0
Set the whole content of the sequence.
virtual void append(const std::vector< std::string > &content)=0
Append the specified content to the sequence.
A basic implementation of the Sequence interface.
Sequence(const std::string &name, const std::vector< int > &sequence, const Comments &comments, std::shared_ptr< const Alphabet > &alpha)
General purpose constructor, can be used with any alphabet.
Sequence(const Sequence &s)
The Sequence copy constructor. This does not perform a hard copy of the alphabet object.
void setContent(const std::vector< int > &list) override
void setToSizeL(size_t newSize) override
Set up the size of a sequence from the left side.
std::string toString() const override
Convert the list as a string.
void setToSizeR(size_t newSize) override
Set up the size of a sequence from the right side.
void append(const SequenceInterface &seq) override
Append the content of the sequence.
Sequence(const SequenceInterface &s)
The Sequence generic copy constructor. This does not perform a hard copy of the alphabet object.
double getStateValueAt(size_t sitePosition, int state) const override
get value of a state at a position
Sequence & operator=(const SequenceInterface &s)
The Sequence generic assignment operator. This does not perform a hard copy of the alphabet object.
Sequence * clone() const override
void setContent(const std::vector< std::string > &list) override
Set the whole content of the list.
Sequence(const std::string &name, const std::string &sequence, const Comments &comments, std::shared_ptr< const Alphabet > &alpha)
Direct constructor: build a Sequence object from a std::string.
Sequence & operator=(const Sequence &s)
The Sequence assignment operator. This does not perform a hard copy of the alphabet object.
std::string getChar(size_t pos) const override
Get the element at position 'pos' as a character.
Sequence(const std::string &name, const std::string &sequence, std::shared_ptr< const Alphabet > &alpha)
Direct constructor: build a Sequence object from a std::string You can use it safely for RNA,...
Sequence(const std::string &name, const std::vector< int > &sequence, std::shared_ptr< const Alphabet > &alpha)
General purpose constructor, can be used with any alphabet.
Sequence(std::shared_ptr< const Alphabet > &alpha)
Empty constructor: build a void Sequence with just an Alphabet.
Sequence(const std::string &name, const std::vector< std::string > &sequence, const Comments &comments, std::shared_ptr< const Alphabet > &alpha)
General purpose constructor, can be used with any alphabet.
Sequence(const std::string &name, const std::vector< std::string > &sequence, std::shared_ptr< const Alphabet > &alpha)
General purpose constructor, can be used with any alphabet.
virtual const std::vector< T > & getContent() const =0
This alphabet is used to deal NumericAlphabet.
std::vector< std::string > Comments
Declaration of Comments type.