Skip to contents

R arm of morie.fn.hetlc and mmaxn. Hetlc: per-marker observed heterozygosity, expected heterozygosity 2p(1 - p) and per- individual heterozygous-locus frequency for 0/1/2 genotypes (NA skipped). Mmaxn: min-max normalisation onto the unit interval, column-wise for matrices.

Usage

Hetlc(marker_matrix)

Mmaxn(x)

Arguments

marker_matrix

Genotypes coded 0, 1, 2 (individuals by markers).

x

Vector or matrix.

Value

A named list (the Python result's fields).

References

Nei, M. (1973). Analysis of gene diversity in subdivided populations. PNAS 70, 3321-3323.

Montesinos Lopez, O. A., Montesinos Lopez, A. and Crossa, J. (2022). Multivariate Statistical Machine Learning Methods for Genomic Prediction. Springer.

Examples

Hetlc(rbind(c(0, 1, 2), c(1, 1, 2), c(2, 0, 1)))$H_exp
#> [1] 0.5000000 0.4444444 0.2777778
Mmaxn(c(2, 4, 3, 10))$x_norm
#> [1] 0.000 0.250 0.125 1.000