Last chance! 50% off unlimited learning
Sale ends in
Get the list of events having per-branch statistics recorded.
During simulation the number of events performed on every branch is recorded. The recorded events can be "basic"
events, like "insertion", "deletion" and "A->T" or events which are sums of basic events, like "substituion". The
getBranchEvents
method returns a character vector with the names of the events having per-branch
statistics recorded. The method should be called after the simulation is finished.
The per-branch statistics can be exported as phylo objects by using the exportStatTree
method.
The branch lengths of the exported phylo objects are set to the value of the respective per-branch event count.
# S3 method for PhyloSim
getBranchEvents(this, ...)
A PhyloSim object.
Not used.
A character vector.
For more information see PhyloSim
.
# NOT RUN {
# Create a PhyloSim object.
# Provide the phylo object
# and the root sequence.
# NOTE: this will be a little bit slow
sim<-PhyloSim(
phylo=rcoal(3),
root.seq=CodonSequence(
string="ATGATTATT",
processes=list(list(GY94(kappa=2,omega.default=0.5))))
);
# make the tree longer to have more events
scaleTree(sim,5)
# plot the tree
plot(sim)
# run simulation
Simulate(sim)
# get the list of recorded per-branch event counts
getBranchEvents(sim)
# export the number of subtitions as a phylo object
subst<-exportStatTree(sim,"substitution")
# plot the exported phylo object
plot(subst)
#export the number of synonymous substitutions as a phylo object
subst<-exportStatTree(sim,"nr.syn.subst")
# plot the exported phylo object
plot(subst)
# }
Run the code above in your browser using DataLab