With genotypes coded as allele counts (0, 1, 2), the allele frequency at
locus \(j\) is \(p_j = \sum_i x_{ij} / (2 n_j)\) over the \(n_j\)
genotyped individuals and the minor allele frequency is
\(\min(p_j, 1 - p_j)\). Missing genotypes are skipped locus by locus.
Identical to the Python arm morie.fn.mafcl.maf_calculation.
Usage
maf_calculation(marker_matrix, coding = "012")
Arguments
- marker_matrix
Individuals by loci genotype matrix (a vector is one
locus).
- coding
"012" allele counts, or "-101" for the centred
coding used by BGLR (shifted by one first).
Value
A list with maf, p, n_genotyped,
estimate (mean MAF over loci), n, n_loci and
method.
References
Montesinos Lopez, O. A., Montesinos Lopez, A. and Crossa, J.
(2022). Multivariate Statistical Machine Learning Methods for Genomic
Prediction. Springer, chapter 2.
Examples
maf_calculation(rbind(c(0, 2), c(1, 2), c(2, 1), c(0, 2)))$maf
#> [1] 0.375 0.125