Skip to content

Throw error if trying to create a biom table containing NaNs #982

Description

@AmandaBirmingham

Currently, the code allows a user to create a biom table that contains NaNs. However, trying to use such a table frequently leads to obscure errors: the equality test doesn't work (because NaN != NaN), transform doesn't work for sparse representations (because 0/NaN is set to 0, not NaN, because transform doesn't touch zero entries in sparse matrix), and sometimes even doing an explicit NaN-aware compare (where you check whether the same positions contain NaN in two tables) fails (for a non-NaN-related reason :) because matrix.data's order is different depending on whether it was instantiated as sparse or not. (@wasade indicates that the usual way to handle NaNs in a biom table is to set them to zero, which makes these issues go away.)

Since NaNs can't be truly supported in the current code, as a user, I would like it a lot if I just got an error up front if I tried to make a biom table that contained a NaN, rather than hitting an inscrutable issue downstream.

Activity

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