plot.treeoutput: Plot selected output of a sampletrees run

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/post_sampletrees.R

Description

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.

Usage

1
2
3
## S3 method for class 'treeoutput'
plot(x, oneperpage = FALSE, asktoplot = FALSE, layoutmat = NULL, 
	statnames = NULL, ...)

Arguments

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.

Details

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.

Value

The three or more plots are plotted in the graphics window.

Author(s)

Kelly Burkett

References

Burkett KM, McNeney B, Graham J. Sampletrees and Rsampletrees: sampling gene genealogies conditional on SNP genotype data. Bioinformatics. 32:1580-2, 2016

See Also

layout

Examples

 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)

#}

Rsampletrees documentation built on March 3, 2020, 1:07 a.m.