compute_timports: Computes the time of importation events using a one or more...

Description Usage Arguments Value Examples

View source: R/importations.R

Description

Time of importations is taken as the midpoing on branches separating an exogenous parent and a regional daughter; the states of nodes are determined by parsimony

Usage

1
compute_timports(tds, numpb = 100, ncpu = 6, excludeBefore = 2020)

Arguments

numpb

A number of parametric bootstrap replicates for each treedater tree.

ncpu

Number of cpus to use

excludeBefore

Removes any dates before this point (some outlier sequences merge before then (guangdong))

Value

A data frame that can be used for plotting etc. *weighted_seed_date* shows the mean and CI of the seed date weighted by number of region tips descended from that node. This gives much less weight to later introductions with few descendents.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run:  
PATT = 'Netherlands'
o1 = region_time_stratified_sample( PATT , n=50, path_to_align=algn, D = D, path_to_save='temp.fasta', nregion = Inf, time_stratify_region=TRUE)
prep_tip_labels_phydyn( 'temp.fasta'
 , regexprs = c(  PATT, PATT  ) 
 , invert_regexpr = c( FALSE, TRUE )
 , demes = c( 'Il'  , 'exog'  )
 , path_to_save = 'temp.fasta'
)
tds = make_starting_trees ( 'temp.fasta', ntres = 20, ncpu = 6, plotout=NULL )
pldf <- compute_timports( tds )
plot.importations( pldf )
X11(); plot.importationsHist( pldf )

## End(Not run)

emvolz-phylodynamics/sarscov2Rutils documentation built on Nov. 17, 2020, 9:22 a.m.