Skip to content

refactor(website): switch covid source to nextclade - #1388

Open
fhennig wants to merge 7 commits into
mainfrom
feat/covid-lineages-from-nextclade
Open

fhennig wants to merge 7 commits into
mainfrom
feat/covid-lineages-from-nextclade

Conversation

@fhennig

@fhennig fhennig commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

resolves #1382

Summary

Switch to pulling from nextclade, instead of cornelius' list. We already had the code in place for RSV.

A few definitions changed, some lineages were deleted (early ones) and some were added that were missing.

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

Felix Hennig and others added 6 commits October 1, 2026 13:35
… module

Pure move of the tree-walking and mutation-accumulation helpers out of the
RSV source, so they can be reused for other organisms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e configurable

Detect a lineage introduction where node_attrs.<lineage_attr> changes from the
parent node instead of relying on branch_attrs.labels.clade. The SARS-CoV-2
tree only labels Nextstrain clades on branches, Pango lineages are only
available as node_attrs.Nextclade_pango.

For RSV ("clade_membership") this is equivalent: the generated collections
are identical for the current RSV-A and RSV-B trees.

Also expose node_attrs and depth of the introducing node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tree

Derive the covid pango lineage collections from the Nextclade SARS-CoV-2
reference tree (nextclade_data, sars-cov-2/wuhan-hu-1/orfs/tree.json) instead
of corneliusroemer/pango-sequences, as we already do for RSV.

- Lineages come from node_attrs.Nextclade_pango. If a lineage is introduced
  at several places in the tree, the node closest to the root is used.
- Variants now also contain deletions (like the RSV lineages), the old source
  only had substitutions.
- "New" substitutions are those not in the parent lineage's definition.
- Source name, tag, collection names and variant names are unchanged, so
  existing collections are updated in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ltiple times

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o shared module

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to parent clade

The 'New ... substitutions' variants only contained the mutations on the
branch introducing the clade. Mutations on intermediate nodes between the
parent clade and the clade were missing, although they also distinguish the
clade from its parent. Use the difference to the parent clade's full set
instead, like for the covid pango lineages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dashboards Ready Ready Preview Oct 1, 2026 1:53pm UTC

Request Review

@fhennig
fhennig requested a balanced review from Copilot October 1, 2026 13:31
@fhennig fhennig self-assigned this Oct 1, 2026

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@fhennig fhennig changed the title refactor(collection-seeding): Switch covid source to nextclade refactor(website): Switch covid source to nextclade Oct 1, 2026
@fhennig
fhennig requested a balanced review from Copilot October 1, 2026 13:35

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Name-based parent lookup can generate incorrect mutation deltas for descendants of duplicate lineage introductions.

Review effort: Balanced
Findings: 1 High severity

Open (1)

Comment thread collection-seeding/sources/covid_pango_lineages.py Outdated
… ancestor clade

The parent clade was looked up by name. Since a clade can be introduced at
several nodes of the tree, and only one introduction per name is kept, this
could pick an unrelated introduction: e.g. BA.4 and BA.5 sit below the second
introduction of B.1.1.529 (inside BA.2) and got ~70 "new" mutations instead of
1-3. Affects 15 covid lineages in the current tree.

Compute new_nuc / new_aa during the tree walk instead, carrying the full sets
of the ancestor's introduction along the path. RSV output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Generated variant labels inaccurately describe deletion-containing mutation filters as substitutions.

Review effort: Balanced
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Rename variant labels to distinguish deletions from substitutions

collection-seeding/​sources/​covid_pango_lineages.py:62

These lists now intentionally contain deletions as well as substitutions (the new tests include A21766- and S:H69-), but all four user-facing variant names and descriptions below still call every entry a “substitution.” Rename them to nucleotide/amino-acid “mutations” (or otherwise distinguish deletions) so the generated collection does not misdescribe its filters.

@fhennig fhennig changed the title refactor(website): Switch covid source to nextclade refactor(website): switch covid source to nextclade Oct 2, 2026

This branch was successfully deployed

1 active deployment
Preview — 41b75210 Deployed Oct 1, 2026 by vercel[bot]
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.

generate cov collections not from Cornelius' list but from a nextclade list

2 participants