|
bpp-phyl
2.1.0
|
This class is used by MutationProcess to store detailed results of simulations. More...
#include <Bpp/Phyl/Simulation/MutationProcess.h>
Collaboration diagram for bpp::MutationPath:Public Member Functions | |
| MutationPath (const Alphabet *alphabet, int initialState, double time) | |
| Builds a new MutationPath object with initial state 'initialState' and total time 'time'. | |
| MutationPath (const MutationPath &path) | |
| MutationPath & | operator= (const MutationPath &path) |
| virtual | ~MutationPath () |
| const Alphabet * | getAlphabet () const |
| void | addEvent (int state, double time) |
| Add a new mutation event. | |
| int | getInitialState () const |
| Retrieve the initial state. | |
| double | getTotalTime () const |
| Retrieve the total time of evolution. | |
| size_t | getNumberOfEvents () const |
| Retrieve the number of substitution events. | |
| template<class Scalar > | |
| void | getEventCounts (Matrix< Scalar > &counts) const |
| Retrieve the number of substitution events per type of substitution. | |
| template<class Scalar > | |
| void | getEventCounts (std::vector< Scalar > &counts, const SubstitutionRegister ®) const |
| Retrieve the number of substitution events per type of substitution, defined by a SubstitutionRegister object. | |
| int | getFinalState () const |
| Retrieve the final state of this path. | |
Private Attributes | |
| const Alphabet * | alphabet_ |
| std::vector< int > | states_ |
| The states taken, without intiial state. | |
| std::vector< double > | times_ |
| Times between states. The first element in array is the time between the initial state and the first state in states_. | |
| int | initialState_ |
| The initial state. | |
| double | totalTime_ |
| Total time of evolution. Typically, this is a branch length. | |
This class is used by MutationProcess to store detailed results of simulations.
Definition at line 56 of file MutationProcess.h.
| bpp::MutationPath::MutationPath | ( | const Alphabet * | alphabet, |
| int | initialState, | ||
| double | time | ||
| ) | [inline] |
Builds a new MutationPath object with initial state 'initialState' and total time 'time'.
| alphabet | The alphabet associated to the states in this path. |
| initialState | The initial state. |
| time | The total time of evolution. |
Definition at line 93 of file MutationProcess.h.
| bpp::MutationPath::MutationPath | ( | const MutationPath & | path | ) | [inline] |
Definition at line 96 of file MutationProcess.h.
| virtual bpp::MutationPath::~MutationPath | ( | ) | [inline, virtual] |
Definition at line 108 of file MutationProcess.h.
| void bpp::MutationPath::addEvent | ( | int | state, |
| double | time | ||
| ) | [inline] |
Add a new mutation event.
| state | The new state after mutation event. |
| time | The time between this mutation and previous mutation (or initial state). |
Definition at line 123 of file MutationProcess.h.
| const Alphabet* bpp::MutationPath::getAlphabet | ( | ) | const [inline] |
Definition at line 115 of file MutationProcess.h.
References alphabet_.
| void bpp::MutationPath::getEventCounts | ( | Matrix< Scalar > & | counts | ) | const [inline] |
Retrieve the number of substitution events per type of substitution.
| counts | A matrix with the same size as the alphabet. The substitution counts will be incremented according to the mutation path, which allows to efficiently sum various mutation paths with a look. |
Definition at line 155 of file MutationProcess.h.
References alphabet_, bpp::Matrix< Scalar >::getNumberOfColumns(), bpp::Matrix< Scalar >::getNumberOfRows(), bpp::Alphabet::getSize(), initialState_, and states_.
| void bpp::MutationPath::getEventCounts | ( | std::vector< Scalar > & | counts, |
| const SubstitutionRegister & | reg | ||
| ) | const [inline] |
Retrieve the number of substitution events per type of substitution, defined by a SubstitutionRegister object.
| counts | A vector with the appropriate size, as defined by SubstitutionRegister::getNumberOfSubstitutionTypes(). The substitution counts will be incremented according to the mutation path, which allows to efficiently sum various mutation paths with a look. |
| reg | The substitution register to use to categorize substitutions. |
Definition at line 174 of file MutationProcess.h.
References bpp::SubstitutionRegister::getNumberOfSubstitutionTypes(), bpp::SubstitutionRegister::getType(), initialState_, and states_.
| int bpp::MutationPath::getFinalState | ( | ) | const [inline] |
Retrieve the final state of this path.
Definition at line 191 of file MutationProcess.h.
References initialState_, and states_.
Referenced by bpp::SiteSimulationResult::addNode().
| int bpp::MutationPath::getInitialState | ( | ) | const [inline] |
Retrieve the initial state.
Definition at line 133 of file MutationProcess.h.
References initialState_.
| size_t bpp::MutationPath::getNumberOfEvents | ( | ) | const [inline] |
Retrieve the number of substitution events.
Definition at line 147 of file MutationProcess.h.
References states_.
| double bpp::MutationPath::getTotalTime | ( | ) | const [inline] |
Retrieve the total time of evolution.
Definition at line 140 of file MutationProcess.h.
References totalTime_.
| MutationPath& bpp::MutationPath::operator= | ( | const MutationPath & | path | ) | [inline] |
Definition at line 99 of file MutationProcess.h.
References alphabet_, initialState_, states_, times_, and totalTime_.
const Alphabet* bpp::MutationPath::alphabet_ [private] |
Definition at line 60 of file MutationProcess.h.
Referenced by getAlphabet(), getEventCounts(), and operator=().
int bpp::MutationPath::initialState_ [private] |
The initial state.
Definition at line 76 of file MutationProcess.h.
Referenced by getEventCounts(), getFinalState(), getInitialState(), and operator=().
std::vector<int> bpp::MutationPath::states_ [private] |
The states taken, without intiial state.
Definition at line 65 of file MutationProcess.h.
Referenced by addEvent(), getEventCounts(), getFinalState(), getNumberOfEvents(), and operator=().
std::vector<double> bpp::MutationPath::times_ [private] |
Times between states. The first element in array is the time between the initial state and the first state in states_.
Definition at line 71 of file MutationProcess.h.
Referenced by addEvent(), and operator=().
double bpp::MutationPath::totalTime_ [private] |
Total time of evolution. Typically, this is a branch length.
Definition at line 82 of file MutationProcess.h.
Referenced by getTotalTime(), and operator=().