13 multilocusGenotypes_(pmgc.size()),
17 for (
size_t i = 0; i < pmgc.
size(); ++i)
34 for (
size_t i = 0; i < pmgc.
size(); ++i)
66 if (position >=
size())
75 if (position >=
size())
87 if (position >=
size())
98 for (
size_t i = 0; i <
size(); i++)
113 throw Exception(
"MultilocusGenotypes are not aligned.");
123 if (position >=
size())
132 if (position >=
size())
141 set<size_t> groups_ids;
142 for (
size_t i = 0; i <
size(); i++)
153 vector<string> grpsNames;
156 string name = it.second;
158 grpsNames.push_back(name);
227 for (
size_t i = 0; i <
size(); ++i)
The GroupNotFoundException class.
std::size_t getBadIndex() const
const std::array< std::size_t, 2 > & getBounds() const
The MultilocusGenotype class.
MultilocusGenotype * clone() const override
The PolymorphismMultiGContainer class.
void addMultilocusGenotype(std::unique_ptr< MultilocusGenotype > &mg, size_t group)
Add a MultilocusGenotype to the container.
void clear()
Clear the container.
void deleteMultilocusGenotype(size_t position)
Delete a MultilocusGenotype.
size_t getGroupId(size_t position) const
Get the Group id of a MultilocusGenotype.
std::map< size_t, std::string > groupsNames_
void setGroupName(size_t groupId, const std::string &name)
Set the name for the given group id.
PolymorphismMultiGContainer & operator=(const PolymorphismMultiGContainer &pmgc)
The assignation operator=.
bool groupExists(size_t group) const
Tell if a group exists.
PolymorphismMultiGContainer()
Build a new PolymorphismMultilocusGenotypeContainer.
size_t getLocusGroupSize(size_t group, size_t locusPosition) const
Get the size of a group for a given locus.
size_t getNumberOfLoci() const
Get the number of loci if the MultilocusGenotypes are aligned.
const MultilocusGenotype & multilocusGenotype(size_t position) const
Get a MultilocusGenotype at a position.
std::vector< std::string > getAllGroupsNames() const
Get the groups names or ids if not available.
std::vector< size_t > groups_
void addGroupName(size_t groupId, const std::string &name)
Inserts a name for the given group id.
std::string getGroupName(size_t groupId) const
Get the group name for a given group id or just the id if not available juste return it's id.
std::set< size_t > getAllGroupsIds() const
Get the groups' ids.
bool isAligned() const
Tell if the MultilocusGenotypes are aligned (i.e. same size).
size_t size() const
Get the number of MultilocusGenotype.
std::vector< std::unique_ptr< MultilocusGenotype > > multilocusGenotypes_
size_t getGroupSize(size_t group) const
Get group size.
std::unique_ptr< MultilocusGenotype > removeMultilocusGenotype(size_t position)
Remove a MultilocusGenotype.
void setGroupId(size_t position, size_t groupId)
Set the Group id of a MultilocusGenotype.
std::string toString(T t)