Learn R Programming

hsphase (version 3.0.0)

.maf: 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)

Value

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

Arguments

snp

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

Examples

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

Run the code above in your browser using DataLab