Skip to content

North america build & proximal subsampling example - #124

Merged
victorlin merged 14 commits into
mainfrom
proximal-subsampling
Jul 23, 2026
Merged

North america build & proximal subsampling example#124
victorlin merged 14 commits into
mainfrom
proximal-subsampling

Conversation

@jameshadfield

@jameshadfield jameshadfield commented Jun 15, 2026

Copy link
Copy Markdown
Member

Tasks

Review threads

Original description

See commit messages

This generalises the workflow and makes it much easier to add new builds

The config changes are not backwards compatible

I won't merge this until the blog / tutorial / docs have been written, but 👀 would be great!

@victorlin victorlin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread phylogenetic/defaults/config.yaml Outdated
Comment thread phylogenetic/defaults/config.yaml Outdated
Comment thread phylogenetic/rules/prepare_sequences.smk

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

Did a first pass, will need to wrap my head around the config changes a little bit more...

Comment thread phylogenetic/rules/prepare_sequences.smk Outdated
Comment thread phylogenetic/rules/prepare_sequences.smk
Comment thread phylogenetic/defaults/config.yaml Outdated
Comment thread phylogenetic/defaults/config.yaml Outdated
@jameshadfield
jameshadfield force-pushed the proximal-subsampling branch 2 times, most recently from b1e8944 to b9aa577 Compare June 19, 2026 00:09
Comment thread phylogenetic/defaults/config.yaml Outdated
Comment thread phylogenetic/defaults/config.yaml Outdated
Comment thread phylogenetic/rules/config.smk
Comment thread phylogenetic/defaults/config.yaml
@joverlee521 joverlee521 linked an issue Jun 30, 2026 that may be closed by this pull request
@victorlin
victorlin force-pushed the proximal-subsampling branch from 5e361c8 to c8eacb4 Compare July 6, 2026 18:31

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

Workflow changes look reasonable to me, left a non-blocking comment on potential direction for custom analyses set up.

Comment thread phylogenetic/custom-analyses/north-america-outbreak-example/README.md Outdated
Comment thread phylogenetic/Snakefile Outdated
Comment thread phylogenetic/defaults/config.yaml

@jameshadfield jameshadfield left a comment

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.

Thanks for taking over here @victorlin - it's looking great. I just updated the outbreak example's README. Apart from a rebase to clean up the commits I think this is good to go.

@victorlin victorlin self-assigned this Jul 20, 2026
@victorlin
victorlin force-pushed the proximal-subsampling branch from a5b0d12 to e4acc59 Compare July 20, 2026 20:24
We already exported the relevant metadata to show the data use terms
in Auspice
Removes the snakemake-hardcoded conditional rule selection and introduces
a new wildcard 'gene_or_genome' which operates above (i.e. before) the
build wildcard specific rules take over. This will allow more genome-based
builds (i.e. a north-america 2025/26 build) which can use the same genome
QC & alignment
to be defined in the config.yaml without needing to update a hardcoded list in
config.smk

Note: The intended error message (removed by this commit) was not working as
expected - the helpful text wasn't being printed. I didn't track down why not.
Add some basic error / completeness checking
The parameters for the build were first implemented on branch
trvrb/usa-analysis. Note that we don't run this (yet) as part
of our automated builds

Adding a third build prompted two config structure changes:

1. Supplying the actual command line strings to `augur refine` rather
   than using conditional helper functions
2. augur traits is now opt-in at the config level rather than hardcoded
   per-build conditionals in the snakefiles
@victorlin
victorlin force-pushed the proximal-subsampling branch from e4acc59 to 128edc3 Compare July 20, 2026 20:35
This is to be paired with a blog-post / tutorial

This was added as a new target within the canonical workflow,
but subsequent commits will change this style as it needs
PPX restricted data to be useful.

The format of config.export has been updated to allow build-specific options
@victorlin
victorlin force-pushed the proximal-subsampling branch from 128edc3 to 95f2c63 Compare July 20, 2026 20:36
@victorlin

Copy link
Copy Markdown
Member

Rebased, and in the process dropped 10315c9...bb30612 in favor of nextstrain/shared#78.

@victorlin
victorlin force-pushed the proximal-subsampling branch 2 times, most recently from 87a0191 to fdb8ef9 Compare July 20, 2026 23:13
Comment thread CHANGELOG.md Outdated
Comment thread phylogenetic/custom-analyses/north-america-outbreak-example/README.md Outdated
Comment thread phylogenetic/custom-analyses/north-america-outbreak-example/README.md Outdated
jameshadfield and others added 6 commits July 23, 2026 12:40
Into a separate config so we can (i) keep the canonical config cleaner and
(ii) we can keep PPX restricted data -- which is important for this example --
out of the canonical config.
Shorter name for the same idea, already used prior to "changed 'gene'
wildcard to 'build'" (46baf70).
It's good practice to set constraints for all wildcards used in the
workflow.

Move the helper function to config() so it is available early in the
workflow, and update it to take just a build name instead of a wildcards
variable.
Use slashes to organize builds by values in different parts. This is
common practice in multi-build Nextstrain workflows.

The implementation is flexible for use in other Nextstrain workflows.
'gene' is parsed out of the build name where needed, instead of
maintaining a separate 'build_to_gene' mapping. A new
'build_with_underscores' wildcard and 'copy_export' rule are introduced
to handle the name pattern expected for Auspice datasets.

Paths for files read and written by the workflow have been updated to
use slashes in build names as directories.
The example data isn't enough for the narrow filters used by
'genome/north-america'.
@victorlin
victorlin force-pushed the proximal-subsampling branch from 25d03d6 to 1ac7e75 Compare July 23, 2026 19:41
@victorlin
victorlin force-pushed the proximal-subsampling branch from 1ac7e75 to c6c403c Compare July 23, 2026 19:48
@victorlin
victorlin merged commit 7b04659 into main Jul 23, 2026
5 checks passed
@victorlin
victorlin deleted the proximal-subsampling branch July 23, 2026 19:50
joverlee521 added a commit that referenced this pull request Jul 24, 2026
Follow up to <#124 (comment)>

In the future, we can consider adding tests for other workflows and
move these tests to a generalized reusable workflow in nextstrain/.github.
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.

phylo: Implement proximity subsampling

3 participants