# RESCRIPt "super" dereplicate incorrect taxonomic behavior

**URL:** <https://forum.qiime2.org/t/rescript-super-dereplicate-incorrect-taxonomic-behavior/27824>\
**Category:** Library Support\
**Tags:** rescript\
**Created:** [October 2, 2023, 4:13pm UTC](https://forum.qiime2.org/t/rescript-super-dereplicate-incorrect-taxonomic-behavior/27824 "2023-10-02T16:13:15Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)\
**Post date:** [October 5, 2023, 2:33pm UTC](https://forum.qiime2.org/t/rescript-super-dereplicate-incorrect-taxonomic-behavior/27824/10 "2023-10-05T14:33:03Z")

</div>

Hi @Will_Rumfelt

After conferring with @Nicholas_Bokulich, it turns out the code is working as written / intended. Below is the result of our discussion, which ultimately describes how `--p-mode super` works:

Dereplication with super mode, looks for the majority annotation (from among all collapsed sequences) at each rank independently. BUT it also collapses substrings into superstrings at each rank.

Let's assume we have 3 identical reference sequences with the following annotations:

| ID | annotation |
| --- | --- |
| GMGMR1817-18 | k\_\_Animalia;p\_\_Arthropoda;c\_\_Insecta;o\_\_Coleoptera;f\_\_Coccinellidae;g\_\_Harmonia;s\_\_Harmonia axyridis |
| GMGMU2090-20 | k\_\_Animalia;p\_\_Arthropoda;c\_\_Insecta;o\_\_Hymenoptera;f\_\_;g\_\_;s\_\_ |
| GMGMV5203-20 | k\_\_Animalia;p\_\_Arthropoda;c\_\_Insecta;o\_\_Hymenoptera;f\_\_;g\_\_;s\_\_ |

Using `--p-mode super` on this sequence set would indeed yield the following (bolding the order annotation that is wrong):  
k\_\_Animalia;p\_\_Arthropoda;c\_\_Insecta; **o\_\_Hymenoptera** ;f\_\_Coccinellidae;g\_\_Harmonia;s\_\_Harmonia axyridis

Why? Because super mode is first binning the annotations at each rank to yield something like:  
[k\_\_Animalia, k\_\_Animalia, k\_\_Animalia]  
...  
[o\_\_Coleoptera, o\_\_Hymenoptera, o\_\_Hymenoptera]  
[f\_\_Coccinellidae, f\_\_, f\_\_]  
[g\_\_Harmonia, g\_\_, g\_\_]  
[s\_\_Harmonia axyridis, s\_\_, s\_\_]

It then finds the superstrings at each rank independently:  
[o\_\_Coleoptera, o\_\_Hymenoptera, o\_\_Hymenoptera]  
[f\_\_Coccinellidae, f\_\_Coccinellidae, f\_\_Coccinellidae]  
[g\_\_Harmonia, g\_\_Harmonia, g\_\_Harmonia]  
[s\_\_Harmonia axyridis, s\_\_Harmonia axyridis]

and then finds the majority annotation to yield the incorrect hybrid annotation above. _Note that because the majority annotation has a bunch of empty ranks, the final annotation is "polluted" by a single reference annotation that **does not** have empty ranks at genus and species levels._

**Intended use of `--p-mode super`:**  
`super` mode was written with the assumption that you (a) do not have misannotations in your database and (b) you do not have empty ranks, or at least these empty ranks are not the "correct" annotation. Super was written to try to "fill in the blanks" when these annotations exist and will never work if the "desired" annotation is one with empty ranks.

I hope this helps!

---

_[View the full topic](https://forum.qiime2.org/t/rescript-super-dereplicate-incorrect-taxonomic-behavior/27824)._
