.maf {hsphase} | R Documentation |
Calculate Minor Allele Frequency (MAF)
Description
This function calculates the minor allele frequency (MAF) for a given single nucleotide polymorphism (SNP) data. The SNP data should be coded numerically: 0 for homozygous for the first allele (AA), 1 for heterozygous (AB), and 2 for homozygous for the second allele (BB). Missing data should be coded as 9.
Usage
.maf(snp)
Arguments
snp |
A numeric vector representing the genotype of individuals for a single SNP. The genotype should be coded as 0 for AA, 1 for AB, and 2 for BB. Use 9 to represent missing data. |
Value
A numeric value representing the minor allele frequency (MAF) for the SNP data provided.
Examples
snp_data <- c(0, 0, 1, 2, 2, 9)
maf_value <- .maf(snp_data)
print(maf_value)
[Package hsphase version 2.0.3 Index]