GangLiLab / genekitr

🧬 Gene analysis toolkit based on R
https://www.genekitr.fun
GNU General Public License v3.0
53 stars 7 forks source link

Plotting for ShinyGO ORA results #12

Closed Natpod closed 1 year ago

Natpod commented 1 year ago

Describe the bug Hello, I am attempting to perform a GO term visualization of my ShinyGO ORA results with plotEnrich. There are GO terms that plotEnrich won't recognize, is there a way to skip them entirely? thank you

reedliu commented 1 year ago

Hi, could you send me the ShinyGO ORA results first? So I could reproduce the test.

Natpod commented 1 year ago

Sure, here are the first 100 rows to my shinygo dataset. As you can see, if you manually remove the unrecognized GO codes, the plotEnrichment works fine

thank you once again for your feedback

Regards, Natalia García Sánchez

Enviado desde Outlookhttp://aka.ms/weboutlook


De: Yunze Liu @.> Enviado: miércoles, 26 de abril de 2023 2:20 Para: GangLiLab/genekitr @.> Cc: NataliaGarciaBC @.>; Author @.> Asunto: Re: [GangLiLab/genekitr] [shiny-bug] (Issue #12)

Hi, could you send me the ShinyGO ORA results first? So I could reproduce the test.

— Reply to this email directly, view it on GitHubhttps://github.com/GangLiLab/genekitr/issues/12#issuecomment-1522574592, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASDMRKYTWDYQ3CARWQGWOMLXDBS3DANCNFSM6AAAAAAXK5BT7E. You are receiving this because you authored the thread.Message ID: @.***>

reedliu commented 1 year ago

Hi, I didn't see the example dataset. Have you uploaded the file successfully? Maybe you could save it as .rda and then upload it.

reedliu commented 1 year ago

@Natpod I still need additional information to follow-up on this issue. Please let me know if you are still experiencing it or were able to resolve it on your own. If not hear back in the next week or so, I'll be closing the report. Thanks.

reedliu commented 1 year ago

Is this file from ShinyGO the original one? If so, it appears to be incorrect as it uses the same value for Fold Enrichment as qvalue, whereas the correct formula for Fold Enrichment is GeneRatio divided by BgRatio.

image

reedliu commented 1 year ago

If it is not, please upload the original result from ShinyGO and I will try to write a function to import its result and link to the plotEnrich function.

Natpod commented 1 year ago

Okey, thank you for the patience and the fast response! reprex_ShinyGO_result.xlsx

this is my ShinyGO output

reedliu commented 1 year ago

Update a function importShinygo in version >= 1.2.1

Due to the limited information of shinyGO output, only FDR is provided, and then only FoldEnrich and nGenes, pathway genes (these two can be used to calculate RichFactor).

Anyway, you could select and modify the interested terms in enrich furthur.

Also, you could change other plotting parameters following plotEnrich manual, such as color, text size, line etc.

options for plot_type: dot/bar/bubble/lollipop/wordcloud options for term_metric: "RichFactor"/"FoldEnrich"

enrich = importShinygo('reprex_ShinyGO_result.xlsx') demo = enrich[1:10,] plotEnrich(demo, plot_type = "dot",stats_metric = 'qvalue',term_metric = 'FoldEnrich',scale_ratio = 0.1) plotEnrich(demo, plot_type = "bar",stats_metric = 'qvalue',term_metric = 'RichFactor',scale_ratio = 0.1) plotEnrich(demo, plot_type = "bubble",stats_metric = 'qvalue',scale_ratio = 0.1) plotEnrich(demo, plot_type = "wordcloud",stats_metric = 'qvalue')

image

Natpod commented 1 year ago

Wonderful, thank you!

Natpod commented 1 year ago

hello, it seems that after import i cannot plot the hierarchy map from enriched categories

enrichplot::plotEnrich(enrich, plot_type = "gomap", term_metric = "FoldEnrich", stats_metric="qvalue", up_color = '#a32a31',down_color = '#3665a6', ont="BP", org="bna")

the problem is in the get_ancestor_data function with returns the following traceback:

Error in get_ancestor_data(enrich_df, ont = NULL) : 
Please give ontology to "ont" from "BP","CC" and "MF"