clemente-lab / mmeds-meta

A database for storing and analyzing omics data
https://mmeds.org
2 stars 1 forks source link

Proper cropping of LEfSe output SVGs #430

Open cleme opened 1 year ago

cleme commented 1 year ago

Describe the bug The SVGs generated by LEfSe are often incorrectly cropped and the taxonomy strings are not displayed fully. This is not a MMEDS issue, but a LEfSe issue.

To Reproduce Open any output SVG from LEfSe in Illustrator or similar. The image contains the full taxonomic string, but the cropping is incorrect.

Screenshots @htlm can provide screnshot

Solution The SVG files can be directly edited after they are generated. Cropping info is near the top of the file; it should be easy to calculate new cropping dimensions based on the max length of the taxonomic strings found as differential in LEfSe analysis.

adamcantor22 commented 1 year ago

This solution seems doable, but here's another: when generating the plots there are two options --left_space and --right_space which control the cropping of the SVG. In the past, I've fiddled with these values to get LEfSe to generate plots that don't get cut off. It should not be difficult to determine what these two values should be based on the data in the results (.res) file, which would mean not having to directly modify an image file through code.