Learn R Programming

GWASTools (version 1.12.2)

alleleFrequency: Allelic frequency

Description

Calculates the frequency of the A allele over the specifed scans.

Usage

alleleFrequency(genoData, scan.exclude, verbose = TRUE)

Arguments

genoData
GenotypeData object.
scan.exclude
Integer vector with IDs of scans to exclude.
verbose
Logical value specifying whether to show progress information.

Value

A matrix of allelic frequencies with snps as rows and 4 columns ("M" for males, "F" for females, "all" for all scans, "MAF" for minor allele frequency over all scans).

Details

Counts male heterozygotes on the X and Y chromosomes as missing values, and any genotype for females on the Y chromosome as missing values. A "sex" variable must be present in the scan annotation slot of genoData.

See Also

GenotypeData

Examples

Run this code
library(GWASdata)
file <- system.file("extdata", "illumina_geno.gds", package="GWASdata")
gds <- GdsGenotypeReader(file)

# need scan annotation with sex
data(illuminaScanADF)
genoData <-  GenotypeData(gds, scanAnnot=illuminaScanADF)

afreq <- alleleFrequency(genoData, scan.exclude=(illuminaScanADF$race != "CEU"))
close(genoData)

Run the code above in your browser using DataLab