library(GWASdata)
data(illuminaScanADF)
# run only on YRI subjects
scan.exclude <- illuminaScanADF$scanID[illuminaScanADF$race != "YRI"]
# create data object
gdsfile <- system.file("extdata", "illumina_geno.gds", package="GWASdata")
gds <- GdsGenotypeReader(gdsfile)
genoData <- GenotypeData(gds, scanAnnot=illuminaScanADF)
chr <- getChromosome(genoData)
# autosomal SNPs
auto <- range(which(is.element(chr, 1:22)))
hwe <- exactHWE(genoData, scan.exclude=scan.exclude,
snpStart=auto[1], snpEnd=auto[2])
# permutation
perm <- exactHWE(genoData, scan.exclude=scan.exclude,
snpStart=auto[1], snpEnd=auto[2],
permute=TRUE)
# X chromosome SNPs must be run separately since they only use females
Xchr <- range(which(chr == 23))
hweX <- exactHWE(genoData, scan.exclude=scan.exclude,
snpStart=Xchr[1], snpEnd=Xchr[2])
close(genoData)
Run the code above in your browser using DataLab