# 25 patients, none lost to followup
followup <- rep(1, 25)
# first 5 patients have good survival (in days)
time <- c(25, 27, 24, 21, 26, sample(1:3, 20, TRUE))*365
# create data for 100 genes, 25 patients
dat <- matrix(rnorm(25*100), nrow=25, ncol=100)
colnames(dat) <- as.character(1:100)
# borderline significant saps score
saps_score <- 1.3
rankedGenes <- rankConcordance(dat, time, followup)[,"z"]
q_value <- calculateQValue(dat, 5, time, followup, saps_score, random.samples=100,
qvalue.samples=10, cpus=1, gsea.perm=1000, rankedGenes)
q_value$q_value
random_scores <- abs(q_value$random_saps_scores)
hist(random_scores)
length(random_scores[random_scores > saps_score])
Run the code above in your browser using DataLab