# Multiple subsampling from same alignment

**URL:** <https://nextstrain.discourse.group/t/multiple-subsampling-from-same-alignment/688>\
**Category:** Uncategorized\
**Created:** [August 31, 2021, 1:02pm UTC](https://nextstrain.discourse.group/t/multiple-subsampling-from-same-alignment/688 "2021-08-31T13:02:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@Eric](https://nextstrain.discourse.group/u/Eric)\
**Post date:** [August 31, 2021, 1:02pm UTC](https://nextstrain.discourse.group/t/multiple-subsampling-from-same-alignment/688/1 "2021-08-31T13:02:57Z")

</div>

Hi,

with the ncov workflow, is it possible to make multiple subsampling build without realigning data (ncov/results/aligned\_MyBuild.fasta) for each build. I guess we need to edit the Snakefile but I’m not sure where exactly.

Thanks  
Eric

---

<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:** [September 1, 2021, 1:01am UTC](https://nextstrain.discourse.group/t/multiple-subsampling-from-same-alignment/688/2 "2021-09-01T01:01:53Z")

</div>

Hi Eric - each `input` is only aligned once, and then multiple builds can use that alignment (Snakemake code is [here](https://github.com/nextstrain/ncov/blob/master/workflow/snakemake_rules/main_workflow.smk#L60)).

Each build can define a different subsampling scheme (or the same scheme with different wildcards) - [here’s](https://github.com/nextstrain/ncov/blob/master/nextstrain_profiles/nextstrain-open/builds.yaml#L32-L204) an example of such a workflow config.

P.S. `input` is each entry in the `builds.yaml→inputs` whereas a `build` is defined in `builds.yaml→builds` and each build uses the combined data from all inputs + a subsampling scheme.

---

<div class="post-metadata">

**Author:** ![Eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@Eric](https://nextstrain.discourse.group/u/Eric)\
**Post date:** [September 1, 2021, 1:04am UTC](https://nextstrain.discourse.group/t/multiple-subsampling-from-same-alignment/688/3 "2021-09-01T01:04:01Z")

</div>

Thank you James. This is exactly what I needed
