library(GWASdata)
data(illuminaScanADF)
scanAnnot <- illuminaScanADF
# exclude duplicated subjects
scan.exclude <- scanAnnot$scanID[scanAnnot$duplicated]
# create some variables for the scans
scanAnnot$sex <- as.factor(scanAnnot$sex)
scanAnnot$age <- rnorm(nrow(scanAnnot), mean=40, sd=10)
scanAnnot$event <- rbinom(nrow(scanAnnot), 1, 0.4)
scanAnnot$ttoe <- rnorm(nrow(scanAnnot), mean=100, sd=10)
# create data object
gdsfile <- system.file("extdata", "illumina_geno.gds", package="GWASdata")
gds <- GdsGenotypeReader(gdsfile)
genoData <- GenotypeData(gds, scanAnnot=scanAnnot)
res <- assocCoxPH(genoData,
event="event", time.to.event="ttoe",
covar=c("sex", "age"),
scan.exclude=scan.exclude,
snpStart=1, snpEnd=100)
close(genoData)
Run the code above in your browser using DataLab