microbiome / miaViz

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

plotAbundance problem #100

Open antagomir opened 2 years ago

antagomir commented 2 years ago

The function plotAbundance is used for handy visualization of community composition.

library(mia)
data(GlobalPatterns)
tse <- GlobalPatterns[1:1000,]
plotAbundance(tse, abund_values="counts", rank = "Phylum")

It only works with the defined ranks, however. This leads to error:

rowData(tse)$Strain <- sample(letters[1:5], nrow(tse), replace=TRUE)
plotAbundance(tse, abund_values="counts", rank = "Strain")

-> Error: 'rank' must be a value from 'taxonomyRanks()'

This is restrictive because it is often useful to visualize also other types of groupings.

Just not providing the rank argument (relying on the default) did not seem to help either.

Is this intended, or is there a way to circumvent this issue?

Related to microbiome/mia#219

antagomir commented 1 year ago

Related to microbiome/mia#325 also

TuomasBorman commented 11 months ago

Yes, the grouping could be more general (just a column from rowData)

antagomir commented 1 month ago

Related to #132