get_pair_types: Get data frame of inter- and intra-facility pariwise SNV...

View source: R/get_pair_types.R

get_pair_typesR Documentation

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

Description

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

Usage

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

## Not run: 
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)

## End(Not run)

Snitkin-Lab-Umich/regentrans documentation built on Jan. 29, 2023, 7:45 a.m.