Taxa barplot plugin error

Hello! I am having a similar issue to a few other threads, but I still can't quite figure out what is wrong. I am trying to use the QIIME2 pipeline on ITS2 amplicons for the algae Symbiodinium (found in corals). There is a small Symbiodinium database that is available for this, which I have used to run closed-reference feature clustering at 97% (I first tried using a naive-bayes trained classifier, but with such a small database, my final taxa barplots did not give enough resolution, I believe due to the high number of single variant differences/features that were found that could not match the database).

From the clustering, I have been trying to create barplots using my clustered feature table and a taxonomy file that mirrors the features in the table, but have had some difficulty. I continue to get the following error:

Plugin error from taxa:

'float' object has no attribute 'split'

My command line is as follows:

qiime taxa barplot
--i-table table_cr_97.qza
--i-taxonomy tax_97.qza
--m-metadata-file ITS2_metadata.txt
--o-visualization ITS2_taxa-bar-plots_97.qzv

Traceback is:

Traceback (most recent call last):
File "/usr/local/miniconda/envs/qiime2-2017.10/lib/python3.5/site-packages/q2cli/commands.py", line 218, in call
results = action(**arguments)
File "", line 2, in barplot
File "/usr/local/miniconda/envs/qiime2-2017.10/lib/python3.5/site-packages/qiime2/sdk/action.py", line 220, in bound_callable
output_types, provenance)
File "/usr/local/miniconda/envs/qiime2-2017.10/lib/python3.5/site-packages/qiime2/sdk/action.py", line 416, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File "/usr/local/miniconda/envs/qiime2-2017.10/lib/python3.5/site-packages/q2_taxa/_visualizer.py", line 29, in barplot
collapsed_tables = _extract_to_level(taxonomy, table)
File "/usr/local/miniconda/envs/qiime2-2017.10/lib/python3.5/site-packages/q2_taxa/_util.py", line 30, in _extract_to_level
max_obs_lvl = _get_max_level(taxonomy)
File "/usr/local/miniconda/envs/qiime2-2017.10/lib/python3.5/site-packages/q2_taxa/_util.py", line 11, in _get_max_level
return taxonomy.apply(lambda x: len(x.split(';'))).max()
File "/usr/local/miniconda/envs/qiime2-2017.10/lib/python3.5/site-packages/pandas/core/series.py", line 2355, in apply
mapped = lib.map_infer(values, f, convert=convert_dtype)
File "pandas/_libs/src/inference.pyx", line 1574, in pandas._libs.lib.map_infer (pandas/_libs/lib.c:66645)
File "/usr/local/miniconda/envs/qiime2-2017.10/lib/python3.5/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 have attached my input files here:

table_cr_97.qza (94.5 KB)
tax_97.qza (3.2 KB)
ITS2_metadata.txt (49.7 KB)

Any help with how I might be able to move forward with this would be greatly appreciated! Thank you so much :slight_smile:

Hi @hannah_eps!

I think there's a missing value in your taxonomy for feature GS_C1, which is probably being loaded as np.NaN (a floating point number).

If you add an annotation for that and it fixes the problem, let us know. I'll see about filing a bug-report to give a better error when a taxonomy file is missing annotations.

Hi @ebolyen, thanks for the response!

It's all fixed, but not quite what I expected! I had a look at the tax_97.qzv and you're right, there was no annotation for GS_C1. The weird thing is that there is no feature called GS_C1. Turns out, I had a feature called GS_C1# that QIIME was reading of course as just GS_C1, and then leaving out the annotation that was there for it. Once I changed the feature name, it all worked perfectly. Thank you so much for your help!!

Ah! That makes sense. If you update to 2018.2, problems like that shouldn't come up anymore as comments (# like these) can only appear at the beginning of a line now.

Glad we could help!

Ran across an existing issue for this.