|
Nemo
2.2.0
|
Trait used to study the dynamics of spread of Wolbachia, an endosymbiotic parasite causing cytoplasmic incompatibility. More...
#include <ttwolbachia.h>
Inheritance diagram for TTWolbachia:
Collaboration diagram for TTWolbachia:Public Member Functions | |
| TTWolbachia () | |
| TTWolbachia (const TTWolbachia &T) | |
| virtual | ~TTWolbachia () |
| void | set_transmit_rate (double val) |
| virtual void | init () |
| Called to allocate the trait's genotypic sequences. | |
| virtual void | init_sequence () |
| Called at the start of each replicate, sets the initial genotypes. | |
| virtual void | reset () |
| Called at the end of each simulation/replicate, deallocates sequence memory. | |
| virtual void | inherit (TTrait *mother, TTrait *father) |
| Inheritance procedure, creates a new trait from mother's and father's traits. | |
| virtual void | mutate () |
| Mutation procedure, perform mutations on the genes sequence. | |
| virtual void * | set_trait (void *value) |
| Called to set the phenotypic to a particular value or to give context-dependant value(s) to the trait. | |
| virtual void | set_sequence (void **seq) |
| Called to set the sequence pointer to an existing trait. | |
| virtual void | set_value () |
| Tells the trait to set its phenotype from genotype, should be used instead of getValue(). | |
| virtual void * | getValue () |
| Genotype to phenotype mapper. | |
| virtual trait_t | get_type () const |
| type accessor. | |
| virtual void ** | get_sequence () const |
| sequence accessor. | |
| virtual void * | get_allele (int loc, int all) const |
| Called to read one allele value at a particular locus. | |
| virtual void | show_up () |
| Writes some info to stdout. | |
| virtual TTWolbachia * | clone () |
| Returns a copy of itself. | |
| virtual TTWolbachia & | operator= (const TTrait &T) |
| Copies the complete state of the trait from right to left side of the operator, sequence data included. | |
| virtual bool | operator== (const TTrait &T) |
| Checks for parameters equivalence, not genetic equivalence. | |
| virtual bool | operator!= (const TTrait &T) |
| virtual void | store_data (BinaryStorageBuffer *saver) |
| Interface to store the component data (e.g. gene values) into a binary buffer. | |
| virtual bool | retrieve_data (BinaryStorageBuffer *reader) |
| Interface to retrieve the same data from the binary buffer. | |
Private Attributes | |
| double | _transmit_rate |
| bool | _is_infected |
Trait used to study the dynamics of spread of Wolbachia, an endosymbiotic parasite causing cytoplasmic incompatibility.
The trait state is given by a unique haploid "gene" with two alleles, 0 = uninfected and 1 = infected.
Definition at line 50 of file ttwolbachia.h.
| TTWolbachia::TTWolbachia | ( | ) | [inline] |
Definition at line 58 of file ttwolbachia.h.
Referenced by clone().
: _transmit_rate(0), _is_infected(0) { }
| TTWolbachia::TTWolbachia | ( | const TTWolbachia & | T | ) | [inline] |
Definition at line 61 of file ttwolbachia.h.
: _transmit_rate(T._transmit_rate), _is_infected(T._is_infected) { }
| virtual TTWolbachia::~TTWolbachia | ( | ) | [inline, virtual] |
Definition at line 65 of file ttwolbachia.h.
{}
| virtual TTWolbachia* TTWolbachia::clone | ( | ) | [inline, virtual] |
Returns a copy of itself.
Note: call the copy constructor of the trait which should only copy the parameters values not the complete state of the trait (i.e. shallow copy). The copy of the sequence data is made through the assignement operator!
Implements TTrait.
Definition at line 85 of file ttwolbachia.h.
References TTWolbachia().
{return new TTWolbachia(*this);}
| virtual void* TTWolbachia::get_allele | ( | int | loc, |
| int | all | ||
| ) | const [inline, virtual] |
Called to read one allele value at a particular locus.
| loc | locus position in the sequence |
| all | which allele we want to read the value from |
Implements TTrait.
Definition at line 83 of file ttwolbachia.h.
{return NULL;}
| virtual void** TTWolbachia::get_sequence | ( | ) | const [inline, virtual] |
sequence accessor.
Implements TTrait.
Definition at line 82 of file ttwolbachia.h.
{return NULL;}
| virtual trait_t TTWolbachia::get_type | ( | ) | const [inline, virtual] |
type accessor.
Implements TTrait.
Definition at line 81 of file ttwolbachia.h.
References WOLB.
Referenced by operator==().
{return WOLB;}
| virtual void* TTWolbachia::getValue | ( | ) | [inline, virtual] |
Genotype to phenotype mapper.
Implements TTrait.
Definition at line 80 of file ttwolbachia.h.
References _is_infected.
{return (void*)&_is_infected;}
Inheritance procedure, creates a new trait from mother's and father's traits.
| mother | the mother's trait |
| father | the father's trait |
Implements TTrait.
Definition at line 72 of file ttwolbachia.h.
References _is_infected, and TTrait::getValue().
{ _is_infected = *(bool*)mother->getValue(); }
| virtual void TTWolbachia::init | ( | ) | [inline, virtual] |
Called to allocate the trait's genotypic sequences.
Called each time a new Individual is created (Individual::init())
Implements TTrait.
Definition at line 69 of file ttwolbachia.h.
References _is_infected.
{_is_infected = 0;}
| virtual void TTWolbachia::init_sequence | ( | ) | [inline, virtual] |
Called at the start of each replicate, sets the initial genotypes.
Called by Individual::create().
Implements TTrait.
Definition at line 70 of file ttwolbachia.h.
References _is_infected.
{_is_infected = 0;}
| virtual void TTWolbachia::mutate | ( | ) | [inline, virtual] |
Mutation procedure, perform mutations on the genes sequence.
Implements TTrait.
Definition at line 74 of file ttwolbachia.h.
References _is_infected, _transmit_rate, and RAND::Uniform().
{ _is_infected &= (RAND::Uniform() < _transmit_rate); }
| bool TTWolbachia::operator!= | ( | const TTrait & | T | ) | [virtual] |
Implements TTrait.
Definition at line 98 of file ttwolbachia.cc.
{
if(!((*this) == T))
return true;
else
return false;
}
| TTWolbachia & TTWolbachia::operator= | ( | const TTrait & | ) | [virtual] |
Copies the complete state of the trait from right to left side of the operator, sequence data included.
Implements TTrait.
Definition at line 74 of file ttwolbachia.cc.
References _is_infected, and _transmit_rate.
{
const TTWolbachia& TD = dynamic_cast<const TTWolbachia&> (T);
if(this != &TD) {
_is_infected = TD._is_infected;
_transmit_rate = TD._transmit_rate;
}
return *this;
}
| bool TTWolbachia::operator== | ( | const TTrait & | ) | [virtual] |
Checks for parameters equivalence, not genetic equivalence.
Implements TTrait.
Definition at line 86 of file ttwolbachia.cc.
References get_type(), and TTrait::get_type().
{
if(this->get_type().compare(T.get_type()) != 0) return false;
// const TTWolbachia& TD = dynamic_cast<const TTWolbachia&> (T);
// if(this != &TD) {
// if(_transmit_rate != TD._transmit_rate) return false;
// }
return true;
}
| virtual void TTWolbachia::reset | ( | ) | [inline, virtual] |
Called at the end of each simulation/replicate, deallocates sequence memory.
Implements TTrait.
Definition at line 71 of file ttwolbachia.h.
References _is_infected.
{_is_infected = 0;}
| virtual bool TTWolbachia::retrieve_data | ( | BinaryStorageBuffer * | reader | ) | [inline, virtual] |
Interface to retrieve the same data from the binary buffer.
Implements StorableComponent.
Definition at line 95 of file ttwolbachia.h.
References _is_infected, and BinaryStorageBuffer::read().
{
unsigned char dummy;
reader->read(&dummy, 1);
_is_infected = dummy;
return true;
}
| virtual void TTWolbachia::set_sequence | ( | void ** | seq | ) | [inline, virtual] |
Called to set the sequence pointer to an existing trait.
| seq | the existing sequence pointer |
Implements TTrait.
Definition at line 78 of file ttwolbachia.h.
{ }
| virtual void* TTWolbachia::set_trait | ( | void * | value | ) | [inline, virtual] |
Called to set the phenotypic to a particular value or to give context-dependant value(s) to the trait.
| value | the value passed to the trait |
Implements TTrait.
Definition at line 76 of file ttwolbachia.h.
References _is_infected.
{ _is_infected = *(bool*)value; return &_is_infected; }
| void TTWolbachia::set_transmit_rate | ( | double | val | ) | [inline] |
Definition at line 67 of file ttwolbachia.h.
References _transmit_rate.
Referenced by TProtoWolbachia::hatch().
{_transmit_rate = val;}
| virtual void TTWolbachia::set_value | ( | ) | [inline, virtual] |
Tells the trait to set its phenotype from genotype, should be used instead of getValue().
Implements TTrait.
Definition at line 79 of file ttwolbachia.h.
{ }
| virtual void TTWolbachia::show_up | ( | ) | [inline, virtual] |
| virtual void TTWolbachia::store_data | ( | BinaryStorageBuffer * | saver | ) | [inline, virtual] |
Interface to store the component data (e.g. gene values) into a binary buffer.
Implements StorableComponent.
Definition at line 90 of file ttwolbachia.h.
References _is_infected, and BinaryStorageBuffer::store().
{
unsigned char dummy = static_cast<unsigned char>(_is_infected);
saver->store(&dummy, 1);
}
bool TTWolbachia::_is_infected [private] |
Definition at line 54 of file ttwolbachia.h.
Referenced by getValue(), inherit(), init(), init_sequence(), mutate(), operator=(), reset(), retrieve_data(), set_trait(), and store_data().
double TTWolbachia::_transmit_rate [private] |
Definition at line 53 of file ttwolbachia.h.
Referenced by mutate(), operator=(), and set_transmit_rate().
1.7.5.1 -- Nemo is hosted by