## Not run:
# library(org.Dm.eg.db)
# library(KEGG.db)
# ##load data for enrichment analyses
# data("KcViab_Data4Enrich")
# ##select hits
# hits <- names(KcViab_Data4Enrich)[which(abs(KcViab_Data4Enrich) > 2)]
# ##set up a list of gene set collections
# PW_KEGG <- KeggGeneSets(species = "Dm")
# gscList <- list(PW_KEGG = PW_KEGG)
# ##create an object of class 'GSCA'
# gsca <- new("GSCA", listOfGeneSetCollections=gscList, geneList =
# KcViab_Data4Enrich, hits = hits)
# ##print summary of gsca
# summarize(gsca)
# ##do preprocessing (KcViab_Data4Enrich has already been preprocessed)
# gsca <- preprocess(gsca, species="Dm", initialIDs = "Entrez.gene",
# keepMultipleMappings = TRUE, duplicateRemoverMethod = "max",
# orderAbsValue = FALSE)
# ##print summary of gsca again
# summarize(gsca)
# ##do hypergeometric tests and GSEA
# gsca <- analyze(gsca, para = list(pValueCutoff = 0.05, pAdjustMethod
# = "BH", nPermutations = 1000, minGeneSetSize = 100, exponent = 1))
# ##print summary of results
# summarize(gsca, what="Result")
# ##plot all significant gene sets
# plotGSEA(gsca, gscs=c("PW_KEGG"), allSig=TRUE, filepath=".", output=
# "pdf", width=8, height=8)
# ## End(Not run)
Run the code above in your browser using DataLab