bpp-popgen
3.0.0
|
#include <Bpp/PopGen/DataSet/MultiSeqIndividual.h>
Public Member Functions | |
MultiSeqIndividual () | |
Build a void new MultiSeqIndividual. More... | |
MultiSeqIndividual (const std::string &id) | |
Build a new MultiSeqIndividual with an identifier. More... | |
MultiSeqIndividual (const std::string &id, const Date &date, const Point2D< double > &coord, Locality< double > *locality, const unsigned short sex) | |
Build a new MultiSeqIndividual with parameters. More... | |
MultiSeqIndividual (const MultiSeqIndividual &ind) | |
The MultiSeqIndividual copy constructor. More... | |
virtual | ~MultiSeqIndividual () |
Destroy an MultiSeqIndividual. More... | |
MultiSeqIndividual & | operator= (const MultiSeqIndividual &ind) |
The MultiSeqIndividual copy operator. More... | |
void | setId (const std::string id) |
Set the id of the MultiSeqIndividual. More... | |
std::string | getId () const |
Get the id of the MultiSeqIndividual. More... | |
void | setSex (const unsigned short sex) |
Set the sex of the MultiSeqIndividual. More... | |
unsigned short | getSex () const |
Get the sex of the MultiSeqIndividual. More... | |
void | setDate (const Date &date) |
Set the date of the MultiSeqIndividual. More... | |
const Date * | getDate () const |
Get the date of the MultiSeqIndividual. More... | |
bool | hasDate () const |
Tell if this MultiSeqIndividual has a date. More... | |
void | setCoord (const Point2D< double > &coord) |
Set the coodinates of the MultiSeqIndividual. More... | |
void | setCoord (const double x, const double y) |
Set the coordinates of the MultiSeqIndividual. More... | |
const Point2D< double > * | getCoord () const |
Get the coordinates of the Induvidual. More... | |
bool | hasCoord () const |
Tell if this MultiSeqIndividual has coordinates. More... | |
void | setX (const double x) |
Set the X coordinate of the MultiSeqIndividual. More... | |
void | setY (const double y) |
Set the Y coordinate of th MultiSeqIndividual. More... | |
double | getX () const |
Get the X coordinate of the MultiSeqIndividual. More... | |
double | getY () const |
Get the Y coordinate of the MultiSeqIndividual. More... | |
void | setLocality (const Locality< double > *locality) |
Set the locality of the MultiSeqIndividual. More... | |
const Locality< double > * | getLocality () const |
Get the locality of the MultiSeqIndividual. More... | |
bool | hasLocality () const |
Tell if this MultiSeqIndividual has a locality. More... | |
const VectorSequenceContainer * | getVectorSequenceContainer (const std::string &id) const |
Get a pointer to the VectorSequenceContainer at a named locus. More... | |
void | addSequence (const std::string &id, const Sequence &sequence) |
Add a sequence in a named sequence set. More... | |
const Sequence & | getSequence (const std::string &id, const std::string &name) const |
Get a named sequence from a named sequence set. More... | |
const Sequence & | getSequence (const std::string &id, const size_t i) const |
Get an indexed sequence from a named sequence set. More... | |
std::vector< std::string > | getSequencesKeys () const |
Get the sequence set ids. More... | |
Sequence * | removeSequence (const std::string &id, const std::string &name) |
Remove a named sequence from a named sequence set. More... | |
void | deleteSequence (const std::string &id, const std::string &name) |
Delete a named sequence from a named sequence set. More... | |
bool | hasSequences () const |
Tell if the MultiSeqIndividual has some sequences. More... | |
size_t | getNumberOfSequenceSet () const |
Count the number of sequece set. More... | |
size_t | getNumberOfSequences (const std::string &id) const |
Get the number of sequences in a sequence set. More... | |
void | addGenotype (const MultilocusGenotype &genotype) |
Add a genotype. More... | |
const MultilocusGenotype * | getGenotype () const |
Get the genotype. More... | |
bool | hasGenotype () const |
Tell if the MultiSeqIndividual has a MultilocusGenotype. More... | |
Private Attributes | |
std::string | id_ |
unsigned short | sex_ |
Date * | date_ |
Point2D< double > * | coord_ |
const Locality< double > * | locality_ |
std::map< std::string, VectorSequenceContainer * > | sequences_ |
MultilocusGenotype * | genotype_ |
The MultiSeqIndividual class.
This class is designed to store data on a single individual. This individual can store numerous sequences for each place. It was the first working implementation which manages sequences as a map of sequence container. We have replaced it with a simplest individual with only one sequence per locus.
Definition at line 77 of file MultiSeqIndividual.h.
MultiSeqIndividual::MultiSeqIndividual | ( | ) |
Build a void new MultiSeqIndividual.
Definition at line 47 of file MultiSeqIndividual.cpp.
MultiSeqIndividual::MultiSeqIndividual | ( | const std::string & | id | ) |
Build a new MultiSeqIndividual with an identifier.
Definition at line 55 of file MultiSeqIndividual.cpp.
MultiSeqIndividual::MultiSeqIndividual | ( | const std::string & | id, |
const Date & | date, | ||
const Point2D< double > & | coord, | ||
Locality< double > * | locality, | ||
const unsigned short | sex | ||
) |
Build a new MultiSeqIndividual with parameters.
id | The id of the MultiSeqIndividual as a string. |
date | The date of the MultiSeqIndividual as a Date object. |
coord | The coordinates of the MultiSeqIndividual as a Coord object. |
locality | The locality of the MultiSeqIndividual as a pointer to a Locality object. |
sex | The sex of the MultiSeqIndividual as an unsigned short. |
Definition at line 63 of file MultiSeqIndividual.cpp.
MultiSeqIndividual::MultiSeqIndividual | ( | const MultiSeqIndividual & | ind | ) |
The MultiSeqIndividual copy constructor.
Definition at line 77 of file MultiSeqIndividual.cpp.
References coord_, date_, genotype_, getCoord(), getDate(), getGenotype(), getLocality(), getSequencesKeys(), getVectorSequenceContainer(), hasGenotype(), hasSequences(), locality_, sequences_, setCoord(), setDate(), and setLocality().
|
virtual |
Destroy an MultiSeqIndividual.
Definition at line 122 of file MultiSeqIndividual.cpp.
void MultiSeqIndividual::addGenotype | ( | const MultilocusGenotype & | genotype | ) |
Add a genotype.
genotype | The MultilocusGenotype to add. |
Definition at line 475 of file MultiSeqIndividual.cpp.
References genotype_.
void MultiSeqIndividual::addSequence | ( | const std::string & | id, |
const Sequence & | sequence | ||
) |
Add a sequence in a named sequence set.
id | The id of the sequence set. |
sequence | The sequence to add. |
AlphabetMismatchException | if the sequence's alphabet doesn't match the container's alphabet. |
BadIdentifierException | if sequence's name is already in use. |
Definition at line 365 of file MultiSeqIndividual.cpp.
References bpp::AlphabetMismatchException::getAlphabets(), bpp::Sequence::getName(), and sequences_.
void bpp::MultiSeqIndividual::deleteSequence | ( | const std::string & | id, |
const std::string & | name | ||
) |
Delete a named sequence from a named sequence set.
id | The id of the sequence set. |
name | The name of the sequence. |
const Point2D< double > * MultiSeqIndividual::getCoord | ( | ) | const |
Get the coordinates of the Induvidual.
Definition at line 266 of file MultiSeqIndividual.cpp.
References coord_, and hasCoord().
Referenced by MultiSeqIndividual(), and operator=().
const Date * MultiSeqIndividual::getDate | ( | ) | const |
Get the date of the MultiSeqIndividual.
Definition at line 218 of file MultiSeqIndividual.cpp.
References date_, and hasDate().
Referenced by MultiSeqIndividual(), and operator=().
const MultilocusGenotype * MultiSeqIndividual::getGenotype | ( | ) | const |
Get the genotype.
Definition at line 482 of file MultiSeqIndividual.cpp.
References genotype_.
Referenced by MultiSeqIndividual(), and operator=().
std::string MultiSeqIndividual::getId | ( | ) | const |
Get the id of the MultiSeqIndividual.
Definition at line 180 of file MultiSeqIndividual.cpp.
References id_.
Referenced by operator=().
const Locality< double > * MultiSeqIndividual::getLocality | ( | ) | const |
Get the locality of the MultiSeqIndividual.
Definition at line 331 of file MultiSeqIndividual.cpp.
References hasLocality(), and locality_.
Referenced by MultiSeqIndividual(), and operator=().
size_t MultiSeqIndividual::getNumberOfSequences | ( | const std::string & | id | ) | const |
Get the number of sequences in a sequence set.
Definition at line 456 of file MultiSeqIndividual.cpp.
References sequences_.
size_t MultiSeqIndividual::getNumberOfSequenceSet | ( | ) | const |
Count the number of sequece set.
Definition at line 449 of file MultiSeqIndividual.cpp.
References sequences_.
const Sequence & MultiSeqIndividual::getSequence | ( | const std::string & | id, |
const size_t | i | ||
) | const |
Get an indexed sequence from a named sequence set.
id | The id of the sequence set. |
i | The index of the sequence in the sequence set. |
Definition at line 406 of file MultiSeqIndividual.cpp.
References getSequence(), and sequences_.
const Sequence & MultiSeqIndividual::getSequence | ( | const std::string & | id, |
const std::string & | name | ||
) | const |
Get a named sequence from a named sequence set.
id | The id of the sequence set. |
name | The name of the sequence. |
Definition at line 383 of file MultiSeqIndividual.cpp.
References sequences_.
Referenced by getSequence().
std::vector< std::string > MultiSeqIndividual::getSequencesKeys | ( | ) | const |
Get the sequence set ids.
Definition at line 429 of file MultiSeqIndividual.cpp.
References sequences_.
Referenced by MultiSeqIndividual(), and operator=().
unsigned short MultiSeqIndividual::getSex | ( | ) | const |
Get the sex of the MultiSeqIndividual.
Definition at line 195 of file MultiSeqIndividual.cpp.
References sex_.
Referenced by operator=().
const VectorSequenceContainer * MultiSeqIndividual::getVectorSequenceContainer | ( | const std::string & | id | ) | const |
Get a pointer to the VectorSequenceContainer at a named locus.
id | The id of the sequence set (i.e. locus). |
Definition at line 349 of file MultiSeqIndividual.cpp.
References sequences_.
Referenced by MultiSeqIndividual(), and operator=().
double MultiSeqIndividual::getX | ( | ) | const |
Get the X coordinate of the MultiSeqIndividual.
Definition at line 303 of file MultiSeqIndividual.cpp.
References coord_, bpp::Point2D< class >::getX(), and hasCoord().
Referenced by setCoord().
double MultiSeqIndividual::getY | ( | ) | const |
Get the Y coordinate of the MultiSeqIndividual.
Definition at line 313 of file MultiSeqIndividual.cpp.
References coord_, bpp::Point2D< class >::getY(), and hasCoord().
Referenced by setCoord().
bool MultiSeqIndividual::hasCoord | ( | ) | const |
Tell if this MultiSeqIndividual has coordinates.
Definition at line 276 of file MultiSeqIndividual.cpp.
References coord_.
Referenced by getCoord(), getX(), getY(), setCoord(), setX(), and setY().
bool MultiSeqIndividual::hasDate | ( | ) | const |
Tell if this MultiSeqIndividual has a date.
Definition at line 228 of file MultiSeqIndividual.cpp.
References date_.
bool MultiSeqIndividual::hasGenotype | ( | ) | const |
Tell if the MultiSeqIndividual has a MultilocusGenotype.
Definition at line 489 of file MultiSeqIndividual.cpp.
References genotype_.
Referenced by MultiSeqIndividual(), and operator=().
bool MultiSeqIndividual::hasLocality | ( | ) | const |
Tell if this MultiSeqIndividual has a locality.
Definition at line 341 of file MultiSeqIndividual.cpp.
References locality_.
Referenced by getLocality().
bool MultiSeqIndividual::hasSequences | ( | ) | const |
Tell if the MultiSeqIndividual has some sequences.
Definition at line 442 of file MultiSeqIndividual.cpp.
References sequences_.
Referenced by MultiSeqIndividual(), and operator=().
MultiSeqIndividual & MultiSeqIndividual::operator= | ( | const MultiSeqIndividual & | ind | ) |
The MultiSeqIndividual copy operator.
Definition at line 130 of file MultiSeqIndividual.cpp.
References coord_, date_, genotype_, getCoord(), getDate(), getGenotype(), getId(), getLocality(), getSequencesKeys(), getSex(), getVectorSequenceContainer(), hasGenotype(), hasSequences(), locality_, sequences_, setCoord(), setDate(), setId(), setLocality(), and setSex().
Sequence* bpp::MultiSeqIndividual::removeSequence | ( | const std::string & | id, |
const std::string & | name | ||
) |
Remove a named sequence from a named sequence set.
id | The id of the sequence set. |
name | The name of the sequence. |
void MultiSeqIndividual::setCoord | ( | const double | x, |
const double | y | ||
) |
Set the coordinates of the MultiSeqIndividual.
x | The X coordinate as a double. |
y | The Y coordinate as a double. |
Definition at line 251 of file MultiSeqIndividual.cpp.
References coord_, getX(), getY(), and hasCoord().
void MultiSeqIndividual::setCoord | ( | const Point2D< double > & | coord | ) |
Set the coodinates of the MultiSeqIndividual.
coord | A Point2D object. |
Definition at line 236 of file MultiSeqIndividual.cpp.
References coord_, and hasCoord().
Referenced by MultiSeqIndividual(), and operator=().
void MultiSeqIndividual::setDate | ( | const Date & | date | ) |
Set the date of the MultiSeqIndividual.
date | The date as a Date object. |
Definition at line 203 of file MultiSeqIndividual.cpp.
References date_, and hasDate().
Referenced by MultiSeqIndividual(), and operator=().
void MultiSeqIndividual::setId | ( | const std::string | id | ) |
Set the id of the MultiSeqIndividual.
id | The id of the MultiSeqIndividual as a string. |
Definition at line 173 of file MultiSeqIndividual.cpp.
References id_.
Referenced by operator=().
void MultiSeqIndividual::setLocality | ( | const Locality< double > * | locality | ) |
Set the locality of the MultiSeqIndividual.
locality | A pointer to a Locality object. |
Definition at line 324 of file MultiSeqIndividual.cpp.
References locality_.
Referenced by MultiSeqIndividual(), and operator=().
void MultiSeqIndividual::setSex | ( | const unsigned short | sex | ) |
Set the sex of the MultiSeqIndividual.
sex | An unsigned short coding for the sex. |
Definition at line 188 of file MultiSeqIndividual.cpp.
References sex_.
Referenced by operator=().
void MultiSeqIndividual::setX | ( | const double | x | ) |
Set the X coordinate of the MultiSeqIndividual.
x | The X coordinate as a double. |
Set the X coordinate if the MultiSeqIndividual has coordinates. Otherwise throw a NullPointerException.
Definition at line 283 of file MultiSeqIndividual.cpp.
References coord_, hasCoord(), and bpp::Point2D< class >::setX().
void MultiSeqIndividual::setY | ( | const double | y | ) |
Set the Y coordinate of th MultiSeqIndividual.
y | The Y coordinate as a double. |
Set the Y coordinate if the MultiSeqIndividual has coordinates. Otherwise throw a NullPointerException.
Definition at line 293 of file MultiSeqIndividual.cpp.
References coord_, hasCoord(), and bpp::Point2D< class >::setY().
|
private |
Definition at line 83 of file MultiSeqIndividual.h.
Referenced by getCoord(), getX(), getY(), hasCoord(), MultiSeqIndividual(), operator=(), setCoord(), setX(), setY(), and ~MultiSeqIndividual().
|
private |
Definition at line 82 of file MultiSeqIndividual.h.
Referenced by getDate(), hasDate(), MultiSeqIndividual(), operator=(), setDate(), and ~MultiSeqIndividual().
|
private |
Definition at line 86 of file MultiSeqIndividual.h.
Referenced by addGenotype(), getGenotype(), hasGenotype(), MultiSeqIndividual(), and operator=().
|
private |
Definition at line 80 of file MultiSeqIndividual.h.
|
private |
Definition at line 84 of file MultiSeqIndividual.h.
Referenced by getLocality(), hasLocality(), MultiSeqIndividual(), operator=(), and setLocality().
|
private |
Definition at line 85 of file MultiSeqIndividual.h.
Referenced by addSequence(), getNumberOfSequences(), getNumberOfSequenceSet(), getSequence(), getSequencesKeys(), getVectorSequenceContainer(), hasSequences(), MultiSeqIndividual(), and operator=().
|
private |
Definition at line 81 of file MultiSeqIndividual.h.