gl.Ho: Estimates observed heterozygosity for each locus

View source: R/gl.Ho.r

gl.HoR Documentation

Estimates observed heterozygosity for each locus

Description

Calculates the observed heterozygosity at each locus, pooled across all individuals in the genlight object, as the proportion of individuals scored as heterozygous at that locus.

Usage

gl.Ho(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. For heterozygosities averaged within populations or by individual, with sample-size corrections and plots, 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 observed heterozygosity for each locus.

Author(s)

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

See Also

gl.He, gl.alf, gl.report.heterozygosity

Other utilities: gl.He(), 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.Ho(pp)

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

Related to gl.Ho in dartR.base...