boot_trees: Wrapper function for bootstrapped trees: reproducibly & in...

boot_treesR Documentation

Wrapper function for bootstrapped trees: reproducibly & in parallel

Description

Wrapper function for bootstrapped trees: reproducibly & in parallel

Usage

boot_trees(
  id_case,
  id_biter,
  y_coord,
  x_coord,
  owned,
  date_symptoms,
  days_uncertain,
  lineages = NULL,
  exclude_progen = FALSE,
  use_known_source = FALSE,
  prune = TRUE,
  si_fun,
  dist_fun,
  cutoff = 0.95,
  params,
  min_time = 1e-06,
  N = 1,
  seed = 1245,
  exp_funs = NULL,
  exp_pkgs = c("data.table", "treerabid", "igraph")
)

Arguments

id_case

id of case

id_biter

id of biter (i.e. known biter from contact tracing data, if unknown should be 0, if no contact tracing data, can pass NULL)

y_coord

y coordinate of case (should be in UTM: to do = use haversine distance for long/lat)

x_coord

x coordinate of case (should be in UTM: to do = use haversine distance for long/lat)

owned

whether animal is owned or not (per Katie, to account for uncertainty in case locations)

date_symptoms

case date (i.e. date symptoms started)

days_uncertain

uncertainty in days around case date

lineages

a data table with two columns, id_case and lineage, designating a lineage assignment for each case, defaults to NULL which means trees wont be resolved to a phylogeny

exclude_progen

boolean of length id_case or 1, if TRUE then case should be excluded as a potential progenitor (i.e. if including livestock cases or other species that are dead-end transmissions)

use_known_source

whether to assign known progenitors from contact tracing data

prune

whether to prune links (i.e. based on Cori et al./Mancy et al.) at a certain cutoff probability. This also results in assignment of incursions

si_fun

the function to get the probability of a given temporal difference between cases in days (i.e. the serial interval)

dist_fun

the function to get the probability of a given spatial difference between cases in meters (i.e. the dispersal kernel)

cutoff

the probability level at which to prune links (i.e. cases can not be linked if the distance or time difference is greater than the this %ile of the distribution); can either be a single number or a named vector with a cutoff called "dist" and "time"

params

list of parameters to pass to si_fun and dist_fun

min_time

if uncertainty results in negative time difference between known case pairs, set it to this value (better way to deal with propagating uncertainty given known case pairs?)

N

number of trees to build

seed

seed to pass to doRNG to make trees reproducible

exp_funs

functions to export to foreach loop (i.e. for customized si_fun/dist_fun which relies on an external scripts), may be needed for certain types of cluster configs

exp_pkgs

packages to export to foreach loop, defaults to data.table and treerabid, if other dependencies for si_fun or dist_fun, then pass here. May be needed for certain types of cluster configs

Value

a data.table with bootstrapped trees


mrajeev08/treerabid documentation built on Oct. 15, 2024, 12:14 p.m.