how to supply a vector/list of results to GenTable in topGO?
0
0
Entering edit mode
Adrian Alexa ▴ 400
@adrian-alexa-936
Last seen 10.3 years ago
Hi Aaron, The "R magic" is to use do.call() function. Check the manual for more details on its functionality. The only 'trick' here is to build the second argument. > data(GOdata) > data(results.tGO) > ls() [1] "GOdata" "resultFisher" "resultKS" > res <- list(fisher = resultFisher, ks = resultKS) > do.call(GenTable, c(object = GOdata, res)) GO.ID Term Annotated Significant Expected Rank in ks fisher ks 1 GO:0006091 generation of precursor metabolites and ... 8 6 1.26 14 0.00025 0.0012 2 GO:0022900 electron transport chain 8 6 1.26 15 0.00025 0.0012 3 GO:0009267 cellular response to starvation 6 5 0.94 16 0.00043 0.0016 4 GO:0042594 response to starvation 6 5 0.94 17 0.00043 0.0016 5 GO:0032946 positive regulation of mononuclear cell ... 30 12 4.72 28 0.00062 0.0120 6 GO:0050671 positive regulation of lymphocyte prolif... 30 12 4.72 29 0.00062 0.0120 7 GO:0006636 unsaturated fatty acid biosynthetic proc... 9 6 1.42 20 0.00066 0.0032 8 GO:0033559 unsaturated fatty acid metabolic process 9 6 1.42 21 0.00066 0.0032 9 GO:0031667 response to nutrient levels 7 5 1.10 23 0.00131 0.0054 10 GO:0031669 cellular response to nutrient levels 7 5 1.10 24 0.00131 0.0054 Hope this helps. Regards, Adrian On Wed, Jan 30, 2013 at 3:56 PM, Aaron Mackey <amackey@virginia.edu> wrote: > The GenTable() function in topGO expects an explicitly enumerated set of > result objects as parameters; but I've got them in a list, and don't want > to hard-code the names/results. Is there a way to dynamically build the > parameters as a string and have the string evaluated as such when calling > GenTable? Or some better way? > > Here's what GenTable wants: > > GenTable(GOdata, Res1=res[[1]], Res2=res[[2]], Res3=res[[3]], ...) > > Here's what I want to be able to do: > > GenTable(GOdata, Rmagic(res), ...) > > Where "Rmagic" is a placeholder for your kindly provided answer ... > > Thanks, > -Aaron > > [[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]]
GO PROcess topGO GO PROcess topGO • 1.5k views
ADD COMMENT

Login before adding your answer.

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