Ancom-BC2 error: No features remained in your taxonomy

Dear all,

I am trying the new Ancom-BC2 wrapper and in the visualization part I got the error.

Commands:

qiime composition ancombc2 \
    --i-table {outdir}/table.qza \
    --m-metadata-file metadata.tsv \
    --p-fixed-effects-formula Treatment \
    --p-num-processes 4 \
    --o-ancombc2-output {outdir}/abc2-output.qza

qiime composition ancombc2-visualizer \
    --i-data {outdir}/abc2-output.qza \
    --i-taxonomy {TAXAR} \
    --o-visualization {outdir}/abc2-output.qzv

Error:

Traceback (most recent call last):
  File "/home/ty/miniforge3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2cli/commands.py", line 529, in __call__
    results = self._execute_action(
  File "/home/ty/miniforge3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2cli/commands.py", line 601, in _execute_action
    results = action(**arguments)
  File "<decorator-gen-17>", line 2, in ancombc2_visualizer
  File "/home/ty/miniforge3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 221, in bound_callable
    outputs = self._callable_executor_(
  File "/home/ty/miniforge3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/qiime2/sdk/action.py", line 408, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/home/ty/miniforge3/envs/qiime2-amplicon-2025.4/lib/python3.10/site-packages/q2_composition/_ancombc2.py", line 878, in ancombc2_visualizer
    raise ValueError(msg)
ValueError: No features remained in your taxonomy after intersecting it with the features present in your ANCOMBC2 data. Ensure that the taxonomy provided contains the features present in the ANCOMBC2 slices.

I double checked and pretty sure that all features from the table are represented in my taxonomy file. Excluding taxonomy from the command produces visualization as expected. If it is important: my feature table and taxonomy file are the output from the moshpit 2025.4.

PS. Is there any way to run Ancom-BC2 though q2-plugin in the pairwise mode?

Hey @timanix!

Would you mind sharing your taxonomy and ancombc2 outputs with me so I can try and reproduce/poke around a bit? Feel free to send me a DM if you don't want to share those outputs publicly!

Cheers :lizard:

1 Like

Hello @lizgehret,

Thank you for the reply.
I already collapsed my feature table to the species level and rerun the Ancombc2, so I don't have the output. But I shared with you taxonomy, feature table and metadata file. Please use Treatment column as the Group variable.

BTW, is it possible to run ancombc2 in the pairwise mode via Q2?

Best,
Timur

Hello @timanix,

We chose not to expose certain ancombc2 parameters in order to minimize complexity, the pairwise parameter included. For example, if I'm remembering correctly, exposing the pairwise parameter would require exposing at least one more parameter that configures the pairwise parameter with R-specific data structures. If we get many requests for any of the unexposed parameters we can of course add new ones in the future.

Hi @colinvwood

Thank you for the clarification!

I remember at least three in the past =).

Hi @lizgehret and @timanix,
just to follow up on this, I am working too on a project with mosph (I do too work on already collapsed taxonomies ) and I got the same error. In my understanding all the filtering should had happen in the 'composition ancombc2' step, while the error is from the visualizer plug in. I can confirm that excluding the '--taxonomy' option provide the output, thanks @timanix I did not think to try this.

PS, is it normal that for any mosph plug in I used so far I always have a 'Failed to query server: Connection timed out' error message???

Cheers
Luca

Hi!
Just out of curiosity - you got the error with collapsed tables (expected error) or as me with uncollapsed (unexpected error) table?

I don't have this error both on the local machine and HPC

Hi @timanix,
answering myself now .. I believe the taxonomy option did not work in my case because I am using a collapsed feature table ..while the feature ids in the taxonomy file are pointing to features in the un-collapsed feature table ..

EDIT: I did a quick test using the un-collapsed feature table in the ancombc2, the visualizer with the taxonomy option still does not work for me, returning the same error:

Plugin error from composition:

  No features remained in your taxonomy after intersecting it with the features present in your ANCOMBC2 data. Ensure that the taxonomy provided contains the features present in the ANCOMBC2 slices.

This was unexpected ...
PS in the visualizer did you find an option to parse the taxonomy string as is in the ancombc vizualiser (' --p-level-delimiter ';' ')?
Cheers
Luca

Yes, the error is expected with collapsed tables. I collapsed my tables as a workaround to have taxonomies instead of sequence IDs, but I got the original error in the post with an uncollapsed table.

I didn't search for it since usually I just parse jsonl files from ancombc2 output and plot barplots/heatmaps of significant differentials.

Best,
Timur

1 Like

I just wanted to add my two cents :coin:, I often need to perform multiple pairwise ancombc comparisons too. So, it'd be nice to have this natively supported.

Also, I have run ancombc2 on taxonomy-collapsed feature tables without the taxonomy flag and it works just fine. I will say that I also made the mistake of supplying the taxonomy file initially, and obtained the same error. Then I realized I did not need to supply the file when I already collapsed by taxonomy... :slight_smile:

2 Likes

Another vote for native pairwise comparison support (with proper p.adjust), huge bonus if the specific pairwise comparisons of interest can be provided to avoid losing power unnecessarily.:sweat_smile:
That goes for any DA tool though, in my experience this has been by far one of the most common request/issues in workshops from users that can't custom code that last part themselves, to the point where they would migrate to different tools just for that convenience.

2 Likes