##example 1
gl <- runif(100, min=0, max=5)
gl <- order(gl)
names(gl) <- as.character(sample(x=seq(from=1, to=100, by=1), size=100,
replace=FALSE))
gs1 <- sample(names(gl), size=20, replace=FALSE)
gs2 <- sample(names(gl), size=20, replace=FALSE)
gsc <- list(subset1=gs1, subset2=gs2)
hypgeo <- hyperGeoTest(geneSet=gsc[["subset1"]], universe=names(gl),
hits=names(gl)[which(abs(gl) > 2)])
##example 2
library(org.Dm.eg.db)
library(KEGG.db)
##load phenotype vector (see the vignette for details about the
##preprocessing of this data set)
data("KcViab_Data4Enrich")
##Prepare kegg gene sets
DM_KEGG<-KeggGeneSets(species="Dm")
##Do the tests
hypgeoResults <- hyperGeoTest(geneSet=DM_KEGG[[1]], universe=
names(KcViab_Data4Enrich), hits=names(KcViab_Data4Enrich)[which(abs(
KcViab_Data4Enrich) > 2)])
Run the code above in your browser using DataLab