asymptoticMKT: Asymptotic MKT method

Description Usage Arguments Details Value Examples

View source: R/asymptoticMKT.R

Description

MKT calculation using asymptoticMK method (Messer and Petrov 2012 PNAS; Haller and Messer 2017 G3)

Usage

1
asymptoticMKT(daf, divergence, xlow, xhigh, seed)

Arguments

daf

data frame containing DAF, Pi and P0 values

divergence

data frame containing divergent and analyzed sites for selected (i) and neutral (0) classes

xlow

lower limit for asymptotic alpha fit

xhigh

higher limit for asymptotic alpha fit

seed

seed value (optional). No seed by default

Details

In the standard McDonald and Kreitman test, the estimate of adaptive evolution (alpha) can be easily biased by the segregation of slightly deleterious non-synonymous substitutions. Specifically, slightly deleterious mutations contribute more to polymorphism than they do to divergence, and thus, lead to an underestimation of alpha. Messer and Petrov proposed a simple asymptotic extension of the MK test that yields accurate estimates of alpha. Briefly, this method first estimates alpha for each DAF category using its specific Pi and P0 values and then fits an exponential function to this values, of the form: alpha Fit(x) = a + b exp(-cx). Although the exponential function is generally expected to provide the best fit, a linear function is also fit to the data, of the form: alpha Fit(x) = a + bx. Finally, the asymptotic alpha estimate is obtained by extrapolating the value of this function to x = 1: alpha Asymptotic = alpha Fit (x=1). The exponential fit is always reported, except if the exponential fit fails to converge or if the linear fit is superior according to AIC. The code of this function is adapted from Haller and Messer 2017 G3 (http://github.com/MesserLab/asymptoticMK).

Value

Estimation of asymptotic alpha and details about the model fit (function parameters, confidence intervals, etc.)

Examples

1

sergihervas/iMKT documentation built on May 3, 2019, 1:49 p.m.