Get data frame of inter- and intra-facility pariwise SNV distances

get_pair_types(dists, locs, pt)

Arguments

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.

Value

a data.frame of isolate pairs, their SNV distance, and labeled as either inter- or intra-facility pairs.

Examples

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)
}