getMAF: Calculate MAF

View source: R/getMAF.R

getMAFR Documentation

Calculate MAF

Description

This function calculates MAF for imputed SNP data in dosage format.

Usage

getMAF(z = NULL, noCall = 9, flip = TRUE, dosageMax = 2)

Arguments

z

matrix object, rows are samples, columns are SNPs, values range 0-2.

noCall

missing value for genotype, defaults to 9.

flip

default TRUE. If maf is more than 0.5, then flip 1-maf.

dosageMax

default is 2 , for chr23 use 1.

Value

a matrix object. First column is MAF (range 0-0.5), second column is 1 if the MAF is flipped, else 0.

Author(s)

Tokhir Dadaev

Examples

# dummy SNP data, 25 samples, 4 SNPs
set.seed(123)
geno <- matrix(sample(c(0, 1, 2), 100, replace = TRUE), ncol = 4)
# calculate MAF, returns 2 column matrix
getMAF(geno)

oncogenetics/oncofunco documentation built on March 9, 2024, 5:23 p.m.