calcThetaW: Calculate Wu and Watterson's Theta

Description Usage Arguments Details Value

View source: R/stats.R

Description

Calculate Wu and Watterson's Theta

Usage

1
calcThetaW(gt, lociDistn = NULL)

Arguments

gt

A genotype matrix with N rows and L columns, where N is the number of individuals and L is the number of loci, for which the i,jth element gives the number of the counted allele in each individual at each locus.

lociDistn

A vector of length N, for which the ith element gives the number of base pairs genotyped in exactly i individuals. E.g., the 3rd element of lociDistn gives the number of base pairs genotyped in exactly 3 individuals. Default is NULL.

Details

The data matrix gt should consist of 0s, 1s, and 2s, with missing data indicated with NA. This can be generated from a VCF file using vcf2R, and the lociDistn can be generated using getBPstats. If lociDistn is not specified, and gt consists only of polymorphic loci, this function will return Wu and Watterson's Theta at polymorphic sites, which may not be comparable across datasets.

Value

An estimate of Wu and Watterson's Theta.


gbradburd/popgenstuff documentation built on Oct. 16, 2021, 12:05 a.m.