Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading behaviour with biom validate and classic TSV input #901

Closed
peterjc opened this issue Mar 9, 2023 · 1 comment · Fixed by #918
Closed

Misleading behaviour with biom validate and classic TSV input #901

peterjc opened this issue Mar 9, 2023 · 1 comment · Fixed by #918

Comments

@peterjc
Copy link
Contributor

peterjc commented Mar 9, 2023

I do understand that what you call a TSV-formatted (classic) table is not considered to be a BIOM format file, but the behaviour of biom validate-table given such a file is not ideal.

I would like the validate-table help to be explicit about this:

$ biom validate-table -h
Usage: biom validate-table [OPTIONS]

  Validate a BIOM-formatted file.

  Test a file for adherence to the Biological Observation Matrix (BIOM) format
  specification. This specification is defined at http://biom-format.org

  Example usage:

  Validate the contents of table.biom for adherence to the BIOM format
  specification

  $ biom validate-table -i table.biom

Options:
  -i, --input-fp FILE        The input filpath to validate against the BIOM
                             format specification  [required]
  -f, --format-version TEXT  The specific format version to validate against
  -h, --help                 Show this message and exit.

Example of current behaviour:

$ biom --version
biom, version 2.1.14
$ biom convert -i min_sparse_otu_table_hdf5.biom -o min_sparse_otu_table.tsv --to-tsv
$ biom validate-table -i min_sparse_otu_table_hdf5.biom
$ biom validate-table -i min_sparse_otu_table.tsv 
Traceback (most recent call last):
...
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Expected behaviour:

Clear error message like "This file is not in HDF5 or JSON format" or better "This is a TSV file, not a BIOM file." (edited to fix missing pronouns)

@wasade
Copy link
Member

wasade commented Mar 9, 2023

👍, that certainly makes sense!

@wasade wasade mentioned this issue Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants