estimateWndNe: Estimate Effective Population Size for Genome-Wide Data

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

View source: R/estne.R

Description

estimateNe splits the genome-wide data into non-overlapping windows of size wndSize and estimates for each window the effective population size (Ne) based on temporal allele frequency changes.

Usage

1
estimateWndNe(chr, pos, wndSize, p0, pt, cov0, covt, t, unit = c("bp", "SNP"), ploidy = 2, truncAF = NA, method = "P.planI", Ncensus = NA, poolSize = rep(Ncensus, times = 2))

Arguments

chr

vector of chromosome identifiers.

pos

numeric vector of sequence positions.

wndSize

integer indicating the window size to be used for Ne estimation. If NA, Ne will be estimated for entire chromosomes. The interpretation of this parameter dependes on how unit is specified.

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.

unit

character string indicating the unit of wndSize. Possible values are "bp" (number of base pairs) and "SNP" (number of single-nucleotide polymorphisms).

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'.

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

estimateWndNe returns an object of type data.table that contains Ne estimates for all windows of each chromosome using the method(s) specified in method. The resulting data.table contains the following columns:

Nx

Ne estimate for the current window using method x, see 'Details'.

chr

chromosome name.

wndStart
wndStop

start/stop position of the current window.

SNPs

number of SNPs within the window.

Author(s)

Thomas Taus

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

estimateNe and read.sync

Examples

1
#MISSING: use example dataset (returned after reading small sync file) and plot some results (barplot & genome-wide Ne)

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