Skip to content

Use augur subsample - #103

Merged
victorlin merged 4 commits into
masterfrom
victorlin/use-augur-subsample
Oct 5, 2026
Merged

victorlin merged 4 commits into
masterfrom
victorlin/use-augur-subsample

Conversation

@victorlin

@victorlin victorlin commented Sep 22, 2025 •

Copy link
Copy Markdown
Member

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 done
@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 done
@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
@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.

@victorlin
victorlin force-pushed the victorlin/use-augur-subsample branch from 54f6fd9 to d96e18a Compare August 20, 2026 17:59
@rneher

rneher commented Aug 28, 2026

Copy link
Copy Markdown
Member

Thanks for pushing this, Victor. I am a bit on the fence here. What bugs me most about this is that if one now wants to change something in the workflow, one has to trace the config that ends up as input in the rules through even more layers of input functions and config generators. I am wondering whether part of this problem could be avoided if instead of using write_subsample_config to pull out a specific section of the main file, we just use the generate_default_config to produce that section and place it as subsample_config into the corresponding results directory? This would also avoid having to commit the generated config and the resulting duplication parameters. The config could then specify custom subsampling configs if desired and fall back on the autogenerated ones.

@victorlin

Copy link
Copy Markdown
Member Author

Users currently rely on values in the default config file for inheritance and documentation. There are better ways to provide documentation, but values in the default config file is necessary for the inheritance aspect. So I don't think we can save the generated default subsample values directly to results without breaking config inheritance.

That said, I take your point on increased complexity in how config is passed around, though for this PR I think that comes more from the switch to augur subsample – the pattern of providing config via an exported YAML file – than from the switch to generating default config via script.

I can drop c33cf92 if you/others are ok with hand-editing the default config file, similar to how things are done with ncov's builds.yaml.

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 d96e18a to 276a24e Compare October 5, 2026 22:53
@victorlin
victorlin merged commit 12096ee into master Oct 5, 2026
3 checks passed
@victorlin
victorlin deleted the victorlin/use-augur-subsample branch October 5, 2026 23:03
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

5 participants