getMAF | R Documentation |
This function calculates MAF for imputed SNP data in dosage format.
getMAF(z = NULL, noCall = 9, flip = TRUE, dosageMax = 2)
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. |
a matrix
object. First column is MAF (range 0-0.5), second column is 1 if the MAF is flipped, else 0.
Tokhir Dadaev
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.