estimateNe: Estimate Effective Population Size

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/estne.R

Description

estimateNe estimates the effective population size (Ne) based on temporal allele frequency changes.

Usage

1
estimateNe(p0, pt, cov0, covt, t, ploidy = 2, truncAF = NA, method = "P.planI", Ncensus = NA, poolSize = rep(Ncensus, times = 2), asList = FALSE)

Arguments

p0

numeric vector of relative starting allele frequencies (0 <= p0 <= 1).

pt

numeric vector of relative allele frequencies after t generations (0 <= pt <= 1).

cov0

numeric vector of sequencing coverage at the first time point.

covt

numeric vector of sequencing coverage at the second time point.

t

integer specifying the number of generations between the two allele frequency measurements.

ploidy

integer specifying the ploidy of the organisms in the population. Diploids (ploidy = 2) are the default.

truncAF

numeric indicating whether SNPs with extreme allele frequencies should be excluded from Ne estimation, see checkSNP.

method

character vector defining the method(s) that should be used to estimate Ne. Possible values include "P.planI", "P.planII", "JR.planI", "JR.planII", "W.planI" and "W.planII", see 'Details'.

Ncensus

integer specifying the census population size, which is required only if method contains planI estimators.

poolSize

numeric vector of length 2 indicating the number of individuals pooled at the first and second time point. If the entire population has been subjected to Pool-seq (default) then poolSize = rep(Ncensus, times=2), see 'Details'.

asList

logical asking whether the estimates should be returned as a list. By default (asList = FALSE) a named vector is returned.

Details

Different moment-based methods to estimate short-term Ne based on allele frequency changes between temporal samples are available. All estimators, whose names are passed on to method will be applied. Plan I methods assume that individuals are sampled after reproduction or returned to the population after determining their genotypes, which results in a correlation of allele frequencies between the two sampling time points. An estimate of the census population size Ncensus is required.

In contrast, under plan II scenarios individuals are sampled before reproduction and their genotypes do not contribute to the next generation. Alleles frequencies at the two sampling time points will be uncorrelated and can be treated as two independent binomial samples.

Based on these two sampling schemes for individuals, estimators suggested by Waples 1989 ("W.planI" and "W.planII"), Jorde & Ryman 2007 ("JR.planI" and "JR.planII") and Jónás et al. ("P.planI" and "P.planII") are implemented. The latter are specifically design for application to Pool-seq data and, unlike the others, account for the two stage sampling process associated with such data.

The two sampling steps invovled in Pool-seq are: (i) individuals are drawn from the population without replacement (poolSize); (ii) reads are sampled out of the DNA pool (cov0 and covt). Please note that all two-step sampling estimators require poolSize to be specified and unequal to NA.

In addition to the estimators mentioned above, Andreas Futschik suggested alternative estimators for one-step sampling ("P.alt.1step.planII") and two-step sampling ("P.alt.2step.planI" and "P.alt.2step.planII") that can be applied to Pool-seq data.

Value

estimateNe returns either a named vector (default) or a list (if asList = TRUE) containing estimates of Ne applying all the different method(s) specified in method.

Author(s)

Thomas Taus & Ágnes Jónás

References

Waples R. S.: A generalized approach for estimating effective population size from temporal changes in allele frequency, Genetics 1989, 121, 379–391.

Jorde P. E. and Ryman N.: Unbiased estimator for genetic drift and effective population size, Genetics 2007, 177 927–935.

Jónás A., Taus T., Kosiol C., Schlötterer C. & Futschik A.: Estimating effective population size from temporal allele frequency changes in experimental evolution, manuscript in preparation.

See Also

wf.traj, sample.alleles, checkSNP and estimateWndNe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# simulate allele frequency trajectories of individual loci using the Wright-Fisher model
Ne <- 1000
alleleFreqs <- wf.traj(p0=runif(10000, 0, 1), Ne=Ne, t=c(0, 10, 20))
head(alleleFreqs)

# introduce sampling error to mimic Pool-seq data
# draw 300 individuals from a population of 1,000 diploid individuals
beg <- sample.alleles(alleleFreqs[,"F0"], size=300, Ncensus=1000, mode="individuals")
end <- sample.alleles(alleleFreqs[,"F20"], size=300, Ncensus=1000, mode="individuals")
# sample reads out of the DNA pool at a sequencing coverage of 100X
beg <- sample.alleles(beg, size=100, mode="coverage")
end <- sample.alleles(end, size=100, mode="coverage")

# estimate Ne after 20 generations using different methods
estNe <- estimateNe(p0=beg$p.smpld, pt=end$p.smpld, cov0=beg$size, covt=end$size, t=20, method=c("P.planI", "JR.planI", "W.planI"), Ncensus=Ne, poolSize=c(300, 300))
estNe

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