microbiome / miaViz

Microbiome Analysis Plotting and Visualization
https://microbiome.github.io/miaViz
Artistic License 2.0
9 stars 10 forks source link

plotAbundance improvements #132

Open TuomasBorman opened 1 week ago

TuomasBorman commented 1 week ago

1.

When sample names are plotted, one cannot read them as they are over each other

library(miaViz)
data("GlobalPatterns")

tse <- GlobalPatterns
plotAbundance(tse, rank = "Phylum", add_x_text = TRUE)

image Some other functions seem to have angle_x_text parameter, but plotAbundance does not have option to rotate text.

Also, we could consider if sample names could be specified from colData(tse). For example, paired samples must have unique names currently, but better option would be to allow shared names so that one can easily see which samples are drawn from same patient.

2.

I user wants to compare abundances between groups or if samples are paired for instance, our solution might be suboptimal.

library(patchwork)
library(miaViz)
data("GlobalPatterns")

tse <- GlobalPatterns
p <- plotAbundance(tse, rank = "Phylum", features = "SampleType")
wrap_plots(p, ncol = 1,  heights = c(0.95,0.05))

image It might be hard to read the plot when there are multiple groups (space between groups might help).

Another option would be to plot abundances as shown here in figure 1b

TuomasBorman commented 1 week ago

Also consider plotting more than 20 (maybe 25) taxa with discrete colors. As seen in plots above, the colors are in continuous scale which makes it hard to read. If there are 20 or less taxa, the color scale is discrete.