GangLiLab / genekitr

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

labels overlay bars in plotEnrichAdv when left x-axis limit is less than the right limit #3

Closed igumnov-daniel closed 1 year ago

igumnov-daniel commented 1 year ago

Hi! When I'm trying to create a figure with plotEnrichAdv on simplified data and left xaxis limit is less than the right xaxis limit labels overlay bars of thee graph.

Let up_go_bp_sim and down_go_bp_sim be the resultant dataframes returned by genORA function ran with up- and downregulated DEGs. Then:

  1. Left limit is greater
    plotEnrichAdv(up_go_bp_sim, down_go_bp_sim,
              plot_type = "one",
              term_metric = "FoldEnrich",
              stats_metric = "p.adjust",
              xlim_left = 15, xlim_right = 20) +
    theme(legend.position = c(0.8, 0.5))

изображение

  1. Right limit is greater (as in the example in the documentation) Everything is OK.
    plotEnrichAdv(up_go_bp_sim, down_go_bp_sim,
              plot_type = "one",
              term_metric = "FoldEnrich",
              stats_metric = "p.adjust",
              xlim_left = 20.1, xlim_right = 20) +  # now left border is greater than the right one
    theme(legend.position = c(0.8, 0.5))

    изображение

ps: It also would be great to add more parameters to simGO function like cutoff etc.

pps: Thanks again for the package!

igumnov-daniel commented 1 year ago

изображение Maybe it's because of that? I've changed just these two sign and now it works fine.

изображение