minorAlleleFrequency: Functions to Work on Minor Allele Frequencies

Description Usage Arguments Value Author(s) Examples

View source: R/SNPfreq_functions.R

Description

Functions will estimate minor allele frequencies. They will also remove SNPs if they dont meet the treshold 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.

Author(s)

L. Clark, revised by RJ Twohey

Examples

1
2
3
4
5
6
# 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)

rj2E/Lab-9-package documentation built on May 21, 2019, 4:06 a.m.