Description Usage Arguments Value Author(s) See Also Examples
Detach a node hook function from a given node of a phylo object aggregated by a PhyloSim object.
1 2 | ## S3 method for class 'PhyloSim'
detachHookFromNode(this, node=NA, ...)
|
this |
A PhyloSim object. |
node |
Node identifier. |
... |
Not used. |
The PhyloSim object (invisible).
Botond Sipos, Gregory Jordan
attachHookToNode PhyloSim Simulate.PhyloSim
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Create a PhyloSim object.
# Provide the phylo object
# and the root sequence.
sim<-PhyloSim(
name="TinySim",
phylo=rcoal(3),
root.seq=NucleotideSequence(string="ATGC",processes=list(list(JC69())))
);
# create a node hook function
hook<-function(seq=NA){
# replace the substitution process with F84
if(inherits(seq,"NucleotideSequence")){
cat("Replacing JC69 with F84.\n");
seq$processes<-list(list(F84(rate.params=list("Kappa" = 2))));
}
return(seq);
}
# attach hook function to node 5
attachHookToNode(sim,5,hook);
# detach hook from node 5
detachHookFromNode(sim,5);
# Run the simulation again
Simulate(sim); # You should not see the message printed out by the "hook" function.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.