calc.het: calculate observed heterozygosity

Description Usage Arguments Value Note Examples

View source: R/gwscaR_popgen.R

Description

calculate observed heterozygosity

Usage

1
calc.het(vcf.row, pop.list = NULL)

Arguments

vcf.row

A row of a vcf file, used in conjunction with apply

pop.list

A list of population strings to search for to subset vcf (pop names must be in individual ID names)

Value

Observed heterozygosity

Note

proportion of diploid genotypes in the sample that are heterozygotes (Hohenlohe et al 2010)

Examples

1
2
3
vcf.file<-system.file("extdata", "example.vcf.txt",package = "gwscaR")
vcf<-parse.vcf(vcf.file)
all.het<-apply(vcf,1,calc.het)

spflanagan/gwscaR documentation built on Nov. 14, 2019, 9:16 p.m.