Description Usage Arguments Value Examples
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.
1 2 3 | minorAlleleFrequency(SNPmat)
filterSNPs(SNPmat, minMAF = 0.05)
mafHist(SNPmat)
|
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. |
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.