Learn R Programming

SNPRelate (version 1.6.4)

snpgdsSNPRateFreq: 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)

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 sample and SNP IDs

Value

Return a list:
AlleleFreq
allele frequencies
MinorFreq
minor allele frequencies
MissingRate
missing rates
sample.id
sample id, if with.id=TRUE
snp.id
SNP id, if with.id=TRUE

See Also

snpgdsSampMissRate

Examples

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

RV <- snpgdsSNPRateFreq(genofile)
hist(RV$AlleleFreq, breaks=128)
summary(RV$MissingRate)

# close the file
snpgdsClose(genofile)

Run the code above in your browser using DataLab