extracting topGO gene ids from result object
1
0
Entering edit mode
Adrian Alexa ▴ 400
@adrian-alexa-936
Last seen 10.2 years ago
Hi Paul, you can obtain the induced graph generated by the printGraph / showSigOfNodes as follows: g <- showSigOfNodes(GOdata, score(myResult), firstSigNodes = 5) g$dag ## to obtain the adjacency matrix one can do: adjMat <- as(g, "matrix") ## g$dag is a "graphNEL" object and one can use this class methods plot(g$dag) adj(g, whichGO) Alternatively you can obtain the induced graph without the use of the showSigOfNodes function: whichGO <- names(sort(score(myResult)))[1:5] g <- reverseArch(inducedGraph(graph(GOdata), whichGO)) g Hope this helps. Best regards, Adrian On Thu, Dec 30, 2010 at 11:09 PM, Paul Rigor <pryce at="" ucla.edu=""> wrote: > Hi gang, > > I was wondering if there's anyway to obtain the adjacency list of matrix of > the induced go graphs, eg, the graphs generated by the printGraph function? > > Thanks, > Paul > > On Wed, Dec 22, 2010 at 3:21 AM, Paul Rigor <pryce at="" ucla.edu=""> wrote: > >> Thank you, this works quite well. ?I wish topGO had a prettier way of >> printing out the results similar to GOstats, though. >> >> Cheers, >> Paul >> >> >> On Sun, Dec 19, 2010 at 2:59 PM, Valerie Obenchain <vobencha at="" fhcrc.org="">wrote: >> >>> Hi Paul, >>> >>> >>> On 12/17/10 13:41, Paul Rigor wrote: >>> >>>> ?Hello, >>>> >>>> So I'm working on extracting IDs from a topGO result object. I have a >>>> list of terms ranked by p values (using classic fisher test). However, >>>> does the result object >>>> contain indices to the original list of gene ids per go term? The >>>> documentation was a bit unclear. >>>> >>>> Using the printGenes function and specifying the top ranked GO terms, >>>> I'd like to only pull the genes from my gene list, not from the entire >>>> GO annotation table, which seems to be the default behavior for this >>>> function. >>>> >>>> >>> Using the example from the topGO vignette, >>> >>> ? ?sampleGOdata <- new("topGOdata", description = "Simple session", >>> ontology = "BP", >>> ? ? ? ? allGenes = geneList, geneSel = topDiffGenes, nodeSize = 10, annot >>> = annFUN.db, >>> ? ? ? ? affyLib = affyLib) >>> >>> ? ?resultFisher <- runTest(sampleGOdata, algorithm = "classic", statistic >>> = "fisher") >>> >>> >>> Create a map of geneIDs to GO terms, >>> >>> ? ?ann.genes <- genesInTerm(sampleGOdata) >>> ? ?str(ann.genes) >>> >>> Select a few GO terms from the Fisher analysis (you could sort these first >>> or ...), >>> >>> ? ? fisher.go <- names(score(resultFisher))[1:5] >>> ? ? fisher.ann.genes <- genesInTerm(sampleGOdata, whichGO=fisher.go) >>> ? ? fisher.ann.genes >>> >>> The fisher.ann.genes list give you the ?gene ID / GO term mapping subset >>> on the GO terms from the Fisher analysis. You can also use printGenes on >>> this subset of GO terms, >>> >>> ? ?ft <- printGenes(sampleGOdata, whichTerms=fisher.go, >>> chip="hgu95av2.db") >>> >>> >>> >>> Valerie >>> >>> ?Thanks, >>>> Paul >>>> >>>> ? ? ? ?[[alternative HTML version deleted]] >>>> >>>> _______________________________________________ >>>> Bioconductor mailing list >>>> Bioconductor at r-project.org >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>>> Search the archives: >>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>>> >>>> >>> >>> >> > > ? ? ? ?[[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
Annotation GO graph GOstats topGO Annotation GO graph GOstats topGO • 1.7k views
ADD COMMENT
0
Entering edit mode
Paul Rigor ▴ 20
@paul-rigor-4426
Last seen 10.2 years ago
Thanks Adrian, These tips have been very helpful. Cheers, Paul On Tue, Jan 4, 2011 at 3:24 AM, Adrian Alexa <adrian.alexa@gmail.com> wrote: > Hi Paul, > > you can obtain the induced graph generated by the printGraph / > showSigOfNodes as follows: > > g <- showSigOfNodes(GOdata, score(myResult), firstSigNodes = 5) > g$dag > > ## to obtain the adjacency matrix one can do: > adjMat <- as(g, "matrix") > > ## g$dag is a "graphNEL" object and one can use this class methods > plot(g$dag) > adj(g, whichGO) > > Alternatively you can obtain the induced graph without the use of the > showSigOfNodes function: > > whichGO <- names(sort(score(myResult)))[1:5] > g <- reverseArch(inducedGraph(graph(GOdata), whichGO)) > g > > > Hope this helps. > > Best regards, > Adrian > > > > On Thu, Dec 30, 2010 at 11:09 PM, Paul Rigor <pryce@ucla.edu> wrote: > > Hi gang, > > > > I was wondering if there's anyway to obtain the adjacency list of matrix > of > > the induced go graphs, eg, the graphs generated by the printGraph > function? > > > > Thanks, > > Paul > > > > On Wed, Dec 22, 2010 at 3:21 AM, Paul Rigor <pryce@ucla.edu> wrote: > > > >> Thank you, this works quite well. I wish topGO had a prettier way of > >> printing out the results similar to GOstats, though. > >> > >> Cheers, > >> Paul > >> > >> > >> On Sun, Dec 19, 2010 at 2:59 PM, Valerie Obenchain <vobencha@fhcrc.org> >wrote: > >> > >>> Hi Paul, > >>> > >>> > >>> On 12/17/10 13:41, Paul Rigor wrote: > >>> > >>>> Hello, > >>>> > >>>> So I'm working on extracting IDs from a topGO result object. I have a > >>>> list of terms ranked by p values (using classic fisher test). However, > >>>> does the result object > >>>> contain indices to the original list of gene ids per go term? The > >>>> documentation was a bit unclear. > >>>> > >>>> Using the printGenes function and specifying the top ranked GO terms, > >>>> I'd like to only pull the genes from my gene list, not from the entire > >>>> GO annotation table, which seems to be the default behavior for this > >>>> function. > >>>> > >>>> > >>> Using the example from the topGO vignette, > >>> > >>> sampleGOdata <- new("topGOdata", description = "Simple session", > >>> ontology = "BP", > >>> allGenes = geneList, geneSel = topDiffGenes, nodeSize = 10, > annot > >>> = annFUN.db, > >>> affyLib = affyLib) > >>> > >>> resultFisher <- runTest(sampleGOdata, algorithm = "classic", > statistic > >>> = "fisher") > >>> > >>> > >>> Create a map of geneIDs to GO terms, > >>> > >>> ann.genes <- genesInTerm(sampleGOdata) > >>> str(ann.genes) > >>> > >>> Select a few GO terms from the Fisher analysis (you could sort these > first > >>> or ...), > >>> > >>> fisher.go <- names(score(resultFisher))[1:5] > >>> fisher.ann.genes <- genesInTerm(sampleGOdata, whichGO=fisher.go) > >>> fisher.ann.genes > >>> > >>> The fisher.ann.genes list give you the gene ID / GO term mapping > subset > >>> on the GO terms from the Fisher analysis. You can also use printGenes > on > >>> this subset of GO terms, > >>> > >>> ft <- printGenes(sampleGOdata, whichTerms=fisher.go, > >>> chip="hgu95av2.db") > >>> > >>> > >>> > >>> Valerie > >>> > >>> Thanks, > >>>> Paul > >>>> > >>>> [[alternative HTML version deleted]] > >>>> > >>>> _______________________________________________ > >>>> Bioconductor mailing list > >>>> Bioconductor@r-project.org > >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor > >>>> Search the archives: > >>>> http://news.gmane.org/gmane.science.biology.informatics.conductor > >>>> > >>>> > >>> > >>> > >> > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@r-project.org > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

Traffic: 566 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