alleleFrequency {GWASTools} | R Documentation

## 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.

### 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`.

Samples with missing sex are included in the allele counts for "all" and "MAF" for autosomes, but not for sex chromosomes.

### Value

A matrix with a row for each SNP. Columns "M" for males, "F" for females, and "all" for all scans give frequencies of the A allele. Sample size for males, females, and all is returned as "n.M", "n.F", and "n", respectively. "MAF" is the minor allele frequency over all scans.

### Author(s)

Cathy Laurie, Stephanie Gogarten

### See Also

`GenotypeData`

### Examples

    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)

[Package GWASTools version 1.28.0 Index]