# How to deal with samples with way too many mutations

**URL:** <https://nextstrain.discourse.group/t/how-to-deal-with-samples-with-way-too-many-mutations/756>\
**Category:** General\
**Created:** [September 30, 2021, 6:34pm UTC](https://nextstrain.discourse.group/t/how-to-deal-with-samples-with-way-too-many-mutations/756 "2021-09-30T18:34:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlu](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@dlu](https://nextstrain.discourse.group/u/dlu)\
**Post date:** [September 30, 2021, 6:34pm UTC](https://nextstrain.discourse.group/t/how-to-deal-with-samples-with-way-too-many-mutations/756/1 "2021-09-30T18:34:45Z")

</div>

Sometimes we get contextual samples (pulled by being closely related to my own samples) that have lots and lots of mutations (all samples here with \> 100 mutations here are collected in 2020 which is not biologically possible and must be due to sequencing/assembly errors).

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/9a6aeaf1e5fa2bfafe3091220645531f939eb8fe.jpeg)

I know Nextstrain team collects them and put them to exclude.txt and I could manually do that too, but we have too many automatically built trees for me to keep track of. I also try setting `clock_filter_iqd` down to 3, which lead to this tree above, should I keep tuning `clock_filter_iqd` down to a smaller number, or should I try something else?

---

<div class="post-metadata">

**Author:** ![aaziz](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/aaziz/32/272_2.png) [@aaziz](https://nextstrain.discourse.group/u/aaziz)\
**Post date:** [October 1, 2021, 4:31am UTC](https://nextstrain.discourse.group/t/how-to-deal-with-samples-with-way-too-many-mutations/756/2 "2021-10-01T04:31:54Z")

</div>

I’d be intrigued how others would solve this issue. Personally, I think there are a few possible solution, which are either done before or after tree construction.

1. Integrate NextClade (or similar) into the workflow to call mutations compared to common reference, exclude if they are above a threshold, followed by filtering.
2. Identify long branches, then prune (eg the R package `ape` has the `drop.tips` function or checkout `gotree`).

I personally think this is a data quality issue and not related to tree construction, so option #1. In other words you need to exclude these sequences before constructing your tree. The `augur filter` sub command takes in a tsv file, it’s possible to include a variable that contains number of mutations. So it’s possible to dynamically filter these out using an expression such as: ` –query “mutations > {threshold}”`.

---

<div class="post-metadata">

**Author:** ![PatrickSSte](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/patricksste/32/376_2.png) [@PatrickSSte](https://nextstrain.discourse.group/u/PatrickSSte)\
**Post date:** [August 5, 2022, 8:05pm UTC](https://nextstrain.discourse.group/t/how-to-deal-with-samples-with-way-too-many-mutations/756/3 "2022-08-05T20:05:00Z")

</div>

Hi both, did you see my suggestion?

> [@Trends in the prevalence of "private mutations"](https://nextstrain.discourse.group/t/trends-in-the-prevalence-of-private-mutations/1147):
>
> Hi All. I have an interest in the evolution of respiratory viruses - my co-author and I published a review article in Reviews in Medical Virology last year. I have a question about the SARS-CoV-2 strains that are excluded from Nextstrain because they have too many private mutations. I’m interested to know if the proportion of excluded strains increases during surges in C-19, and whether it decreases in the lulls. The reason I’m interested in this is explained in the thread below - originally…

A picture may make it clearer

[patrick.ss.home@gmail.com](mailto:patrick.ss.home@gmail.com)

 ![Hifi lofi strains](https://canada1.discourse-cdn.com/flex031/uploads/nextstrain/original/1X/e67007efbd4c507d76a2b4c383f8b06fcff406eb.png)
