error in importing BIOM file

Hi,

My colleague wants me to run analyses on QIIME2. He gave me files OTU, taxonomy and metadata files.
I made a BIOM file from OTU file using a biomformat package in R (with a make_biom command).
Now I'm trying to import into QIIME2 and save it as a table.qza and I got an error. I tried to edit the OTU table but still I get error that I don't fully understand what the meaning of it is.

I'll appreciate your help. Thank you very much,

(qiime2-2022.8) [email protected]:~/Jordan/nifh/Final$ qiime tools import --input-path jodan_biom.biom --type 'FeatureTable[Frequency]' --input-format BIOMV100Format --output-path jodan_table.qza
Traceback (most recent call last):
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2cli/builtin/tools.py", line 157, in import_data
    artifact = qiime2.sdk.Artifact.import_data(type, input_path,
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/sdk/result.py", line 299, in import_data
    return cls._from_view(type_, view, view_type, provenance_capture,
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/sdk/result.py", line 327, in _from_view
    result = transformation(view, validate_level)
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/core/transform.py", line 70, in transformation
    new_view = transformer(view)
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/qiime2/core/transform.py", line 221, in wrapped
    file_view = transformer(view)
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_types/feature_table/_transformer.py", line 124, in _8
    data = _parse_biom_table_v100(ff)
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/q2_types/feature_table/_transformer.py", line 46, in _parse_biom_table_v100
    table = biom.Table.from_json(json.load(fh))
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/biom/table.py", line 4696, in from_json
    table_obj = Table(data, obs_ids, sample_ids,
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/biom/table.py", line 468, in __init__
    self._data = Table._to_sparse(data, input_is_dense=input_is_dense,
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/biom/table.py", line 628, in _to_sparse
    mat = coo_arrays_to_sparse((d.data, (d.row, d.col)),
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/biom/table.py", line 5264, in coo_arrays_to_sparse
    matrix = coo_matrix(data, shape=(n_rows, n_cols), dtype=dtype)
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/scipy/sparse/_coo.py", line 160, in __init__
    self.data = getdata(obj, copy=copy, dtype=dtype)
  File "/home/qiime2/anaconda3/envs/qiime2-2022.8/lib/python3.8/site-packages/scipy/sparse/_sputils.py", line 124, in getdata
    data = np.array(obj, dtype=dtype, copy=copy)
ValueError: could not convert string to float: 'nifH_ASV_1480'

An unexpected error has occurred:

  could not convert string to float: 'nifH_ASV_1480'

Hello @EGvibrio,

It's a problem with format validation, you have a string, that is mentioned in error, somewhere in values cells. Inspect your biom table carefully, and make sure that strings are only found in indexes and columns, not in value cells.

Cheers,
V

1 Like

Thank you for your quick reply, I inspected the table before.
There are no strings outside of indexes.

Hello,

Yes, I cannot locate them as well in raw data. Maybe something went wrong during BIOM creation? Please, send created BIOM.

Cheers
V

Thanks, please see the attached BIOM:

Hello,

there are strings in your cell values. Please, check make_biom documentation and make sure ASV are recorded as indexes and not as part of values.

Example line:
["nifH_ASV_4892"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 10"," 0"," 0"," 8"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"," 0"]

Cheers,
V

1 Like

That's weird. I'll try to record ASV as indexes.

Edit: Worked. Thank you very much!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.