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

Description Usage Arguments Value Author(s) See Also Examples

View source: R/AllUtilities.R

Description

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

Usage

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)

SNPRelate documentation built on Nov. 8, 2020, 5:31 p.m.