Learn R Programming

Rsampletrees (version 1.0.3)

launch.sampletrees: Launches the c++ sampletrees program using arguments previously given and checked.

Description

This function performs the MCMC tree sampling by launching the c++ sampletrees program. Linking of the pre_sampletrees functions to the c++ sampletrees program is done using Rcpp package. For more information about the sampletrees program, please see the package vignette.

Usage

launch.sampletrees(args, addtrees=FALSE)

Arguments

args

An object of class `pars' with the arguments for the sampletrees run

addtrees

If TRUE, store the trees in the output object (default=FALSE)

Value

An object of class `treeoutput', which is a list made up of three components:

1) runinfo - a copy of argobj

2) rawdata

3) procdata

The component `rawdata' consists of

i

Iteration numbers of the MCMC samples

Theta

A vector of sampled theta values (mutation rate)

Rho

A vector of sampled rho values (recombination rate)

Trees

Either a string containing the name of the tree file or a list of class `multiPhylo' containing the trees (if addtrees=TRUE). See the ape package documentation for more information on the `multiPhylo' class.

The component `procdata' (processed data) is also a list, initially made up only of a matrix with the acceptance proportions for each update type. Tree statistics may be added to procdata by addTreeStat

Details

Sampletrees is a computationally intensive program. As such, it will write important MCMC output to output files as a back-up. Upon completion of the tree sampling, launch.sampletrees will read the output into R as a treeoutput object.

References

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

Examples

Run this code
# NOT RUN {
oldPath=getwd()
setwd(paste(path.package("Rsampletrees"),"/extdata/",sep=""))
runpars=readArgs("example_h_pars")
runtree=launch.sampletrees(runpars)
setwd(oldPath)
# }

Run the code above in your browser using DataLab