Converting feature table .qza read error

Hi, I was wondering if you could help me understand why my .qza is throwing this error when I try to work with it with Qiime2:

There was an issue with viewing the artifact FINALfeaturetable.qza as QIIME 2 Metadata:

'slice' object has no attribute 'encode'

Here are my commands; everything works fine up until the qiime feature-table group command. I am attaching the .qza file so you could take a look:

qiime tools import
--type FeatureData[Taxonomy]
--input-path ./FINALspecies.txt
--input-format TSVTaxonomyFormat
--output-path ./DADA2onlytax.qza**

biom convert -i metadataFINAL.txt -o FINALmetadata.biom --to-hdf5

qiime tools import
--input-path FINALmetadata.biom
--type 'FeatureTable[Frequency]'
--input-format BIOMV210Format
--output-path FINALfeaturetable.qza

qiime feature-table group
--i-table FINALfeaturetable.qza
--p-axis sample
--m-metadata-column new-id
--m-metadata-file s_clotMetadata2.txt
--p-mode sum
--o-grouped-table feature_grouped.qza

qiime metadata tabulate
--m-input-file FINALfeaturetable.qza
--o-visualization feature_grouped.qzv

So can Qiime be customized for any data? Are Qiime Feature IDs absolutely necessary for analysis? I tried to create my own here and I am thinking this might be the problem, but please confirm. Thanks!

Best wishes,
Carla
FINALfeaturetable.qza (67.0 KB)

Hi @Carla_Uranga!

Yes!

No!

I think so, too! Can you share metadataFINAL.txt? I tried exporting and converting your FINALfeaturetable.qza, but met some issues:

$ qiime tools export --input-path FINALfeaturetable.qza --output-path ft
$ biom convert -i ft/feature-table.biom -o table.from_biom.txt --to-tsv
Traceback (most recent call last):
  File "/Users/matthew/.conda/envs/qiime2-2020.8/bin/biom", line 11, in <module>
    sys.exit(cli())
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/biom/cli/table_converter.py", line 114, in convert
    table = load_table(input_fp)
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/biom/parse.py", line 672, in load_table
    table = parse_biom_table(fp)
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/biom/parse.py", line 397, in parse_biom_table
    return Table.from_hdf5(file_obj, ids=ids, axis=axis)
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/biom/table.py", line 3931, in from_hdf5
    obs_ids, obs_md, obs_grp_md = axis_load(h5grp['observation'])
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/biom/table.py", line 3919, in axis_load
    data = dset[:]
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/h5py/_hl/group.py", line 264, in __getitem__
    oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
  File "/Users/matthew/.conda/envs/qiime2-2020.8/lib/python3.6/site-packages/h5py/_hl/base.py", line 137, in _e
    name = name.encode('ascii')
AttributeError: 'slice' object has no attribute 'encode'

Hi and thank you again for your help! Here is what I converted to a biom file:

FINALmetadata.txt (298.2 KB)

And the actual biom file I tried converting to a dysfunctional qza:
FINALmetadata.biom (379.1 KB)

Just so you know, based on other similar posts, I did try to remove all whitespace, and still got the same error message!

So, how simple can my Feature IDs be? Can they be as simple as numeric values or do they have to be alphanumeric? I hope you are doing great.

Best wishes,

Carla

Thanks for the files!

Actually this biom file is the source of the dysfunction, not the QZA. I can't get biom to parse this file.

I think the issue is that you have slashes in the feature IDs, which is breaking the biom parser.

sed 's/\//-/g' FINALmetadata.txt > no-slashes.txt 

Another note, this isn't related to the issue you ran into here, but might be a problem later - your table appears to be transposed - biom expects there to be features as rows and samples as columns. You can use the feature-table transpose command to fix that, after importing, if you wish.

:qiime2:

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