Identify the phylogenetic nearest neighbor of a tip
Source:R/nearest_neighbor_algorithm.R
nearest_neighbor_algorithm.Rd
This function uses phylogenetics to identify an isolate's nearest neighbor.
Usage
nearest_neighbor_algorithm(
isolate,
tip_name_variable,
phylogenetic_distance,
variant_distance,
metadata,
annotate = NULL,
variables_of_interest = NULL,
comparison = NULL,
comparison_feature = NULL
)
Arguments
- isolate
Isolate of interest
- tip_name_variable
Name of variable containing tip names in the dataframe (metadata). Tip name variable must correspond to tip names in the tree.
- phylogenetic_distance
Matrix of phylogenetic distance
- variant_distance
Matrix with secondary distance measure, presumably SNPs. This is OPTIONAL. If not specified, the first entry will be gathered (OPTIONAL)
- metadata
Dataframe with trait and variables of interest
- annotate
Boolean (TRUE/FALSE) indicating if annotation is necessary
- variables_of_interest
Variables found in the metadata
- comparison
Boolean (TRUE/FALSE) indicating whether to focus on isolates with/without a trait
- comparison_feature
Name of variable to compare.