snpgdsSNPRateFreq: Allele Frequency, Minor Allele Frequency, Missing Rate of...

View source: R/AllUtilities.R

snpgdsSNPRateFreqR Documentation

Allele Frequency, Minor Allele Frequency, Missing Rate of SNPs

Description

Calculate the allele frequency, minor allele frequency and missing rate per SNP.

Usage

snpgdsSNPRateFreq(gdsobj, sample.id=NULL, snp.id=NULL, with.id=FALSE,
    with.sample.id=FALSE, with.snp.id=FALSE)

Arguments

gdsobj

an object of class SNPGDSFileClass, a SNP GDS file

sample.id

a vector of sample id specifying selected samples; if NULL, all samples will be used

snp.id

a vector of snp id specifying selected SNPs; if NULL, all SNPs will be used

with.id

if TRUE, return both sample and SNP IDs

with.sample.id

if TRUE, return sample IDs

with.snp.id

if TRUE, return SNP IDs

Value

Return a list:

AlleleFreq

allele frequencies

MinorFreq

minor allele frequencies

MissingRate

missing rates

sample.id

sample id, if with.id=TRUE or with.sample.id=TRUE

snp.id

SNP id, if with.id=TRUE or with.snp.id=TRUE

Author(s)

Xiuwen Zheng

See Also

snpgdsSampMissRate

Examples

# open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())

RV <- snpgdsSNPRateFreq(genofile, with.snp.id=TRUE)
head(data.frame(RV))

hist(RV$AlleleFreq, breaks=128)
summary(RV$MissingRate)

# close the file
snpgdsClose(genofile)

zhengxwen/SNPRelate documentation built on Nov. 19, 2024, 1:02 p.m.