compareSH: Compare Selection Coefficients and Dominance between...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/estsh.R

Description

compareSH tests the nullhypothesis that replicated allele frequency trajectories were generated with identical selection coefficients (s) and dominance (h).

Usage

1
2
3
4
compareSH(traj, t, Ne, haploid = FALSE, h = NA, N.ctraj = 10000, N.pval = 1000, cov = NA, method = c("LLS", "NLS", "automatic"))

## S3 method for class 'compsh'
print(x, ...)

Arguments

x

object of class "compsh" as returned by compareSH.

traj

numeric matrix of allele frequency trajectories, where columns correspond to individual time points

t

numeric vector indicating the number of generations for each column in traj.

Ne

numeric specifying the effective population size

haploid

logical indicating wether a population of haploid (haploid = TRUE) or diploid (default) individuals should be simulated.

h

numeric defining the dominance that should be assumed. If h = NA (default) dominance will be estimated alongside with the selection coefficient.

N.ctraj

numeric determining the number of simulations that should be performed to correct for bias in the consensus trajectory (by default sim = 10000).

N.pval

integer; the number of simulations performed to estimate the p-value (by default N.pval = 1000).

cov

numeric matrix of sequence coverages, where columns and rows correspond to measurement time points and replicates, respectively

method

character string defining the method that should be used to estimate s (and p0 or h).

...

currently not used.

Value

A list with class "compsh" containing the following components:

traj

matrix with observed allele frequency trajectories.

t

generations of each measurement time point.

Ne

effective population size.

haploid

logical for diploid or haploid individuals.

ctraj

consensus trajectory used to estimate s and h.

N.ctraj

number of simulations to correct 'ctraj' from bias.

s

estimated common s.

s.sep

individual estimates of s, one for each replicate.

h

if h == NA, estimated common h.

h.sep

individual estimates of h, one for each replicate.

h.given

dominance defined in h.

cov

matrix with observed sequence coverages.

s.p.value

p-value for s.

h.p.value

p-value for h.

N.pval

number of simulations to estimate p-value(s).

Author(s)

Thomas Taus

See Also

estimateSH

Examples

1
2
3
4
5
6
7
# simulate allele frequency trajectories under constant selection coefficient (and dominance)
tp <- seq(0, 100, by=10)
Ne <- 1000
traj <- wf.traj(p0=rep(0.05, times=3), Ne=Ne, t=tp, s=0.1, h=0.5, haploid=FALSE)

# test the null hypothesis that selection coefficients are identical between replicates
compareSH(traj=traj, t=tp, Ne=Ne, haploid=FALSE, N.pval = 100, h=0.5) ##### takes about 15 sec #####

ThomasTaus/poolSeq documentation built on Feb. 17, 2020, 1:52 p.m.