# The following example would take the output from association tests run on chromosome 22 using assocTestRegression
# and perform the Fisher's Exact Test on those that were monomorphic in either the cases or the controls.
# The output would be saved as "chr22test.FisherExact.RData"
# run assocTestRegression
library(GWASdata)
data(illuminaScanADF)
scanAnnot <- illuminaScanADF
gdsfile <- system.file("extdata", "illumina_geno.gds", package="GWASdata")
gds <- GdsGenotypeReader(gdsfile)
genoData <- GenotypeData(gds, scanAnnot=scanAnnot)
mydat <- assocTestRegression(genoData, outcome="status",
model.type="logistic", chromosome.set=22)
# subset rows of those SNPs that are monomorphic in cases or controls; keep all columns
mono.dat <- mydat[which(mydat$model.1.additive.warningOrError == 0 |
mydat$model.1.additive.warningOrError ==1),]
# perform the Fisher's Exact Test
assocTestFisherExact(dat = mono.dat, outfile = "chr22test")
# load the output
outfile <- "chr22test.FisherExact.RData"
fisher.res <- getobj(outfile)
head(fisher.res)
unlink(outfile)
close(genoData)
Run the code above in your browser using DataLab