qiime2 taxa collapse plugin error 'float' object has no attribute 'split'

I cannot find any forum posts with this exact error message for taxa collapse. I imported the taxonomy file from MEGAN and can use it successfully with other qiime2 commands, but I get this error message when trying to collapse all OTU IDs with the same species status into one feature. I have tried running the command on the original feature table and the filtered feature table (filtered to include only species level OTUs). I used the same taxonomy file for each attempt.

Version: qiime2-2020.2
Command: qiime taxa collapse --i-table Arth16S_table-nonchimeric-w-borderline.qza --i-taxonomy Arth16S_blast_tax.qza --p-level 7 --o-collapsed-table collapsed_test1.qza --verbose
Error Message:
Traceback (most recent call last):
File “/Users/kristenwestfall/opt/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2cli/commands.py”, line 328, in call
results = action(**arguments)
File “</Users/kristenwestfall/opt/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/decorator.py:decorator-gen-137>”, line 2, in collapse
File “/Users/kristenwestfall/opt/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 245, in bound_callable
output_types, provenance)
File “/Users/kristenwestfall/opt/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 390, in callable_executor
output_views = self._callable(**view_args)
File “/Users/kristenwestfall/opt/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_taxa/_method.py”, line 22, in collapse
max_observed_level = _get_max_level(taxonomy)
File “/Users/kristenwestfall/opt/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_taxa/_util.py”, line 11, in _get_max_level
return taxonomy.apply(lambda x: len(x.split(’;’))).max()
File “/Users/kristenwestfall/opt/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/pandas/core/series.py”, line 4045, in apply
mapped = lib.map_infer(values, f, convert=convert_dtype)
File “pandas/_libs/lib.pyx”, line 2228, in pandas._libs.lib.map_infer
File “/Users/kristenwestfall/opt/miniconda3/envs/qiime2-2020.2/lib/python3.6/site-packages/q2_taxa/_util.py”, line 11, in
return taxonomy.apply(lambda x: len(x.split(’;’))).max()
AttributeError: ‘float’ object has no attribute ‘split’

Plugin error from taxa:

‘float’ object has no attribute ‘split’

See above for debug info.

Welcome back @kmw!

This error appears to be due to a formatting issue with the MEGAN taxonomy — either one of the feature IDs is missing its taxonomy label, or the labels are not semicolon-delimited. See these two topics for details:

Good luck!

Thank you, I fixed it by collapsing after filtering for just species and creating a new taxonomy file with MEGAN for just the filtered species. It is a fault of MEGAN like you said, but easy work around. Thanks for the quick reply.

1 Like