Skip to content

plotAbundance throws error when features > 500 #48

Open

Description

@RiboRings

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)

Activity

  1. antagomir commented on Aug 3, 2025

    @antagomir
    Member

    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.

  2. RiboRings commented on Aug 4, 2025

    @RiboRings
    MemberAuthor

    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 getTop and print a warning. @TuomasBorman, could we add this directly to miaViz plotAbundance?

  3. TuomasBorman commented on Aug 4, 2025

    @TuomasBorman

    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.

  4. antagomir commented on Aug 4, 2025

    @antagomir
    Member

    Ok -

    • informative error if number of features exceeds a reasonable limit
    • in examples, use data that does not have too many dimensions and mention that agglomeration can help when there are too many features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions