qiime2 feature-classifier classify-consensus-blast

Hi, I have tried to run qiime2 feature-classifier classify-consensus-blast and I had the follwing error. Can anyone help with this?
This plugin encountered an error:
sequence item 0: expected str
instance, float found

:frowning:
Matplotlib created a temporary cache directory at /corral4/main/jobs/062/572/62572206/tmp/matplotlib-4wtl9wry because the default path (/home/qiime2/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.
Traceback (most recent call last):
File “/opt/conda/envs/qiime2-amplicon-2024.5/bin/q2galaxy”, line 11, in
sys.exit(root())
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2galaxy/main.py”, line 98, in run
action_runner(plugin, action, config)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2galaxy/core/drivers/action.py”, line 31, in action_runner
results = _execute_action(action, action_kwargs,
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2galaxy/core/drivers/stdio.py”, line 38, in wrapped
return function(*args, **kwargs)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2galaxy/core/drivers/action.py”, line 152, in _execute_action
return action(**action_kwargs)
File “”, line 2, in classify_consensus_blast
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py”, line 342, in bound_callable
outputs = self.callable_executor(
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py”, line 657, in callable_executor
outputs = self._callable(scope.ctx, **view_args)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_feature_classifier/_blast.py”, line 136, in classify_consensus_blast
consensus, = lca(search_results=result,
File “”, line 2, in find_consensus_annotation
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/context.py”, line 143, in deferred_action
return action_obj._bind(
File “”, line 2, in find_consensus_annotation
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py”, line 339, in bound_callable
self.signature.transform_and_add_callable_args_to_prov(
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/core/type/signature.py”, line 396, in transform_and_add_callable_args_to_prov
self._transform_and_add_input_to_prov(
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/core/type/signature.py”, line 429, in _transform_and_add_input_to_prov
transformed_input = _input._view(spec.view_type, recorder)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/result.py”, line 406, in _view
result = transformation(self._archiver.data_dir)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/core/transform.py”, line 70, in transformation
new_view = transformer(view)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/core/transform.py”, line 214, in wrapped
return transformer(view.file.view(self._wrapped_view_type))
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_types/feature_data/_transformer.py”, line 234, in _23
df = _taxonomy_formats_to_dataframe(str(ff), has_header=True)
File “/opt/conda/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_types/feature_data/_transformer.py”, line 102, in _taxonomy_formats_to_dataframe
', '.join(df.columns[df.columns.duplicated()].unique()))
TypeError: sequence item 0: expected str instance, float found

Welcome, @Carmen_Gonzalez

This message

then at the end of your other message, this part is the same but with a few more details.

This error usually means that the artifact does not contain the expected content for the tool. I think this is referencing the metadata inside the artifact. Artifacts have the actual data then a sort of manifest of what that data is. The tool is reporting that it expected a “word” (or string) definition but didn’t find it. Given the other context about finding a float, that means you probably have a decimal value instead of a whole number (or label with an extension?).

Hard to guess more so look at values with “dot” characters to start with: the data values but also how you labeled that data. The import tool has instructions on the form – you will have to be very careful to follow those instructions exactly – sometimes that means renaming your sequences if those are not directly from the sequencing software.

There are two ways that I know of to look into your existing artifact more.

  1. Use the qiime2 tools export tool. You can make adjustments then create a new artifact with qiime2 tools import again.

  2. You can check your artifact here → https://view.qiime2.org/. If you use this, you’ll be able to see exactly what the failing tool is seeing, and can probably spot what is going wrong.

You will need to download the artifact first to use the web tool due to how the other website is configured (see the known types of incompatibility messages here https://view.qiime2.org/about/). We will probably be able to have this be a direct link later on but that is still a work in progress. Details → Request: Facilitate visualization of qza/qzv artifacts · Issue #18799 · galaxyproject/galaxy · GitHub

The other messages about the “writable directory” can be ignored, that is just a warning. Tools in Galaxy work a bit differently inside the container environments, so the local directory structure isn’t used the same way. Your problem is about the artifact itself – the tool aborted and reported the content problem, so how the working directory is configured seems fine anyway since it got far enough along to look inside the artifact.

Hope this helps! :scientist:

1 Like