dot-maf: Calculate minor allele frequency (MAF)

.mafR Documentation

Calculate minor allele frequency (MAF)

Description

Calculates the minor allele frequency (MAF) for a single SNP coded as: 0 = AA, 1 = AB, 2 = BB, and 9 = missing.

Usage

.maf(snp)

Arguments

snp

A numeric vector of genotypes for one SNP. Values must be 0, 1, 2, or 9 (missing).

Value

A single numeric value: the minor allele frequency (MAF).

Examples

snp_data <- c(0, 0, 1, 2, 2, 9)
.maf(snp_data)

hsphase documentation built on Feb. 17, 2026, 5:07 p.m.