Entering edit mode
Johannes Graumann
▴
130
@johannes-graumann-2056
Last seen 10.2 years ago
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)
}