Skip to content

Support proximal sampling - #148

Draft
victorlin wants to merge 8 commits into
masterfrom
victorlin/proximal-sampling
Draft

victorlin wants to merge 8 commits into
masterfrom
victorlin/proximal-sampling

Conversation

@victorlin

@victorlin victorlin commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description of proposed changes

This PR contains 4 prep commits and 1 main commit, and 3 to-be-dropped testing commits. Commits to review: 7d91d8f...73c2e25

Some trial run links:

Partial DAG for a/genome/all-time, before:

dag

after:

dag-pr
commands
git switch master; nextstrain build . --forceall --dag dot \
    results/a/genome/all-time/tree.nwk \
| dot -Grankdir=LR -Granksep=0 -Nfontsize=20 -Tpng > dag.png

git switch victorlin/proximal-sampling; nextstrain build . --forceall --dag dot \
    results/a/genome/all-time/tree.nwk \
| dot -Grankdir=LR -Granksep=0 -Nfontsize=20 -Tpng > dag-pr.png

AI disclosure: ideas and code via Gemini 3.8 Flash

Related issue(s)

https://phylo-lab.slack.com/archives/C01G4B4UY31/p1791912750475389

Checklist

  • Checks pass
  • Update changelog

Added before index_sequences because no sequence-based filters are used.
Removing some filters that are now redundant with the previous filter
step.
@victorlin victorlin self-assigned this Oct 23, 2026
@victorlin
victorlin force-pushed the victorlin/proximal-sampling branch from ecfab64 to c91859a Compare October 23, 2026 23:58
Update cut.py to infer gene coordinates from the last matching gene or
CDS, the same way as newreference.py.
The trimmed Nextclade alignment is sufficient for all other genes.
To support proximal subsampling, sequences must be aligned and trimmed
to reference coordinates prior to subsampling. Done via several changes:

- A new rule `nextclade_align` replaces the former `genome_align` and
  `align_pre_subsample_sequences` and is run after the initial `filter`.
- A new rule `filter_f_translations` subsets the output of
  `nextclade_align` with respect to `filter_for_f_antibody_escape` to
  retain the behavior of `align_pre_subsample_sequences`.
- The rule `cut` is moved before subsampling to trim aligned sequences
  for gene builds.
- A new rule `cut_G` replaces the former `cut` and is only used for
  genome builds to prepare for MAFFT realignment.
- The rule `realign` is renamed to `realign_G` and only applies to
  `genome` and `G` builds.
- `hybrid_align` is renamed to `hybrid_align_genome` and is only used
  for genome builds. The underlying script has been simplified for this
  single use case.
@victorlin
victorlin force-pushed the victorlin/proximal-sampling branch from 3c63e0f to fe64f80 Compare October 30, 2026 00:32
@victorlin
victorlin force-pushed the victorlin/proximal-sampling branch from 4f854a8 to c630869 Compare October 30, 2026 17:05
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.

1 participant