# Exclusion of forced sequences after augur filter step - seasonalflu build

**URL:** <https://nextstrain.discourse.group/t/exclusion-of-forced-sequences-after-augur-filter-step-seasonalflu-build/1300>\
**Category:** General\
**Created:** [January 10, 2023, 10:04pm UTC](https://nextstrain.discourse.group/t/exclusion-of-forced-sequences-after-augur-filter-step-seasonalflu-build/1300 "2023-01-10T22:04:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessagius](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jessagius](https://nextstrain.discourse.group/u/jessagius)\
**Post date:** [January 10, 2023, 10:04pm UTC](https://nextstrain.discourse.group/t/exclusion-of-forced-sequences-after-augur-filter-step-seasonalflu-build/1300/1 "2023-01-10T22:04:53Z")

</div>

Hey Nextstrain team! I was hoping to get some help with the flu build.

On visualising the tree, I realised that multiple of my h1n1 and h3n2 sequences were getting removed.  
I then forced the excluded sequences within the build, realising again they were still being excluded. On looking at the log files, it seemed that they were being forced into the build but removed after the filter step and at alignment. I inspected the majority of the excluded samples and saw that they had a string of approx \>20 Ns at the start of the sequence. As I do not have much experience with coding and Nextstrain, I tried to disable polytomies, resolutions and other flags I thought might be causing this, still with no luck. I would love to get some help on how to include these samples. They have been aligned and a tree devised using ggtree with no issues. I know they are considered “problematic” but still have passed our qc criteria, so would still like to have the option to include the in the tree.

Thank you!

Kind regards,  
Jess Agius

---

<div class="post-metadata">

**Author:** ![quietjen](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/quietjen/32/713_2.png) [@quietjen](https://nextstrain.discourse.group/u/quietjen)\
**Post date:** [January 11, 2023, 6:31pm UTC](https://nextstrain.discourse.group/t/exclusion-of-forced-sequences-after-augur-filter-step-seasonalflu-build/1300/2 "2023-01-11T18:31:38Z")

</div>

Sorry for the confusion! I think the `skip-diagnostics` described here might help

- [Why do my sequences end up in excluded\_by\_diagnostics.txt? - #2 by joverlee](https://nextstrain.discourse.group/t/why-do-my-sequences-end-up-in-excluded-by-diagnostics-txt/1250/2)

This should skip the QC length check (after dropping prefixed N regions), but do let us know if it works or not

---

<div class="post-metadata">

**Author:** ![jessagius](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jessagius](https://nextstrain.discourse.group/u/jessagius)\
**Post date:** [January 19, 2023, 11:06pm UTC](https://nextstrain.discourse.group/t/exclusion-of-forced-sequences-after-augur-filter-step-seasonalflu-build/1300/3 "2023-01-19T23:06:54Z")

</div>

Hi Jen,

Thank you so much for your quick reply and help.

Unfortunately, that did not work. Though, re-reading my post, I mean’t to say that the sequences got dropped at the alignment step, so there is no issue with the filter, they all pass the Augur filter phase in the flu build.

Would love any insight.

Thank you again for your help.  
Jess

---

<div class="post-metadata">

**Author:** ![jessagius](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@jessagius](https://nextstrain.discourse.group/u/jessagius)\
**Post date:** [January 30, 2023, 7:32am UTC](https://nextstrain.discourse.group/t/exclusion-of-forced-sequences-after-augur-filter-step-seasonalflu-build/1300/4 "2023-01-30T07:32:48Z")

</div>

Hi,

Just revisiting this post. I’ve gone through each step, checking what files make it through. It seems that the files are being dropped after the `scripts/codon_align.py` is ran. Is there something in this Python script that may cause my sequences to be filtered out?

Cheers,  
Jess

---

<div class="post-metadata">

**Author:** ![victorlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/victorlin/32/306_2.png) [@victorlin](https://nextstrain.discourse.group/u/victorlin)\
**Post date:** [January 30, 2023, 5:36pm UTC](https://nextstrain.discourse.group/t/exclusion-of-forced-sequences-after-augur-filter-step-seasonalflu-build/1300/5 "2023-01-30T17:36:29Z")

</div>

Hi @jessagius,

I’m not familiar with the seasonal flu build, but took a quick glance at [codon\_align.py](https://github.com/nextstrain/seasonal-flu/blob/a83f1c342c6d272ee9702505e72ba4da167d1be2/scripts/codon_align.py). It looks like a sequence can get dropped for any of these reasons:

1. If it does not align ([src](https://github.com/nextstrain/seasonal-flu/blob/a83f1c342c6d272ee9702505e72ba4da167d1be2/scripts/codon_align.py#L45-L47))
2. If amino acid alignment (1) fails, (2) contains more than 5 of `*` or `X` characters, or (3) the reference AA sequence contains more than 5 `-` characters ([src](https://github.com/nextstrain/seasonal-flu/blob/a83f1c342c6d272ee9702505e72ba4da167d1be2/scripts/codon_align.py#L62-L65))
3. The aligned sequences is not the same length as the reference sequence ([src](https://github.com/nextstrain/seasonal-flu/blob/a83f1c342c6d272ee9702505e72ba4da167d1be2/scripts/codon_align.py#L106-L107))

Furthermore, since you’ve noted that this is not an issue with `augur filter`, also note that the force-include options to `augur filter` (`--include`, `--include-where`) do not apply to the `codon_align.py` script.

– Victor
