Taxonomy not inherited to a filtered table?

I am using QIIME2 (2023 release) on a HPCC setup
In trying to make a barplot I have encountered an issue I do not understand the possible origin of.
As background for this I will explain the path so far:

  1. dada2 is used to denoise samples, generating repseqs.qza, table.qza, stats.qza
  2. Taxonomy is assigned to repseqs.qza via classify-hybrid-vsearch-sklearn making taxonomy.qza
  3. table.qza is filtered to remove repseqs that failed to be classified as to be compatible with taxa collapse making table-filtered.qza
  4. taxa collapse --i-table table-filtered.qza --i-taxonomy taxonomy.qza --p-level 6 --o-collapsed-table table-filtered-collapsed.qza
  5. taxa barplot --i-table table-filtered-collapsed.qza --i-taxonomy taxonomy.qza --o-visualization table-filtered-collapsed.qzv

In doing this, I got an error I didn't really expect?
error log is as follows

Traceback (most recent call last):
File "/mnt/home/user/anaconda3/envs/qiime2/lib/python3.8/site-packages/q2cli/", line 352, in call
results = action(**arguments)
File "", line 2, in barplot
File "/mnt/home/user/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/sdk/", line 234, in bound_callable
outputs = self.callable_executor(scope, callable_args,
File "/mnt/home/user/anaconda3/envs/qiime2/lib/python3.8/site-packages/qiime2/sdk/", line 443, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File "/mnt/home/user/anaconda3/envs/qiime2/lib/python3.8/site-packages/q2_taxa/", line 41, in barplot
collapsed_tables = _extract_to_level(taxonomy, table)
File "/mnt/home/user/anaconda3/envs/qiime2/lib/python3.8/site-packages/q2_taxa/", line 42, in _extract_to_level
collapsed_table = _collapse_table(table, taxonomy, level, max_obs_lvl)
File "/mnt/home/user/anaconda3/envs/qiime2/lib/python3.8/site-packages/q2_taxa/", line 19, in _collapse_table
raise ValueError('Feature IDs found in the table are missing from the '
ValueError: Feature IDs found in the table are missing from the taxonomy:{'k__Fungi;p__Basidiomycota;c__Agaricomycetes;o__Polyporales;f__Irpicaceae;g__Irpicaceae_gen_Incertae_sedis',...}

The list is massive, ~500 taxonomy annotations in this vein. They vary in depth (some are just Kingdom, some all the way to genus)
To my understanding, this is saying that the list of taxonomies are present in table-filtered-collapsed.qza but NOT taxonomy.qza. But, taxonomy.qza was the source for taxonomic assignment that would be present in table-filtered-collapsed.qza

How does this happen? Where did these assignments come from? Also, checking taxonomy.qza, there are instances where the IDs allegedly missing from the taxonomy are present to the same level. For some of the others, they are present, although taxonomy.qza goes to species and not genus.

If table-filtered-collapsed.qza only had taxonomy assignments come from taxonomy.qza, how did it apparently gain ~500 new annotations that are not present in taxonomy.qza?

While collapsing your table to certain taxonomy level yours ASV ids were replaced with corresponding taxonomy annotations. It is why you encountered this error.
To create a taxonomy barplot, you don't need to collapse the feature table - ASV table should be provided instead.

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