Plugin error from taxa: 'float' object jas no attribute 'split'

Hi there,

I am using:
qiime2-2021.4
miniconda3
WSL (Ubuntu 20.04)
Windows 10 x64

I am trying to make a taxa bar plot:

I have used feature-table.qza and sample_metadata.txt files to get several core metrics. I am pretty sure the issue lays in the taxonomy.qza file. I imported the taxonomy artifact from a .txt file. I think there is the culprit, but I don't know what is the problem or how to solve it.
The tab delimited .txt file contains two columns: Feature ID and Taxon. Taxon contains the seven taxonomic levels separated by semicolons.

Code:
qiime taxa barplot --i-table feature-table.qza --i-taxonomy taxonomy.qza --m-metadata-file sample_metadata.txt --o-visualization taxa_barplot.qzv

Error message:
Plugin error from taxa:

'float' object has no attribute 'split'

Debug info has been saved to /tmp/qiime2-q2cli-err-v4irc8rj.log

Log file:
Traceback (most recent call last):
File "/home/dzagal/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2cli/commands.py", line 329, in call
results = action(**arguments)
File "", line 2, in barplot
File "/home/dzagal/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 244, in bound_callable
outputs = self.callable_executor(scope, callable_args,
File "/home/dzagal/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 452, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File "/home/dzagal/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_taxa/_visualizer.py", line 41, in barplot
collapsed_tables = _extract_to_level(taxonomy, table)
File "/home/dzagal/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_taxa/_util.py", line 37, in _extract_to_level
max_obs_lvl = _get_max_level(taxonomy)
File "/home/dzagal/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_taxa/_util.py", line 11, in _get_max_level
return taxonomy.apply(lambda x: len(x.split(';'))).max()
File "/home/dzagal/miniconda3/envs/qiime2-2021.4/lib/python3.8/site-packages/pandas/core/series.py", line 4138, in apply
mapped = lib.map_infer(values, f, convert=convert_dtype)
File "pandas/_libs/lib.pyx", line 2467, in pandas._libs.lib.map_infer
File "/home/dzagal/miniconda3/envs/qiime2-2021.4/lib/python3.8/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'

I hope this helps you help me!

Thanks!

Daniel

Welcome to the forum, @Daniel_Zagal !

You're right! This issue is saying (as you have surmised) that a taxonomy cannot be parsed correctly, because it does not have semicolons.

This issue can be caused by even one taxonomy that cannot parse correctly, e.g., if it is missing an annotation or is not semicolon-delimited. See here for more details:

I recommend starting there to see if any of the entries is missing a taxonomy.

Good luck!

2 Likes

Hello @Nicholas_Bokulich,

Thank you so much for your quick response! I knew this had been resolved before and you pointed me in the right direction.

I was able to solve the issue. In my case all the features were present, but 182 out of 43000+ features did not have any taxonomic assignment. I found this out by opening the .txt file in excel and sorting the table by taxon. The features without taxa assignment were all at the end. I populated the empty taxa with 'Unassigned' and saved. It worked!

Thanks again!

1 Like

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