[BioC] extracting topGO gene ids from result object

Adrian Alexa adrian.alexa at gmail.com
Tue Jan 4 12:24:13 CET 2011


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
>



More information about the Bioconductor mailing list