R/get_pair_types.R
get_pair_types.Rd
Get data frame of inter- and intra-facility pariwise SNV distances
get_pair_types(dists, locs, pt)
dists | a SNV distance matrix returned by the dist.dna function from the ape package |
---|---|
locs | a named vector of locations of isolates (e.g. facility of isolation), with the name being the sample ID |
pt | a named vector of patients each isolate originated from, with the name being the sample ID. If this information is unavailable, set pt = NULL. |
a data.frame of isolate pairs, their SNV distance, and labeled as either inter- or intra-facility pairs.
if (FALSE) { locs <- metadata %>% dplyr::select(isolate_id, facility) %>% tibble::deframe() pt <- metadata %>% dplyr::select(isolate_id, patient_id) %>% tibble::deframe() pair_types <- get_pair_types(dists, locs, pt) }