Get Parent GO Term for all GO Terms in a Vector?
1
0
Entering edit mode
8.7 years ago

I have a vector of GOIDs that are specific GO IDs outputted from an enrichment analysis. I want to cluster my GOIDs by their parent GOID term. I used GOstats to do my enrichment analysis, and I have noticed there is an inducedTermGraph, which outputs a graphNEL object of direct children and direction parents of the GOIDs you query. If you set parents=TRUE and children=FALSE, your graph includes only parent nodes which relate to your GOID query.

However, how can I extract the node names of these parent nodes??? See code below:

gene.ids <- c(51141, 84968, 140850, 388289, 406994, 677828, 693217, 100287428, 100505685, 100506540, 101926966, 101927244, 101928659) require(RnBeads) uids <- rnb.get.annotation("genes") uids <- sort(unique(as.numeric(na.omit(unlist(sapply(unlist(uids)$entrezID, function(i) strsplit(i, split=";"))))))) params <- new("GOHyperGParams", annotation = "org.Hs.eg.db", geneIds = gene.ids, universeGeneIds = uids, ontology = "BP", conditional = TRUE, testDirection = "over") res <- tryCatch({ hyper.genes <- hyperGTest(params) }, error = function(ee) { print("Errorfests.") })

go.ids <- summary(hyper.genes)[,"GOBPID"] result <- inducedTermGraph(hyper.genes, id=go.ids, children=FALSE, parents=TRUE) nAttrs <- list() z <- attributes(result)$nodes names(z) <- nodes(result) nAttrs$label <- z plot(result, nodeAttrs=nAttrs)

go dag parent ontology • 2.6k views
ADD COMMENT
1
Entering edit mode
8.7 years ago

It turns out if you set the font.size in the graphNEL object, you can see the node names in the plot of the inducedTermGraph.

Setting font.size to >20 worked for me!

ADD COMMENT

Login before adding your answer.

Traffic: 2183 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6