41 #ifndef _NONHOMOGENEOUSSEQUENCESIMULATOR_H_ 42 #define _NONHOMOGENEOUSSEQUENCESIMULATOR_H_ 46 #include "../TreeTemplate.h" 47 #include "../NodeTemplate.h" 48 #include "../Model/SubstitutionModel.h" 50 #include <Bpp/Numeric/Random/RandomTools.h> 51 #include <Bpp/Numeric/Prob/DiscreteDistribution.h> 54 #include <Bpp/Seq/Alphabet/Alphabet.h> 55 #include <Bpp/Seq/Site.h> 56 #include <Bpp/Seq/Container/SiteContainer.h> 62 #include "../Model/SubstitutionModelSet.h" 131 const DiscreteDistribution* rate,
137 const DiscreteDistribution* rate,
180 #ifndef NO_VIRTUAL_COV 206 Site*
simulateSite(
size_t ancestralStateIndex,
double rate)
const;
232 SiteContainer*
simulate(
size_t numberOfSites)
const;
248 virtual Site*
simulateSite(
size_t ancestralStateIndex,
size_t rateClass)
const;
290 size_t evolve(
const SNode* node,
size_t initialStateIndex,
size_t rateClass)
const;
298 size_t evolve(
const SNode* node,
size_t initialStateIndex,
double rate)
const;
307 const std::vector<size_t>& initialStateIndices,
308 const std::vector<size_t>& rateClasses,
309 std::vector<size_t>& finalStates)
const;
311 const std::vector<size_t>& initialStates,
312 const std::vector<size_t>& rateClasses)
const;
345 #endif //_NONHOMOGENEOUSSEQUENCESIMULATOR_H_
Substitution models manager for non-homogeneous / non-reversible models of evolution.
virtual ~NonHomogeneousSequenceSimulator()
Interface for all substitution models.
std::vector< int > supportedStates_
const Alphabet * alphabet_
NonHomogeneousSequenceSimulator & operator=(const NonHomogeneousSequenceSimulator &nhss)
NonHomogeneousSequenceSimulator(const SubstitutionModelSet *modelSet, const DiscreteDistribution *rate, const Tree *tree)
void init()
Init all probabilities.
size_t evolve(const SNode *node, size_t initialStateIndex, size_t rateClass) const
Evolve from an initial state along a branch, knowing the evolutionary rate class. ...
std::vector< size_t > states
const SubstitutionModelSet * getSubstitutionModelSet() const
Get the substitution model associated to this instance.
The phylogenetic tree class.
const SubstitutionModel * model
This interface adds the dSimulate method to the SiteSimulator interface.
NodeTemplate< SimData > SNode
Interface for phylogenetic tree objects.
const SubstitutionModelSet * modelSet_
SiteContainer * simulate(size_t numberOfSites) const
The SequenceSimulator interface. SequenceSimulator classes can simulate whole datasets.
SimData & operator=(const SimData &sd)
void multipleEvolveInternal(SNode *node, const std::vector< size_t > &rateClasses) const
TreeTemplate< SNode > tree_
void multipleEvolve(const SNode *node, const std::vector< size_t > &initialStateIndices, const std::vector< size_t > &rateClasses, std::vector< size_t > &finalStates) const
The same as the evolve(initialState, rateClass) function, but for several sites at a time...
const DiscreteDistribution * getRateDistribution() const
Get the rate distribution associated to this instance.
void evolveInternal(SNode *node, size_t rateClass) const
NonHomogeneousSequenceSimulator(const NonHomogeneousSequenceSimulator &nhss)
std::vector< std::string > seqNames_
const Tree * templateTree_
RASiteSimulationResult * dSimulateSite() const
Get a detailed simulation result for one site.
SimData(const SimData &sd)
const Tree * getTree() const
Get the tree associated to this instance.
std::vector< SNode * > leaves_
This stores once for all all leaves in a given order. This order will be used during site creation...
void dEvolveInternal(SNode *node, double rate, RASiteSimulationResult &rassr) const
void dEvolve(size_t initialState, double rate, RASiteSimulationResult &rassr) const
void enableContinuousRates(bool yn)
Enable the use of continuous rates instead of discrete rates.
Data structure to store the result of a DetailedSiteSimulator.
NonHomogeneousSequenceSimulator * clone() const
Site and sequences simulation under non-homogeneous models.
const Alphabet * getAlphabet() const
const DiscreteDistribution * rate_
Site * simulateSite() const
std::vector< std::string > getSequencesNames() const