minorAlleleFrequency: Function to calculate Minor Allele Frequency from SNPs

Description Usage Arguments Value Note Author(s) Examples

Description

This package calculates minor allele frequencies

Usage

1
2
3
4
minorAlleleFrequency(SNPmat)

filterSNPs(SNPmat, minMAF = 0.05)
mafHist(SNPmat)

Arguments

SNPmat
minMAF

This sets the minimum minor allele frequency, commonly 0.05

Value

minorAlleleFrequency returns a vector of allele frequencies filterSNPs returns a SNP matrix in the same format as SNPmat but with columns removed for SNPs with very rare alleles mafHis draws a histogram plot of the MAF and does not return anything

Note

Most of this code was provided by Lindsay Clark

Author(s)

Lucas Roberts

Examples

1
2
3
4
5
6
7
8
9
SNPmat <- matrix(1:9, nrow = 3, ncol = 3)

function (SNPmat) 
{
    maf <- colMeans(SNPmat, na.rm = TRUE)/2
    common <- which(maf > 0.5)
    maf[common] <- 1 - maf[common]
    return(maf)
  }

lucasmr2/SNPfreqfun documentation built on May 21, 2019, 4:06 a.m.