boot: Estimate of confidence intervals of molecular clock...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/boot.R

Description

If the original treedater fit estimated the root position, root position will also be estimated for each simulation, so the returned trees may have different root positions. Some replicates may converge to a strict clock or a relaxed clock, so the parameter estimates in each replicate may not be directly comparable. It is possible to compute confidence intervals for the times of particular nodes or for estimated sample times by inspecting the output from each fitted treedater object, which is contained in the $trees attribute.

Usage

1
2
3
boot(td, tres, ncpu = 1, searchRoot = 1,
  overrideTempConstraint = TRUE, overrideClock = NULL, quiet = TRUE,
  normalApproxTMRCA = FALSE, parallel_foreach = FALSE)

Arguments

td

A fitted treedater object

tres

A list or multiPhylo with bootstrap trees with branches in units of substitutions per site

ncpu

Number of threads to use for parallel computation. Recommended.

searchRoot

See *dater*

overrideTempConstraint

If TRUE (default) will not enforce positive branch lengths in simualtion replicates. Will speed up execution.

overrideClock

May be 'strict' or 'additive' or 'relaxed' in which case will force simulations to fit the corresponding model. If ommitted, will inherit the clock model from td

quiet

If TRUE will minimize output printed to screen

normalApproxTMRCA

If TRUE will use estimate standard deviation from simulation replicates and report confidence interval based on normal distribution

parallel_foreach

If TRUE will use the foreach package for parallelization. May work better on HPC systems.

Value

A list with elements

Author(s)

Erik M Volz <erik.volz@gmail.com>

See Also

dater parboot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# simulate a tree 
tre <- ape::rtree(25)
# sample times based on distance from root to tip:
sts <- setNames( ape::node.depth.edgelength( tre )[1:ape::Ntip(tre)], tre$tip.label)
# make a list of trees that simulate outcome of bootstrap using nonparametric phylogeny estimation
# also modify edge length to represent evolutionary distance with rate 1e-3:
bootTrees <- lapply( 1:25, function(i) {
	.tre <- tre
	.tre$edge.length <- tre$edge.length * pmax(rnorm( length(tre$edge.length), 1e-3, 1e-4 ), 0 )
	.tre 
})
tre$edge.length <- tre$edge.length * 1e-3
# run treedater
td <- dater( tre, sts, s= 1000, clock='strict', omega0=.0015  )
# bootstrap: 
( tdboot <- boot( td, bootTrees ) )
# plot lineages through time :
plot( tdboot )

emvolz-phylodynamics/treedater-dev documentation built on Jan. 28, 2020, 6:05 p.m.