Question: Get Parent GO Term for all GO Terms in a Vector?
0
gravatar for areyoujokingme
3.4 years ago by
United States
areyoujokingme60 wrote:

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)

ontology go dag parent • 1.3k views
ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by areyoujokingme60
1
gravatar for areyoujokingme
3.4 years ago by
United States
areyoujokingme60 wrote:

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 COMMENTlink written 3.4 years ago by areyoujokingme60
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1211 users visited in the last hour