Description Usage Arguments Details Value Author(s) References See Also Examples
estimateNe
estimates the effective population size (Ne) based on temporal allele frequency changes.
1 |
p0 |
numeric vector of relative starting allele frequencies ( |
pt |
numeric vector of relative allele frequencies after |
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 ( |
truncAF |
numeric indicating whether SNPs with extreme allele frequencies should be excluded from Ne estimation, see |
method |
character vector defining the method(s) that should be used to estimate Ne. Possible values include |
Ncensus |
integer specifying the census population size, which is required only if |
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 |
asList |
logical asking whether the estimates should be returned as a list. By default ( |
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.
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
.
Thomas Taus & Ágnes Jónás
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.
wf.traj
, sample.alleles
, checkSNP
and estimateWndNe
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.