Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/post_sampletrees.R
This function produces the following plots:
1) Barchart giving the acceptance proportions for each update type
2) Traceplot of mutation rate (theta)
3) Traceplot of recombination rate (rho)
If tree statistics have been computed on the sampled trees, traceplots of the tree statistics will also be produced.
1 2 3 |
x |
An object of class ‘treeoutput’ containing the settings and output from a sampletrees run |
oneperpage |
Only one plot per page (Optional) |
asktoplot |
Plots are printed to screen after hitting enter (Optional) |
layoutmat |
A matrix giving the layout for the plots on the page. This is passed to the layout() function (Optional) |
statnames |
Names for the tree statistics for plotting. |
... |
Other arguments to be passed to plot. |
The acceptance proportions for update types 1,2, and 4-7 are the number of accepted changes divided by the number of times a given update was performed. Update type 3 proposes changes to each node of the tree in turn. The acceptance proportion for update type 3 is therefore the average of the proportion of nodes that have an update accepted.
The three or more plots are plotted in the graphics window.
Kelly Burkett
Burkett KM, McNeney B, Graham J. Sampletrees and Rsampletrees: sampling gene genealogies conditional on SNP genotype data. Bioinformatics. 32:1580-2, 2016
layout
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 26 27 28 29 | #\dontrun{
require(ape)
mrca.age=function(tree)
{
return(coalescent.intervals(tree)$total.depth)
}
#system.file("Examples/example_g_pars", package="Rsampletrees")
filename=paste(path.package("Rsampletrees"),"/extdata/example_g_pars",sep="")
runpars=readArgs(filename, check=FALSE)
# Must change the path so that the output can be found
#paste(system.file(package="Rsampletrees"),runpars$RunName, sep="/")
runname=paste(path.package("Rsampletrees"),"extdata",runpars$RunName,sep="/")
runpars=changeArgs(runpars, RunName=runname)
# Read in the output
results=readOutput(argob=runpars)
# Plot the output
plot(results)
plot(results, layoutmat=matrix(c(1,1,2,3),byrow=TRUE,nrow=2))
plot(results, oneperpage=TRUE, asktoplot=TRUE)
# Add a tree statistic
results=addTreeStat(results, myfunc=mrca.age, funcname="Time.to.MRCA")
plot(results)
#}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.