In the tutorial it mentions that plot_anno_scores returns an invisible dataframe that contains the stats from Fisher’s exact test shown in the plot. I was wondering if there was a way to extract this dataframe? It would also be helpful if one could manipulate the plot... for example, I would like to graphically display the p-values associated with each GO term.
if objects are returned "invisibly" it means that they are not printed to the screen when they are not assigned to a variale.
That is plot_anno_scores(res, go_ids) does not print the dataframe to the console, but stats = plot_anno_scores(res, go_ids) would store the dataframe in variable stats as usual.
However, those values are more thought of as additional information. The familiy-wise error rates (FWER) from go_enrich() should be reported for whether a category is enriched for candidate genes or not. The p-values from Fisher's exact test are not corrected for multiple testing!
Also, the FWER is reported for the one-sided test, i.e. you have FWER_underrep and FWER_overrep, wheareas the Fisher's exact test in plot_anno_scores is two-sided. It should be interpreted as a quick visual overview of how background and candidate genes are distributed in the categories and root nodes.
Currently it is not possible to manipulate the plot. If you want to add text on top of the plot you could use text() (and maybe locator() to find the coordinates for text()).
Hi Steffi,
Thanks for the response. I didn't realize that is what you meant by "invisible".. thanks for clarifying.