maf {vcfR} | R Documentation |
Minor allele frequency
Description
Calculate the minor (or other) allele frequency.
Usage
maf(x, element = 2)
Arguments
x |
an object of class vcfR or chromR |
element |
specify the allele number to return |
Details
The function maf() calculates the counts and frequency for an allele. A variant may contain more than two alleles. Rare alleles may be true rare alleles or the result of genotyping error. In an attempt to address these competing issues we sort the alleles by their frequency and the report statistics based on their position. For example, setting element=1 would return information about the major (most common) allele. Setting element=2 returns information about the second allele.
Value
a matrix of four columns. The first column is the total number of alleles, the second is the number of NA genotypes, the third is the count and fourth the frequency.