[BioC] AnnotationDbi Packages/hyperGTest: Possible to avoid explicit mapping back to ENTREZ IDs?
Johannes Graumann
johannes_graumann at web.de
Thu May 22 12:21:38 CEST 2008
Hi,
I build an annotation package for a mouse IPI database using "AnnotationDbi"
(IPI.MOUSE.3.37.20080509.db) and am now putting it to use.
I have a bunch of IPI-ID clusters ("SubjectiveClusters") each of which I
want to check for GO terms significantly enriched over the combined set. I
attached what I do, but was wondering whether ther's ways to do this
without having to explicitly/manually go via ENTREZ IDs. The annotation
package contains all information necessary already, no? Is there anything
more recent than "GOstats" to look at this?
Thanks, Joh
library(IPI.MOUSE.3.37.20080509.db)
library("GOstats")
# Extract all IPI to ENTREZID pairs
ENTREZIDs <- IPI.MOUSE.3.37.20080509ENTREZID
# Combine all present IPI IDs to the Universe
Universe <- unlist(SubjectiveClusters,use.names=FALSE)
# Purge IPIs not mapping to ENTREZ
Universe <- Universe[Universe %in% mappedkeys(ENTREZIDs)]
# Map universe to ENTREZ IDs
Universe <- unique(unlist(as.list(ENTREZIDs[Universe]),use.names=FALSE))
SubjectiveClustersHGT <- vector("list",0)
for(name in names(SubjectiveClusters)){
Temp.Cluster <- SubjectiveClusters[[name]]
Temp.Cluster <- Temp.Cluster[Temp.Cluster %in% mappedkeys(ENTREZIDs)]
Temp.Cluster <- unlist(as.list(ENTREZIDs[Temp.Cluster]),use.names=FALSE)
params <- new(
"GOHyperGParams",
geneIds = Temp.Cluster,
universeGeneIds = Universe,
annotation = "IPI.MOUSE.3.37.20080509.db",
ontology = "BP",
pvalueCutoff = 0.01,
conditional = TRUE,
testDirection = "over"
)
cat("HyperGTest for cluster ",name,".\n",sep="")
SubjectiveClustersHGT[[name]] <- hyperGTest(params)
}
More information about the Bioconductor
mailing list