data(exampleData)
# use the absolute correlation as a gene-level statistic
stat <- abs(apply(countdata,1,cor,y = labels))
# define the core set as the 25% genes with the highest correlation
coreSet <- rownames(countdata)[tail(order(stat), 25)]
# perform an overrepresentation analysis
resOverrep <- geneSetAnalysis(
dat = countdata,
geneSets = pathways,
analysis = analysis.customOverrepresentation(),
coreSet = coreSet,
adjustmentMethod = "fdr")
# plot a Venn diagram
plotOverrepresentation(resOverrep, subset = 1:3, aggregate = TRUE)
Run the code above in your browser using DataLab