41 #ifndef _POLYMORPHISMSEQUENCECONTAINER_H_ 42 #define _POLYMORPHISMSEQUENCECONTAINER_H_ 47 #include <Bpp/Clonable.h> 48 #include <Bpp/Text/StringTokenizer.h> 49 #include <Bpp/Text/TextTools.h> 51 #include <Bpp/Seq/Container/VectorSiteContainer.h> 52 #include <Bpp/Seq/Container/SequenceContainerTools.h> 103 public VectorSiteContainer
162 Sequence*
removeSequence(
size_t index)
throw (IndexOutOfBoundsException);
169 Sequence*
removeSequence(
const std::string& name)
throw (SequenceNotFoundException);
176 void deleteSequence(
size_t index)
throw (IndexOutOfBoundsException);
183 void deleteSequence(
const std::string& name)
throw (SequenceNotFoundException);
192 void addSequenceWithFrequency(
const Sequence& sequence,
unsigned int frequency,
bool checkName =
true) throw (Exception);
193 void addSequenceWithFrequency(const Sequence& sequence,
size_t sequenceIndex,
unsigned int frequency,
bool checkName = true) throw (Exception);
194 void addSequence(const Sequence& sequence,
bool checkName = true) throw (Exception) {
197 void addSequence(
const Sequence& sequence,
size_t sequenceIndex,
bool checkName =
true) throw (Exception) {
211 size_t getGroupId(
size_t index)
const throw (IndexOutOfBoundsException);
218 size_t getGroupId(
const std::string& name)
const throw (SequenceNotFoundException);
230 void setGroupId(
size_t index,
size_t group_id)
throw (IndexOutOfBoundsException);
237 void setGroupId(
const std::string& name,
size_t group_id)
throw (SequenceNotFoundException);
249 bool isIngroupMember(
size_t index)
const throw (IndexOutOfBoundsException);
256 bool isIngroupMember(
const std::string& name)
const throw (SequenceNotFoundException);
300 void setSequenceCount(
const std::string& name,
unsigned int count)
throw (Exception);
330 void decrementSequenceCount(
const std::string& name)
throw (SequenceNotFoundException, BadIntegerException);
337 unsigned int getSequenceCount(
size_t index)
const throw (IndexOutOfBoundsException);
344 unsigned int getSequenceCount(
const std::string& name)
const throw (SequenceNotFoundException);
348 #endif // _POLYMORPHISMSEQUENCECONTAINER_H_ void setAsOutgroupMember(size_t index)
Set a sequence as outgroup member by index.
std::vector< size_t > group_
void clear()
Clear the container of all its sequences.
PolymorphismSequenceContainer * clone() const
Clone a PolymorphismSequenceContainer.
void incrementSequenceCount(size_t index)
Add 1 to the sequence count.
PolymorphismSequenceContainer(const Alphabet *alpha)
Build a new empty PolymorphismSequenceContainer.
size_t getGroupId(size_t index) const
Get the group identifier of the sequence.
std::vector< unsigned int > count_
void addSequence(const Sequence &sequence, size_t sequenceIndex, bool checkName=true)
bool isIngroupMember(size_t index) const
Tell if the sequence is ingroup by index.
PolymorphismSequenceContainer & operator=(const PolymorphismSequenceContainer &psc)
Operator= : copy operator.
unsigned int getSequenceCount(size_t index) const
Get the count of a sequence by index.
void addSequenceWithFrequency(const Sequence &sequence, unsigned int frequency, bool checkName=true)
Add a sequence to the container.
void setGroupId(size_t index, size_t group_id)
Set the group identifier of a sequence.
size_t getNumberOfGroups() const
Get the number of groups.
void deleteSequence(size_t index)
Delete a sequence by index.
void addSequence(const Sequence &sequence, bool checkName=true)
virtual ~PolymorphismSequenceContainer()
Destroy a PolymorphismSequenceContainer.
void decrementSequenceCount(size_t index)
Removz 1 to the sequence count.
void setAsIngroupMember(size_t index)
Set a sequence as ingroup member by index.
Sequence * removeSequence(size_t index)
Remove a sequence by index and return a pointer to this removed sequence.
std::vector< bool > ingroup_
void setSequenceCount(size_t index, unsigned int count)
Set the count of a sequence by index.
The PolymorphismSequenceContainer class.
std::set< size_t > getAllGroupsIds() const
Get all the groups identifiers.