restartRun: Set up a settings object for continuing a previous...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/pre_sampletrees.R

Description

This function is used to initialize settings in order to restart a sampletrees run. The initial values for theta, rho and the initial tree are taken from the final sampled values of a previous sampletrees run.

Usage

1
2
restartRun(newrunname, oldargs = NULL, argfile = NULL, extrait = NULL, 
totalsamples = NULL)

Arguments

newrunname

The name to associate with the new run. Output files will have this run name as prefix

oldargs

An object of class ‘pars’ with the settings for the previous sampletrees run

argfile

The name of the settings file used for the previous sampletrees run

extrait

The number of additional iterations desired

totalsamples

The total number of iterations desired in the previous and new run

Details

The settings of the previous sampletrees runs can be specified in terms of the settings object or a file name. Therefore, at least one of ‘oldargs’ or 'argfile' must not be NULL.

The desired number of MCMC samples can be specified either in terms of the additional iterations to run ('extrait') or in terms of the total number of iterations desired in both the previous and new run ('totalsamples'). Therefore, at least one of 'extrait' or 'totalsamples' must not be NULL.

The settings in the new settings object are the same as the previous except:

1) The initial theta value is set to the last sampled value from the previous run

2) The initial rho value is set to the last sampled value from the previous run

3) The data for the initial tree, including the node times, internal sequence and recombination-related latent variables, are set to the last sampled values from the previous run.

Value

Returns an object of class ‘pars’ with the settings for a sampletrees run that starts where the previous run finished.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#\dontrun{

#system.file("Examples/example_h_pars",package="Rsampletrees")
filename=paste(path.package("Rsampletrees"),"/extdata/example_h_pars",sep="")
runpars=readArgs(filename, check=FALSE)

# Include path in run name so that function can find the necessary files
runname=paste(path.package("Rsampletrees"),"extdata",runpars$RunName, sep="/")
#paste(system.file(package="Rsampletrees"),runpars$RunName, sep="/")
runpars=changeArgs(runpars,RunName=runname)

newpars=restartRun("example-h-2.pars", oldargs=runpars, totalsamples=200000)

#}

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