minorAlleleFrequency: Functions for Working with Minor Allele Frequencies

Description Usage Arguments Value Examples

Description

These functions estimate the minor allele frequency, remove SNPs from a dataset if they do not meet a minior allele frequency threshold, and plot a histogram of minor allele frequencies.

Usage

1
2
3
minorAlleleFrequency(SNPmat)
filterSNPs(SNPmat, minMAF = 0.05)
mafHist(SNPmat)

Arguments

SNPmat

A numeric matrix of 0, 1, 2, with individuals in rows and SNPs in columns.

minMAF

A number indicating the minimum minor allele frequency of SNPs to retain in the dataset.

Value

minorAlleleFrequency returns a vector of minor allele frequencies. filterSNPs returns a matrix in the same format as SNPmat, but with SNPs removed if they did not meet the threshold. minMAF returns nothing but plots a histogram.

Examples

1
2
3
4
5
6
7
# set up a dataset for this example
mySNP <- matrix(sample(c(0, 1, 2), 64, replace = TRUE), nrow = 8, ncol = 8)

# run functions
minorAlleleFrequency(mySNP)
filterSNPs(mySNP)
mafHist(mySNP)

lvclark/SNPfreq documentation built on May 31, 2019, 1:57 p.m.