Skip to content

Use augur subsample - #103

Open
victorlin wants to merge 4 commits into
masterfrom
victorlin/use-augur-subsample
Open

Use augur subsample#103
victorlin wants to merge 4 commits into
masterfrom
victorlin/use-augur-subsample

Conversation

@victorlin

@victorlin victorlin commented Sep 22, 2025

Copy link
Copy Markdown
Member

Note

Needs changes from nextstrain/augur#2038

Description of proposed changes

The previous subsampling implementation was fixed to a two-sample recent+background split with some hardcoded parameters. Replacing it with augur subsample allows for more flexible configuration.

In Snakemake, implementation is mostly copied from pathogen repos that have switched over to augur subsample. One notable difference is that the combine_samples rule must stay to handle output from the enrich_antibody_escape rule.

This is a breaking change and the old configuration will no longer work.

Related issue(s)

Closes #101

Checklist

old implementations

@victorlin victorlin self-assigned this Sep 22, 2025
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from e869e31 to 18232af Compare September 22, 2025 22:24
@victorlin victorlin mentioned this pull request Sep 22, 2025
2 tasks
@victorlin victorlin linked an issue Sep 22, 2025 that may be closed by this pull request
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 18232af to b0d6728 Compare September 24, 2025 20:20
Comment thread config/configfile.yaml Outdated
@victorlin victorlin mentioned this pull request Oct 7, 2025
3 tasks
@victorlin

Copy link
Copy Markdown
Member Author

I'll wait for a decision in nextstrain/public#27 before continuing here.

@victorlin
victorlin marked this pull request as draft October 7, 2025 02:18
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from b0d6728 to 5ee2efa Compare February 21, 2026 03:04
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 5ee2efa to 5490644 Compare February 26, 2026 01:04
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 5490644 to 42aa5f6 Compare March 6, 2026 01:48
Base automatically changed from victorlin/update-filter-config to master March 6, 2026 18:55
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 42aa5f6 to b437074 Compare March 7, 2026 02:28
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from a727f0c to 9b071fb Compare March 24, 2026 00:01
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch 4 times, most recently from e48b466 to 5741f0f Compare April 9, 2026 18:37
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch 2 times, most recently from a28275d to 3972508 Compare May 7, 2026 17:48
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 3ca4831 to 5093083 Compare August 6, 2026 17:37
@victorlin
victorlin marked this pull request as ready for review August 6, 2026 17:57

@joverlee521 joverlee521 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for continuing to push through this! I've only added small comments for docs/changelog edits.

Comment thread scripts/generate_default_config.py
Comment thread .gitattributes
Comment thread config/configfile.yaml Outdated
Comment thread CHANGELOG.md Outdated
## 2026

* TBD: Phylogenetic workflow configuration for initial quality filtering has moved to its own section, `filter_for_pre_subsample_alignment`.
* TBD: The `filter` section in phylogenetic workflow configuration has been replaced by `subsample`/`custom_subsample` for subsampling, and `filter_for_pre_subsample_alignment` for initial quality filtering. **This is a breaking change**.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another instance where proximity subsampling is not supported so we should note it in the config/changelog (similar to rubella).

We're going to continuously run into this issue if we don't reorder workflows to align before subsample...I wonder if we should build a way to flag this in the subsample schema validation?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted in changelog:

* NOTE: The workflow does not yet support proximal samples.

I wonder if we should build a way to flag this in the subsample schema validation?

How would this work? Aligned and unaligned are both FASTA files. We'd have to inspect the actual sequences, and even then it's still a guess. The context of whether a FASTA is aligned or not lives at the workflow level.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, I'm thinking in the schema validation side only.

I think this would require making two schemas for augur subsample, one that includes proximalSampleProperties and the other without proximalSampleProperties. Then in the RSV workflow config schema, we'd reference the subsample schema that does not include proximalSampleProperties.

@victorlin victorlin Aug 11, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done using a def inside the existing subsample config schema:

rsv/config.schema.yaml

Lines 89 to 96 in 54f6fd9

subsample: &subsample_config
<<: *per_full_build_map
description: >-
Subsampling configuration. When using --configfile, it is recommended to
use 'custom_subsample' instead to ignore default subsampling configuration.
patternProperties:
"^.*$":
$ref: "https://nextstrain.org/schemas/augur/subsample-config-unaligned/v1"

This needed two additional PRs:

@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch 2 times, most recently from f9c14c2 to 12efdc8 Compare August 11, 2026 19:00
@victorlin
victorlin changed the base branch from master to victorlin/config-schema August 11, 2026 19:00
Base automatically changed from victorlin/config-schema to master August 11, 2026 23:46
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 12efdc8 to 35d0ca8 Compare August 12, 2026 17:02
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 35d0ca8 to 54f6fd9 Compare August 12, 2026 18:06

@victorlin victorlin Aug 13, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c33cf92 is a significant change, basically option (1) from nextstrain/public#23.

Similar to "Add separate frequencies config" (0b22185), the
filter_for_pre_subsample_alignment rule shouldn't rely on config from
another rule.
The previous subsampling implementation was fixed to a two-sample
recent+background split with some hardcoded parameters. Replacing it
with augur subsample allows for more flexible configuration.

In Snakemake, implementation is mostly copied from pathogen repos that
have switched over to augur subsample. One notable difference is that
the combine_samples rule must stay to handle output from the
enrich_antibody_escape rule.

In the config YAML, the subsampling configuration is much more verbose
as a byproduct of increased flexibility. It was generated using a
script, which I'll add in another commit since it makes additional
changes.
The script restores some of the logic that was originally in the
hardcoded filter implementation, allowing easier bulk edits to the
subsample config.

One downside is that the generated file is less readable with a strict
YAML style and no comments. Comments have been moved to the script, but
ideally they'd live in a schema which is used to generate user-facing
docs.
The new name makes it more obvious that this rule is only used when
build_name=F-antibody-escape.
@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 54f6fd9 to d96e18a Compare August 20, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use augur subsample

4 participants