40 #ifndef _INDIVIDUAL_H_
41 #define _INDIVIDUAL_H_
60 #include "../MultilocusGenotype.h"
61 #include "../GeneralExceptions.h"
81 std::unique_ptr< Point2D<double> >
coord_;
112 const unsigned short sex);
139 void setId(
const std::string&
id);
153 void setSex(
const unsigned short sex);
195 void setCoord(
const double x,
const double y);
218 void setX(
const double x);
228 void setY(
const double y);
424 size_t locus_position,
425 const std::vector<size_t> allele_keys);
435 size_t locus_position,
436 const std::vector<std::string> allele_id,
double getY() const
Get the Y coordinate of the Individual.
std::unique_ptr< Point2D< double > > coord_
bool hasCoord() const
Tell if this Individual has coordinates.
const Sequence & getSequenceAtPosition(const size_t sequence_position) const
Get a sequence by its position.
std::vector< size_t > getSequencesPositions() const
Get the sequences' positions.
bool hasSequences() const
Tell if the Individual has some sequences.
virtual ~Individual()
Destroy an Individual.
void setMonolocusGenotypeByAlleleKey(size_t locus_position, const std::vector< size_t > allele_keys)
Set a MonolocusGenotype.
Individual()
Build a void new Individual.
unsigned short getSex() const
Get the sex of the Individual.
void setSex(const unsigned short sex)
Set the sex of the Individual.
std::unique_ptr< Date > date_
std::vector< std::string > getSequencesNames() const
Get the sequences' names.
size_t countNonMissingLoci() const
Count the number of non missing MonolocusGenotype.
void addSequence(size_t sequence_key, const Sequence &sequence)
Add a sequence to the Individual.
void setGenotype(const MultilocusGenotype &genotype)
Set a genotype.
void setMonolocusGenotypeByAlleleId(size_t locus_position, const std::vector< std::string > allele_id, const LocusInfo &locus_info)
Set a MonolocusGenotype.
std::unique_ptr< MapSequenceContainer > sequences_
void initGenotype(size_t loci_number)
Init the genotype.
const std::string & getId() const
Get the id of the Individual.
void setCoord(const Point2D< double > &coord)
Set the coodinates of the Individual.
void setY(const double y)
Set the Y coordinate of th Individual.
void setId(const std::string &id)
Set the id of the Individual.
bool hasGenotype() const
Tell if the Individual has a MultilocusGenotype.
Individual & operator=(const Individual &ind)
The Individual copy operator.
void deleteSequenceByName(const std::string &sequence_name)
Delete a sequence.
const Sequence & getSequenceByName(const std::string &sequence_name) const
Get a sequence by its name.
void setDate(const Date &date)
Set the date of the Individual.
const MultilocusGenotype & getGenotype() const
Get the genotype.
const OrderedSequenceContainer & getSequences() const
Get a reference to the sequence container.
const Locality< double > * getLocality() const
Get the locality of the Individual.
const Locality< double > * locality_
bool hasSequenceAtPosition(size_t position) const
Tell if the Individual has a sequence at a given position.
size_t countHomozygousLoci() const
Count the number of homozygous MonolocusGenotype.
void deleteSequenceAtPosition(size_t sequence_position)
Delete a sequence.
void setMonolocusGenotype(size_t locus_position, const MonolocusGenotype &monogen)
Set a MonolocusGenotype.
void setX(const double x)
Set the X coordinate of the Individual.
void setLocality(const Locality< double > *locality)
Set the locality of the Individual.
bool hasDate() const
Tell if this Individual has a date.
const MonolocusGenotype & getMonolocusGenotype(size_t locus_position)
Get a MonolocusGenotype.
void setSequences(const MapSequenceContainer &msc)
Set all the sequences with a MapSequenceContainer.
size_t getSequencePosition(const std::string &sequence_name) const
Get the position of a sequence.
void deleteGenotype()
Delete the genotype of the individual.
std::unique_ptr< MultilocusGenotype > genotype_
size_t countHeterozygousLoci() const
Count the number of heterozygous MonolocusGenotype.
double getX() const
Get the X coordinate of the Individual.
const Date & getDate() const
Get the date of the Individual.
const Alphabet * getSequenceAlphabet() const
Return the alphabet of the sequences.
size_t getNumberOfSequences() const
Get the number of sequences.
const Point2D< double > & getCoord() const
Get the coordinates of the Induvidual.
bool hasLocality() const
Tell if this Individual has a locality.
The MonolocusGenotype virtual class.
The MultilocusGenotype class.