# Modifying workflow to use pre-existing alignment

**URL:** <https://nextstrain.discourse.group/t/modifying-workflow-to-use-pre-existing-alignment/221>\
**Category:** Uncategorized\
**Created:** [December 8, 2020, 6:09pm UTC](https://nextstrain.discourse.group/t/modifying-workflow-to-use-pre-existing-alignment/221 "2020-12-08T18:09:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rebeccarose](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@rebeccarose](https://nextstrain.discourse.group/u/rebeccarose)\
**Post date:** [December 8, 2020, 6:09pm UTC](https://nextstrain.discourse.group/t/modifying-workflow-to-use-pre-existing-alignment/221/1 "2020-12-08T18:09:34Z")

</div>

Hi!

I would like to modify my workflow so that a file of new sequences are aligned and added to a pre-existing alignment. I know that I can do this via

augur align --existing-alignment`

but I’m unsure how to incorporate this into a workflow. I _think_ that I need to create a custom rule file (my\_profiles/my\_example/my\_rules.smk) and then add the following lines to my builds.yaml file (my\_profiles/my\_example/builds.yaml)

custom\_rules:

- my\_profiles/my\_example/my\_rules.smk

However I’m not really sure what should go in the my\_rules.smk file. Looking at the default main\_workflow.smk file, the rule “align” follows “checkpoint partition\_sequences”. So if I create a new rule “align”, I’m not sure how to reference my input files correctly. It seems like I might have to skip the partitioning step, but I’m not sure how to create a rule that does that.

Or maybe I’m completely on the wrong track here…

I didn’t see anything in the documentation that addressed quite this issue so my apologies if I’ve missed it. Your advice would be very appreciated!

---

<div class="post-metadata">

**Author:** ![james](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/james/32/11_2.png) [@james](https://nextstrain.discourse.group/u/james)\
**Post date:** [December 10, 2020, 2:27am UTC](https://nextstrain.discourse.group/t/modifying-workflow-to-use-pre-existing-alignment/221/2 "2020-12-10T02:27:45Z")

</div>

Hey Rebecca – we’re working on some solutions to this which should be merged into the master branch in the coming days: [https://github.com/nextstrain/ncov/pull/516](https://github.com/nextstrain/ncov/pull/516) and [https://github.com/nextstrain/ncov/pull/519](https://github.com/nextstrain/ncov/pull/519). I’ll try to write some documentation and check back in here once this functionality is working smoothly.

---

<div class="post-metadata">

**Author:** ![rebeccarose](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@rebeccarose](https://nextstrain.discourse.group/u/rebeccarose)\
**Post date:** [December 10, 2020, 1:22pm UTC](https://nextstrain.discourse.group/t/modifying-workflow-to-use-pre-existing-alignment/221/3 "2020-12-10T13:22:24Z")

</div>

Oh great, thank you!
