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

**URL:** https://forum.qiime2.org/t/qiime2-taxa-collapse-plugin-error-float-object-has-no-attribute-split/13980
**Category:** Technical Support
**Created:** [March 10, 2020, 10:30pm UTC](https://forum.qiime2.org/t/qiime2-taxa-collapse-plugin-error-float-object-has-no-attribute-split/13980 "2020-03-10T22:30:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kmw](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/k/9e8a1a/32.png) [@kmw](https://forum.qiime2.org/u/kmw)
#### Post date: [March 10, 2020, 10:30pm UTC](https://forum.qiime2.org/t/qiime2-taxa-collapse-plugin-error-float-object-has-no-attribute-split/13980/1 "2020-03-10T22:30:55Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [March 10, 2020, 10:35pm UTC](https://forum.qiime2.org/t/qiime2-taxa-collapse-plugin-error-float-object-has-no-attribute-split/13980/2 "2020-03-10T22:35:50Z")

</div>

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:

> [@Taxa barplot plugin error](https://forum.qiime2.org/t/taxa-barplot-plugin-error/3219):
>
> 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 d…

> [@command or tool to shorten the very long labels in viewer from taxa-bar-plots.qzv](https://forum.qiime2.org/t/command-or-tool-to-shorten-the-very-long-labels-in-viewer-from-taxa-bar-plots-qzv/12023/6):
>
> Hi Nicholas, I am almost there but have a structure error in my data which I do not get. face_with_thermometer Next is a part of my attempt which can be seen in whole on my [git page](https://github.com/splaisan/qiime-tools/blob/master/simplify_qiime-plots.md) Could you please point me to a way to correct this ! head taxonomy\_export/taxonomy.tsv taxonomy\_genus/taxonomy.tsv taxonomy\_species/taxonomy.tsv ==\> taxonomy\_export/taxonomy.tsv \<== Feature ID Taxon Consensus 00020107f579a17c6029b07351bf5744479bd7c8 D\_0\_\_Bacteria;D\_1\_\_Firmicutes;D\_2\_\_Bacilli;D\_3\_\_Bacillales;D\_…

Good luck!

---

<div class="post-metadata">

### Author: ![kmw](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/k/9e8a1a/32.png) [@kmw](https://forum.qiime2.org/u/kmw)
#### Post date: [March 10, 2020, 10:52pm UTC](https://forum.qiime2.org/t/qiime2-taxa-collapse-plugin-error-float-object-has-no-attribute-split/13980/3 "2020-03-10T22:52:39Z")

</div>

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.
