Error when collapsing at genus level: Feature IDs missing from taxonomy

Hello everyone,

I am analyzing a COI amplicon dataset and running into a taxonomy mismatch issue after filtering out unwanted lineages. The error appears specifically when I try to collapse my feature table at the genus level.

I first applied taxonomy-based filtering to remove unwanted groups (mitochondria, chloroplast, fungi, bacteria, archaea, plants, etc.):

qiime taxa filter-table \
  --i-table "$INPUT_TABLE" \
  --i-taxonomy "$INPUT_TAXONOMY" \
  --p-exclude "Fungi,fungi,Bacteria,bacteria,Archaea,archaea,chloroplast,Chloroplast,Carnivora,Streptophyta,Chlorophyta,Mucoromycota,Ailurus,Aves,Bacillariophyta,Unassigned" \
  --o-filtered-table "$FILTERED_TABLE"

qiime taxa filter-seqs \
  --i-sequences "$INPUT_REP_SEQS" \
  --i-taxonomy "$INPUT_TAXONOMY" \
  --p-exclude "Fungi,fungi,Bacteria,bacteria,Archaea,archaea,chloroplast,Chloroplast,Carnivora,Streptophyta,Chlorophyta,Mucoromycota,Ailurus,Aves,Bacillariophyta,Unassigned" \
  --o-filtered-sequences "$FILTERED_SEQS"

I then attempted to collapse the table at the genus level:
qiime taxa collapse \
  --i-table "$FILTERED_TABLE" \
  --i-taxonomy "$INPUT_TAXONOMY" \
  --p-level 6 \
  --o-collapsed-table "$OUTPUT_DIR/collapsed-table-genus.qza"

The issue

When collapsing at level 6 (genus), I get the following error:

How to solve this error.

Is it okay to continue with this error

1 Like

Hi @Ruba_Devi_S,

The error is telling you that your taxonomy file is missing taxonomic labels for the features in your table. Which means, however these separate files were made resulted in a discrepancy between the two files. I'd assume this happened, prior to your filtering step.

One way to test this, is to try collapse the taxonomy prior to filtering the unwanted labels. I'd expect you to obtain the same error.

Also, it is much safer to filter your sequences based on the contents of the table (or vice versa) by using either qiime feature-table filter-seqs ... to filter your sequences based on the contents of the table, and qiime feature-table filter-features ... to filter your table based on the content of the sequences (supply your sequence file as the metadata file).

3 Likes

I tried your suggestion but it gave me the same error. I’ve attached my command screen shot here

1 Like

Hello,

What puzzles me in your screenshot is that your message states that there are IDs present in your feature table and missing in the taxonomy file… and instead of ASV ids it is listing already collapsed to taxonomy level labels. It looks like you are trying to collapse already collapsed table. Could you check it?

2 Likes

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