49 for (
size_t i = 0; i <
loci_.size(); i++)
69 for (
size_t i = 0; i <
loci_.size(); i++)
78 size_t locus_position,
81 if (locus_position <
loci_.size())
85 locus_position, 0,
loci_.size());
91 const std::string& locus_name)
const
93 for (
size_t i = 0; i <
loci_.size(); i++)
95 if (
loci_[i] != NULL &&
loci_[i]->getName() == locus_name)
104 const std::string& locus_name)
const
106 for (
size_t i = 0; i <
loci_.size(); i++)
108 if (
loci_[i] != NULL &&
loci_[i]->getName() == locus_name)
118 size_t locus_position)
const
120 if (locus_position >=
loci_.size())
122 if (
loci_[locus_position] != NULL)
123 return *(
loci_[locus_position]);
134 bool locus_found =
false;
135 for (vector<LocusInfo*>::iterator it =
loci_.begin(); it !=
loci_.end(); it++)
137 if ((*it)->getName() == locus_name)
142 (*it)->addAlleleInfo(allele);
160 if (locus_position <
loci_.size())
164 loci_[locus_position]->addAlleleInfo(allele);
173 locus_position, 0,
loci_.size());
180 vector<size_t> allele_count;
181 for (
size_t i = 0; i <
loci_.size(); i++)
192 for (
size_t i = 0; i <
loci_.size(); i++)
194 if (
loci_[i] != NULL &&
loci_[i]->getName() == locus_name)
195 return loci_[i]->getPloidy();
205 if (locus_position >=
loci_.size())
207 return loci_[locus_position]->getPloidy();
The AlleleInfo interface.
std::vector< size_t > getNumberOfAlleles() const
Get the number of alleles at each locus.
size_t getNumberOfLoci() const
Get the number of loci.
unsigned int getPloidyByLocusName(const std::string &locus_name) const
Get the ploidy of a locus by name.
const LocusInfo & getLocusInfoByName(const std::string &locus_name) const
Get a LocusInfo by name.
AnalyzedLoci(size_t number_of_loci)
Build a void AnalyzedLoci with a specific number of loci.
const LocusInfo & getLocusInfoAtPosition(size_t locus_position) const
Get a LocusInfo by its position.
unsigned int getPloidyByLocusPosition(size_t locus_position) const
Get the ploidy of a locus by its position.
std::vector< LocusInfo * > loci_
~AnalyzedLoci()
Destroy the AnalyzedLoci.
void addAlleleInfoByLocusPosition(size_t locus_position, const AlleleInfo &allele)
Add an AlleleInfo to a LocusInfo by its position.
size_t getLocusInfoPosition(const std::string &locus_name) const
Get the position of a LocusInfo.
void addAlleleInfoByLocusName(const std::string &locus_name, const AlleleInfo &allele)
Add an AlleleInfo to a LocusInfo by LocusInfo name.
void setLocusInfo(size_t locus_position, const LocusInfo &locus)
Set a LocusInfo.
The BadIdentifierException class.
virtual const std::string getIdentifier() const
Return the value of the identifier as a string.
The LocusNotFoundException class.