gendist_sensspec_cutoff {phylosamp}R Documentation

Calculate sensitivity and specificity of a genetic distance cutoff

Description

Function to calculate the sensitivity and specificity of a genetic distance cutoff given an underlying mutation rate and mean number of generations between cases

Usage

gendist_sensspec_cutoff(
  cutoff,
  mut_rate,
  mean_gens_pdf,
  max_link_gens = 1,
  max_gens = NULL,
  max_dist = NULL
)

Arguments

cutoff

the maximum genetic distance at which to consider cases linked

mut_rate

mean number of mutations per generation, assumed to be Poisson distributed

mean_gens_pdf

the density distribution of the mean number of generations between cases; the index of this vector is assumed to be the discrete distance between cases

max_link_gens

the maximum generations of separation for linked pairs

max_gens

the maximum number of generations to consider, if NULL (default) value set to the highest number of generations in mean_gens_pdf with a non-zero probability

max_dist

the maximum distance to calculate, if NULL (default) value set to max_gens * 99.9th percentile of mut_rate Poisson distribution

Value

a data frame with the sensitivity and specificity for a particular genetic distance cutoff

Author(s)

Shirlee Wohl and Justin Lessler

See Also

Other genetic distance functions: gendist_distribution(), gendist_roc_format()

Examples

# calculate the sensitivity and specificity for a specific genetic distance threshold of 2 mutations
gendist_sensspec_cutoff(cutoff=2,
                        mut_rate=1,
                        mean_gens_pdf=c(0.02,0.08,0.15,0.75),
                        max_link_gens=1)

# calculate the sensitivity and specificity for a a range of genetic distance thresholds
gendist_sensspec_cutoff(cutoff=1:10,
                        mut_rate=1,
                        mean_gens_pdf=c(0.02,0.08,0.15,0.75),
                        max_link_gens=1)


[Package phylosamp version 1.0.1 Index]