gl.He: Estimates expected heterozygosity for each locus

View source: R/gl.He.r

gl.HeR Documentation

Estimates expected heterozygosity for each locus

Description

Calculates the expected heterozygosity at each locus under Hardy-Weinberg proportions, He = 2p(1-p), with the allele frequency p estimated from the mean allele dosage pooled across all individuals in the genlight object.

Usage

gl.He(gl)

Arguments

gl

A genlight object containing SNP genotypes [required].

Details

This is a silent pure accessor: it returns the per-locus vector directly (visibly), produces no console output and does not modify the input. The estimate carries no sample-size correction — for unbiased expected heterozygosity (uHe) averaged within populations, use gl.report.heterozygosity.

Loci with all genotypes missing return NaN. The function applies to SNP genotype data only.

Value

A named vector with the expected heterozygosity for each locus.

Author(s)

Author(s): Bernd Gruber. Custodian: Bernd Gruber (Post to https://groups.google.com/d/forum/dartr)

See Also

gl.Ho, gl.alf, gl.report.heterozygosity

Other utilities: gl.Ho(), gl.alf(), utils.allelic.richness(), utils.basic.stats(), utils.check.datatype(), utils.collapse.matrix(), utils.dart2genlight(), utils.dist.binary(), utils.fbm.amat(), utils.fbm.blocks(), utils.fbm.colblocks(), utils.fbm.colwise(), utils.fbm.copy(), utils.fbm.count.mean(), utils.fbm.decode(), utils.fbm.grm(), utils.fbm.has(), utils.fbm.new(), utils.fbm.pair.counts(), utils.fbm.reader(), utils.fbm.rowwise(), utils.fbm.tempfile(), utils.flag.start(), utils.het.pop(), utils.history.call(), utils.is.fixed(), utils.jackknife(), utils.n.var.invariant(), utils.plot.save(), utils.read.fasta(), utils.read.ped(), utils.recalc.avgpic(), utils.recalc.callrate(), utils.recalc.freqhets(), utils.recalc.freqhomref(), utils.recalc.freqhomsnp(), utils.recalc.maf(), utils.reset.flags(), utils.transpose(), utils.vcf.depth(), utils.vcfr2genlight.polyploid()

Examples

pp <- possums.gl[1:30,1:20]
if (isTRUE(getOption("dartR_fbm"))) pp <- gl.gen2fbm(pp)
gl.He(pp)

dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.

Related to gl.He in dartR.base...