You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
plotAbundance throws error when features > 500 #48
FInd a way to prevent this error from crashing the app.
library(mia)
library(miaViz)
data("enterotype", package = "mia")
plotAbundance(enterotype, group = "Genus")
Error: The data contains more than 500 rows. The abundance plot cannot be created. Consider subsetting/agglomeration. (Check 'group' parameter)
The agglomeration approach doesn't work for the enterotype dataset specifically because it only has one rank (Genus), and it still has more than 500 features at that level.
So yes maybe we could subset to the top 500 features with getTop and print a warning. @TuomasBorman, could we add this directly to miaViz plotAbundance?
Maybe yes, but you can visualize ~ 20 features at once, 500 is very generous limit (and will take probably quite long time to render the image). This could be added to miaViz, but I would avoid doing a lot of processing as it might lead to user-errors and confusion. Visualization methods should -- if possible -- plot the data as it is.
Activity
antagomir commentedon Aug 3, 2025
One solution is to visualize the top N in such case, and throw a warning.
Or the agglomeration could be automated when the number of features exceeds a certain limit.
RiboRings commentedon Aug 4, 2025
Thanks for the suggestions!
The agglomeration approach doesn't work for the enterotype dataset specifically because it only has one rank (Genus), and it still has more than 500 features at that level.
So yes maybe we could subset to the top 500 features with
getTopand print a warning. @TuomasBorman, could we add this directly to miaViz plotAbundance?TuomasBorman commentedon Aug 4, 2025
Maybe yes, but you can visualize ~ 20 features at once, 500 is very generous limit (and will take probably quite long time to render the image). This could be added to miaViz, but I would avoid doing a lot of processing as it might lead to user-errors and confusion. Visualization methods should -- if possible -- plot the data as it is.
antagomir commentedon Aug 4, 2025
Ok -