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