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