getAlleleFrequencies: Compute allele frequencies from genotype data.

Description Usage Arguments Value Examples

View source: R/genotypeFunctions.R

Description

Compute allele frequencies from genotype data.

Usage

1

Arguments

snp

[N x 1] Vector of length [N] samples with genotypes of a single bi-allelic genetic variant/SNP encoded as 0,1 and 2.

Value

Vector with ref (0-encoded) and alt (1-encoded) allele frequencies.

Examples

1
2
3
# create snp vector with minor allele frequency 0.3
snp <- rbinom(200, 2, 0.3)
allelefreq <- getAlleleFrequencies(snp)

HannahVMeyer/PhenotypeSimulator documentation built on July 19, 2021, 7:41 a.m.