gendist_distribution {phylosamp}R Documentation

Calculate genetic distance distribution

Description

Function calculates the distribution of genetic distances in a population of viruses with the given parameters

Usage

gendist_distribution(
  mut_rate,
  mean_gens_pdf,
  max_link_gens = 1,
  max_gens = NULL,
  max_dist = NULL
)

Arguments

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 is 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 is set to max_gens * 99.9th percentile of mut_rate Poisson distribution

Value

a data frame with distances and probabilities

Author(s)

Shirlee Wohl and Justin Lessler

See Also

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

Examples

# ebola-like pathogen
R <- 1.5
mut_rate <- 1

# use simulated generation distributions from the provided 'genDistSim' data object
data('genDistSim')
mean_gens_pdf <- as.numeric(genDistSim[genDistSim$R == R, -(1:2)])

# get theoretical genetic distance dist based on mutation rate and generation parameters
gendist_distribution(mut_rate = mut_rate,
                     mean_gens_pdf = mean_gens_pdf,
                     max_link_gens = 1)


[Package phylosamp version 1.0.1 Index]