bioFAM / MOFA2

Multi-Omics Factor Analysis
https://biofam.github.io/MOFA2/
GNU Lesser General Public License v3.0
300 stars 52 forks source link

plot_enrichment_detailed function is not creating labeled plots #158

Open velenjak1 opened 6 months ago

velenjak1 commented 6 months ago

Hi,

I successfully ran the plot_enrichment_detailed function a month ago using an annotation matrix for a metabolomics dataset. The output correctly labeled the significant metabolites.

image

Now, when I run the same code, the dots are no longer labeled: image

I have run this on a separate dataset and still get unlabeled plots. I have tried uninstalling and re-installing the package but still no change. Might there be a bug?

chunyu-yes commented 5 months ago

Hi,

I encountered the same problem. Have you solved this problem?

Thanks, Chunyu

velenjak1 commented 5 months ago

Unfortunately not. I just gave up on it.

jjcaff commented 3 months ago

Summary: the issue is with ggrepel not working with coord_flip.

I had a similar problem, and found that the geom_text_repel function was not working after coord_flip, which is part of the plot_enrichment_detailed function. It seems this was an issue after geom_text_repel was updated recently (https://github.com/slowkow/ggrepel/issues/253), but even though this change was reverted, I wasn't able to fix the issue by reinstalling the package.
I have ended up redefining the geom_text_repel function by copying the most recent version from the github into a script and then sourcing it at the start of my analysis, replacing the version of the geom_text_repel function with one that works with coord_flip. Whilst my approach does work, it's messy. I'd suggest updating both MOFA2 and ggrepel functions and trying again!