Skip to contents

Transmission cluster detection algorithms

A collection of algorithms for detecting transmission clusters in epidemiological data.

get_tn_clusters_snp_thresh()
Cluster isolates using a hard SNP distance cutoff
get_tn_clusters_sv_index()
Identify transmission clusters based on the number of shared variants

Statistics

Functions for statistical analysis of transmission clustering results.

cluster_pairwise_distances()
Compute intra-cluster SNP-distance summaries
cluster_inter_distances()
Compute per-cluster nearest-neighbor SNP distances
compute_genetic_distances_by_cluster()
Compute genetic distances by cluster
intra_cluster_duration_metrics()
Compute intra-cluster duration metrics
compute_duration_metrics_by_cluster()
Compute duration metrics by cluster

Cluster comparison

Functions for comparing different cluster assignments using contingency tables, information-theoretic measures, and source concordance.

cluster_contingency_table()
Create a contingency table from two cluster assignments
adjusted_mutual_information()
Compute the adjusted mutual information from cluster assignments
ami_from_contingency()
Compute the adjusted mutual information from a contingency table
adjusted_rand_index()
Compute the adjusted Rand index from cluster assignments
ari_from_contingency()
Compute the adjusted Rand index from a contingency table
fraction_convert_same_source()
Compute the fraction of converts with the same source across cluster assignments
fraction_convert_same_source_from_lookups()
Compute the fraction of converts with the same source from isolate lookups

Epidemiological overlap analysis

Functions for analyzing patient overlap within and between transmission clusters, and categorizing clusters by epidemiological patterns.

isolate_isolate_overlap()
Calculate isolate-isolate co-location overlap
isolate_isolate_sequential_overlap()
Calculate isolate-isolate sequential overlap
cluster_isolate_overlap()
Summarize isolate overlap within each cluster
fraction_convert_events_with_overlap()
Calculate the fraction of convert events with overlap
categorize_cluster_overlap()
Categorize cluster overlap
flatten_cluster_overlap_categorization()
Flatten cluster-overlap categorization to a data frame
cluster_overlap_perm_test()
Permutation test for cluster overlap fractions
cluster_patient_categorization()
Categorize patients within clusters by epidemiological status
flatten_cluster_patient_categorization()
Flatten cluster-patient categorization to a data frame

Utilities

A collection of utility functions for this package.

get_snp_dist_matrix()
Compute a pairwise SNP distance matrix from a DNA alignment
get_phylo_tree()
Build a phylogenetic tree by neighbor-joining or maximum parsimony
get_isolate_lookup()
Create a lookup table for isolates along with their cluster assignments
get_non_single_patient_clusters()
Get clusters containing more than one patient
remove_singleton_clusters()
Remove singleton clusters from a vector of cluster assignments