# create data object
library(GWASdata)
data(illuminaScanADF, illuminaSnpADF)
xyfile <- system.file("extdata", "illumina_qxy.gds", package="GWASdata")
xy <- GdsIntensityReader(xyfile)
xyData <- IntensityData(xy, scanAnnot=illuminaScanADF, snpAnnot=illuminaSnpADF)
genofile <- system.file("extdata", "illumina_geno.gds", package="GWASdata")
geno <- GdsGenotypeReader(genofile)
genoData <- GenotypeData(geno, scanAnnot=illuminaScanADF, snpAnnot=illuminaSnpADF)
# select first 9 snps
snpID <- illuminaSnpADF$snpID[1:9]
rsID <- illuminaSnpADF$rsID[1:9]
par(mfrow=c(3,3)) # plot 3x3
genoClusterPlot(xyData, genoData, snpID=snpID, main.txt=rsID)
# select samples
scan.sel <- illuminaScanADF$scanID[illuminaScanADF$race == "CEU"]
genoClusterPlot(xyData, genoData, snpID=snpID, main.txt=rsID,
scan.sel=scan.sel, by.sex=TRUE)
genoClusterPlot(xyData, genoData, snpID=snpID, main.txt=rsID,
scan.hilite=scan.sel)
close(xyData)
close(genoData)
## affy data - cluster plots by plate
data(affyScanADF, affySnpADF)
xyfile <- system.file("extdata", "affy_qxy.nc", package="GWASdata")
xy <- NcdfIntensityReader(xyfile)
xyData <- IntensityData(xy, scanAnnot=affyScanADF, snpAnnot=affySnpADF)
genofile <- system.file("extdata", "affy_geno.nc", package="GWASdata")
geno <- NcdfGenotypeReader(genofile)
genoData <- GenotypeData(geno, scanAnnot=affyScanADF, snpAnnot=affySnpADF)
# select first 9 snps
snpID <- affySnpADF$snpID[1:9]
rsID <- affySnpADF$rsID[1:9]
genoClusterPlotByBatch(xyData, genoData, snpID=snpID, main.txt=rsID,
batchVar="plate")
close(xyData)
close(genoData)
Run the code above in your browser using DataLab