bpp-phyl  2.2.0
bpp::SelfMutationProcess Class Reference

This class is mainly for testing purpose. It allow "self" mutation of the kind i->i;. More...

#include <Bpp/Phyl/Simulation/MutationProcess.h>

+ Inheritance diagram for bpp::SelfMutationProcess:
+ Collaboration diagram for bpp::SelfMutationProcess:

Public Member Functions

 SelfMutationProcess (size_t alphabetSize)
 
virtual ~SelfMutationProcess ()
 
size_t mutate (size_t state) const
 Mutate a character in state i. More...
 
size_t mutate (size_t state, unsigned int n) const
 Mutate a character in state i n times. More...
 
double getTimeBeforeNextMutationEvent (size_t state) const
 Get the time before next mutation event. More...
 
size_t evolve (size_t initialState, double time) const
 Simulation a character evolution during a specified time according to the given substitution model and send the final state. More...
 
MutationPath detailedEvolve (size_t 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. More...
 
const SubstitutionModelgetSubstitutionModel () const
 Get the substitution model associated to the mutation process. More...
 

Protected Attributes

const SubstitutionModelmodel_
 The substitution model to use: More...
 
size_t size_
 The number of states allowed for the character to mutate. More...
 
VVdouble repartition_
 The repartition function for states probabilities. More...
 

Detailed Description

This class is mainly for testing purpose. It allow "self" mutation of the kind i->i;.

Definition at line 368 of file MutationProcess.h.

Constructor & Destructor Documentation

◆ SelfMutationProcess()

SelfMutationProcess::SelfMutationProcess ( size_t  alphabetSize)

◆ ~SelfMutationProcess()

SelfMutationProcess::~SelfMutationProcess ( )
virtual

Definition at line 196 of file MutationProcess.cpp.

Member Function Documentation

◆ detailedEvolve()

MutationPath AbstractMutationProcess::detailedEvolve ( size_t  initialState,
double  time 
) const
virtualinherited

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.

Parameters
initialStateThe state before beginning evolution.
timeThe time during which evolution must occure.
Returns
The resulting mutation path.

Implements bpp::MutationProcess.

Definition at line 103 of file MutationProcess.cpp.

References bpp::SubstitutionModel::getAlphabet(), bpp::AbstractMutationProcess::getTimeBeforeNextMutationEvent(), bpp::AbstractMutationProcess::model_, and bpp::AbstractMutationProcess::mutate().

◆ evolve()

size_t AbstractMutationProcess::evolve ( size_t  initialState,
double  time 
) const
virtualinherited

Simulation a character evolution during a specified time according to the given substitution model and send the final state.

Parameters
initialStateThe state before beginning evolution.
timeThe time during which evolution must occure.
Returns
The resulting state after evolution is completed.

Implements bpp::MutationProcess.

Reimplemented in bpp::SimpleMutationProcess.

Definition at line 88 of file MutationProcess.cpp.

References bpp::AbstractMutationProcess::getTimeBeforeNextMutationEvent(), and bpp::AbstractMutationProcess::mutate().

◆ getSubstitutionModel()

const SubstitutionModel* bpp::AbstractMutationProcess::getSubstitutionModel ( ) const
inlinevirtualinherited

Get the substitution model associated to the mutation process.

Returns
The SubstitutionModel associated to this instance.

Implements bpp::MutationProcess.

Definition at line 325 of file MutationProcess.h.

References bpp::AbstractMutationProcess::model_.

◆ getTimeBeforeNextMutationEvent()

double AbstractMutationProcess::getTimeBeforeNextMutationEvent ( size_t  state) const
virtualinherited

Get the time before next mutation event.

Parameters
stateThe actual state of the chain;
Returns
A random time before next mutation event.

Implements bpp::MutationProcess.

Definition at line 81 of file MutationProcess.cpp.

References bpp::AbstractMutationProcess::model_, and bpp::SubstitutionModel::Qij().

Referenced by bpp::AbstractMutationProcess::detailedEvolve(), and bpp::AbstractMutationProcess::evolve().

◆ mutate() [1/2]

size_t AbstractMutationProcess::mutate ( size_t  state) const
virtualinherited

Mutate a character in state i.

Parameters
stateThe current state of the character.

Implements bpp::MutationProcess.

Definition at line 49 of file MutationProcess.cpp.

References bpp::AbstractMutationProcess::repartition_, and bpp::AbstractMutationProcess::size_.

Referenced by bpp::AbstractMutationProcess::detailedEvolve(), and bpp::AbstractMutationProcess::evolve().

◆ mutate() [2/2]

size_t AbstractMutationProcess::mutate ( size_t  state,
unsigned int  n 
) const
virtualinherited

Mutate a character in state i n times.

Parameters
stateThe current state of the character.
nThe number of mutations to perform.

Implements bpp::MutationProcess.

Definition at line 61 of file MutationProcess.cpp.

References bpp::AbstractMutationProcess::repartition_, and bpp::AbstractMutationProcess::size_.

Member Data Documentation

◆ model_

◆ repartition_

VVdouble bpp::AbstractMutationProcess::repartition_
protectedinherited

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=(), SelfMutationProcess(), and bpp::SimpleMutationProcess::SimpleMutationProcess().

◆ size_

size_t bpp::AbstractMutationProcess::size_
protectedinherited

The documentation for this class was generated from the following files: