39 #ifndef _POLYMORPHYSMMULTIGCONTAINER_H_ 40 #define _POLYMORPHYSMMULTIGCONTAINER_H_ 43 #include <Bpp/Clonable.h> 44 #include <Bpp/Exceptions.h> 45 #include <Bpp/Utils/MapTools.h> 46 #include <Bpp/Text/TextTools.h> 140 size_t getGroupId(
size_t position) const throw (IndexOutOfBoundsException);
147 void setGroupId(
size_t position,
size_t group_id) throw (IndexOutOfBoundsException);
206 #endif // _POLYMORPHYSMMULTIGCONTAINER_H_ void setGroupId(size_t position, size_t group_id)
Set the Group id of a MultilocusGenotype.
std::vector< MultilocusGenotype * > multilocusGenotypes_
size_t getNumberOfGroups() const
Get the number of groups.
MultilocusGenotype * removeMultilocusGenotype(size_t position)
Remove a MultilocusGenotype.
The GroupNotFoundException class.
PolymorphismMultiGContainer & operator=(const PolymorphismMultiGContainer &pmgc)
The assignation operator=.
std::set< size_t > getAllGroupsIds() const
Get the groups' ids.
std::map< size_t, std::string > groups_names_
bool isAligned() const
Tell if the MultilocusGenotypes are aligned (i.e. same size).
PolymorphismMultiGContainer()
Build a new PolymorphismMultilocusGenotypeContainer.
The MultilocusGenotype class.
~PolymorphismMultiGContainer()
Destroy a PolymorphismMultilocusGenotypeContainer.
std::vector< size_t > groups_
size_t getGroupId(size_t position) const
Get the Group id of a MultilocusGenotype.
void deleteMultilocusGenotype(size_t position)
Delete a MultilocusGenotype.
std::vector< std::string > getAllGroupsNames() const
Get the groups names or ids if not available.
void clear()
Clear the container.
size_t getLocusGroupSize(size_t group, size_t locus_position) const
Get the size of a group for a given locus.
void addMultilocusGenotype(const MultilocusGenotype &mg, size_t group)
Add a MultilocusGenotype to the container.
size_t getGroupSize(size_t group) const
Get group size.
The PolymorphismMultiGContainer class.
const MultilocusGenotype * getMultilocusGenotype(size_t position) const
Get a MultilocusGenotype at a position.
void setGroupName(size_t group_id, std::string name)
Set the name for the given group id.
std::string getGroupName(size_t group_id) const
Get the group name for a given group id or just the id if not available juste return it's id...
size_t size() const
Get the number of MultilocusGenotype.
void addGroupName(size_t group_id, std::string name)
Inserts a name for the given group id.
bool groupExists(size_t group) const
Tell if a group exists.
size_t getNumberOfLoci() const
Get the number of loci if the MultilocusGenotypes are aligned.