build_tree | R Documentation |
Reconstruct transmission trees from a case line list.
build_tree(
id_case,
id_biter,
y_coord,
x_coord,
owned,
date_symptoms,
days_uncertain,
lineages = NULL,
exclude_progen = FALSE,
use_known_source = FALSE,
known_tree = NULL,
prune = TRUE,
si_fun,
dist_fun,
cutoff = 0.95,
params,
min_time = 1e-06
)
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?) |
a data.table with the reconstructed tree
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.