Hi everyone,
Following some investigation with @SoilRotifer, we were able to determine the cause of the unexpected truncation in the consensus taxonomy I reported earlier.
The issue is linked to missing taxonomic annotations at lower levels in the reference files. Returning to my previous example, the top hits for one ASV were:
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Creontiades
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Campylomma
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Creontiades
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Creontiades
Here, one hit lacked a genus annotation, so classify-consensus-vsearch returned:
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae
On the other hand, when we kept the empty placeholders for missing ranks in the reference:
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Creontiades;s_
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Creontiades;s_
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Campylomma;s_
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Creontiades;s_
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g_;s_
the consensus matched the expected result:
k__Metazoa;p__Arthropoda;c__Insecta;o__Hemiptera;f__Miridae;g__Creontiades;s_
Conclusion: It is a good idea to always include all rank levels in the reference taxonomy, even if they are just empty placeholders (e.g., f__, g__, s_). This should prevent unexpected truncation in consensus taxonomic assignments.
Some RESCRIPt actions, such as get_silva_data and get-ncbi-data, include a flag called --p-rank-propagation, to help mitigate this issue, as explained in this part of the SILVA tutorial.
Additionally, RESCRIPt provides an edit-taxonomy action that allows batch modification of taxonomic labels, including inserting missing prefixes when needed.
Thanks so much to the QIIME 2 team for all your help and support!