|
bpp-phyl
2.1.0
|
Generally used mutation process model. More...
#include <Bpp/Phyl/Simulation/MutationProcess.h>
Inheritance diagram for bpp::SimpleMutationProcess:
Collaboration diagram for bpp::SimpleMutationProcess:Public Member Functions | |
| SimpleMutationProcess (const SubstitutionModel *model) | |
| Build a new SimpleMutationProcess object. | |
| virtual | ~SimpleMutationProcess () |
| int | evolve (int initialState, double time) const |
| Method redefinition for better performance. | |
| int | mutate (int state) const |
| Mutate a character in state i. | |
| int | mutate (int state, unsigned int n) const |
| Mutate a character in state i n times. | |
| double | getTimeBeforeNextMutationEvent (int state) const |
| Get the time before next mutation event. | |
| MutationPath | detailedEvolve (int initialState, double time) const |
| Simulation a character evolution during a specified time according to the given substitution model and send the total path with all intermediate states and times between mutation events. | |
| const SubstitutionModel * | getSubstitutionModel () const |
| Get the substitution model associated to the mutation process. | |
Protected Attributes | |
| const SubstitutionModel * | model_ |
| The substitution model to use: | |
| size_t | size_ |
| The number of states allowed for the character to mutate. | |
| VVdouble | repartition_ |
| The repartition function for states probabilities. | |
Generally used mutation process model.
This builds a MutationProcess according to a given SubstitutionModel. The underlying mutation process is the following:
from an exponential law with parameter
,
to state
is:
Definition at line 341 of file MutationProcess.h.
| SimpleMutationProcess::SimpleMutationProcess | ( | const SubstitutionModel * | model | ) |
Build a new SimpleMutationProcess object.
| model | The substitution model to use. |
Definition at line 115 of file MutationProcess.cpp.
References bpp::SubstitutionModel::getGenerator(), bpp::SubstitutionModel::getNumberOfStates(), bpp::SubstitutionModel::Qij(), bpp::AbstractMutationProcess::repartition_, and bpp::AbstractMutationProcess::size_.
| SimpleMutationProcess::~SimpleMutationProcess | ( | ) | [virtual] |
Definition at line 148 of file MutationProcess.cpp.
| MutationPath AbstractMutationProcess::detailedEvolve | ( | int | initialState, |
| double | time | ||
| ) | const [virtual, inherited] |
Simulation a character evolution during a specified time according to the given substitution model and send the total path with all intermediate states and times between mutation events.
| initialState | The state before beginning evolution. |
| time | The time during which evolution must occure. |
Implements bpp::MutationProcess.
Definition at line 98 of file MutationProcess.cpp.
References bpp::SubstitutionModel::getAlphabet(), bpp::AbstractMutationProcess::getTimeBeforeNextMutationEvent(), bpp::AbstractMutationProcess::model_, and bpp::AbstractMutationProcess::mutate().
| int SimpleMutationProcess::evolve | ( | int | initialState, |
| double | time | ||
| ) | const [virtual] |
Method redefinition for better performance.
| initialState | The state before beginning evolution. |
| time | The time during which evolution must occure. |
Reimplemented from bpp::AbstractMutationProcess.
Definition at line 151 of file MutationProcess.cpp.
References bpp::RandomTools::giveRandomNumberBetweenZeroAndEntry(), bpp::AbstractMutationProcess::model_, bpp::SubstitutionModel::Pij_t(), bpp::AbstractMutationProcess::size_, and bpp::TextTools::toString().
| const SubstitutionModel* bpp::AbstractMutationProcess::getSubstitutionModel | ( | ) | const [inline, virtual, inherited] |
Get the substitution model associated to the mutation process.
Implements bpp::MutationProcess.
Definition at line 325 of file MutationProcess.h.
References bpp::AbstractMutationProcess::model_.
| double AbstractMutationProcess::getTimeBeforeNextMutationEvent | ( | int | state | ) | const [virtual, inherited] |
Get the time before next mutation event.
| state | The actual state of the chain; |
Implements bpp::MutationProcess.
Definition at line 78 of file MutationProcess.cpp.
References bpp::AbstractMutationProcess::model_, bpp::SubstitutionModel::Qij(), and bpp::RandomTools::randExponential().
Referenced by bpp::AbstractMutationProcess::detailedEvolve(), and bpp::AbstractMutationProcess::evolve().
| int AbstractMutationProcess::mutate | ( | int | state | ) | const [virtual, inherited] |
Mutate a character in state i.
| state | The current state of the character. |
Implements bpp::MutationProcess.
Definition at line 48 of file MutationProcess.cpp.
References bpp::RandomTools::giveRandomNumberBetweenZeroAndEntry(), bpp::AbstractMutationProcess::repartition_, bpp::AbstractMutationProcess::size_, and bpp::TextTools::toString().
Referenced by bpp::AbstractMutationProcess::detailedEvolve(), and bpp::AbstractMutationProcess::evolve().
| int AbstractMutationProcess::mutate | ( | int | state, |
| unsigned int | n | ||
| ) | const [virtual, inherited] |
Mutate a character in state i n times.
| state | The current state of the character. |
| n | The number of mutations to perform. |
Implements bpp::MutationProcess.
Definition at line 59 of file MutationProcess.cpp.
References bpp::RandomTools::giveRandomNumberBetweenZeroAndEntry(), bpp::AbstractMutationProcess::repartition_, and bpp::AbstractMutationProcess::size_.
const SubstitutionModel* bpp::AbstractMutationProcess::model_ [protected, inherited] |
The substitution model to use:
Definition at line 285 of file MutationProcess.h.
Referenced by bpp::AbstractMutationProcess::detailedEvolve(), evolve(), bpp::AbstractMutationProcess::getSubstitutionModel(), bpp::AbstractMutationProcess::getTimeBeforeNextMutationEvent(), and bpp::AbstractMutationProcess::operator=().
VVdouble bpp::AbstractMutationProcess::repartition_ [protected, inherited] |
The repartition function for states probabilities.
repartition_[i][j] = probability that, being in state i at time t, we'll be in state <= j at time t+1.
Definition at line 298 of file MutationProcess.h.
Referenced by bpp::AbstractMutationProcess::mutate(), bpp::AbstractMutationProcess::operator=(), bpp::SelfMutationProcess::SelfMutationProcess(), and SimpleMutationProcess().
size_t bpp::AbstractMutationProcess::size_ [protected, inherited] |
The number of states allowed for the character to mutate.
Definition at line 290 of file MutationProcess.h.
Referenced by evolve(), bpp::AbstractMutationProcess::mutate(), bpp::AbstractMutationProcess::operator=(), bpp::SelfMutationProcess::SelfMutationProcess(), and SimpleMutationProcess().