Learn R Programming

SeqVarTools (version 1.10.0)

alleleFrequency: Allele frequency

Description

Calculate allele frequency for each variant

Usage

"alleleFrequency"(gdsobj, n=0, use.names=FALSE)

Arguments

gdsobj
A SeqVarGDSClass object with VCF data.
n
An integer indicating which allele to calculate the frequency of. n=0 is the reference allele, n=1 is the first alternate allele, and so on.
use.names
A logical indicating whether to assign variant IDs as names of the output vector.

Value

A numeric vector of allele frequencies.

Details

Frequency can be calculated over any allele, specified by the argument n. Default is the reference allele frequency (n=0).

See Also

SeqVarGDSClass, applyMethod, heterozygosity

Examples

Run this code
gds <- seqOpen(seqExampleFileName("gds"))
head(alleleFrequency(gds))
head(alleleFrequency(gds, n=1))
head(alleleFrequency(gds, n=2))
seqClose(gds)

Run the code above in your browser using DataLab