Skip to content

Duo's second member can be a sibling #1861 - #1863

Open
davmlaw wants to merge 1 commit into
masterfrom
1861_duo_sibling
Open

Duo's second member can be a sibling #1861#1863
davmlaw wants to merge 1 commit into
masterfrom
1861_duo_sibling

Conversation

@davmlaw

@davmlaw davmlaw commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

#1861 asks for the Duo to cover the two kinds of pair a lab sees: parent + child, and two siblings (usually both affected). Rather than a second family model and node, the Duo gains a third relationship.

Data

Duo.parentDuo.relative, parent_affectedrelative_affected, and DuoRelationship gains Sibling. Migration snpdb/migrations/0262_duo_sibling.py is two RenameFields plus the choices change - existing rows are all Mother/Father and need no backfill.

Zygosity rules

R = relative, P = proband. The parent columns are today's behaviour, unchanged. "not HOM_ALT" is {HET, HOM_REF, MISSING}, the Quad's unaffected-sibling set.

Mode Parent (as now) Sibling, affected Sibling, unaffected
Recessive R HET, P HOM_ALT R HOM_ALT, P HOM_ALT R not HOM_ALT, P HOM_ALT
Dominant R has/lacks by affected, P has R has, P has R lacks, P has
X-linked recessive R HET, P HOM_ALT, chrX R HOM_ALT, P HOM_ALT, chrX R not HOM_ALT, P HOM_ALT, chrX
All recessive AR, plus XLR branch when mother AR or XLR AR or XLR
C. Het one hit R HET, one hit R lacks R HET on every hit R unconstrained
Any affected OR of affected members OR of both P alone
Absent in parent R lacks, P has unavailable unavailable
Dominant (mosaic parent) R low-VAF, P has unavailable unavailable

Notes:

  • Dominant with an unaffected sibling is a valid discordant-pair filter, so the "Dominant inheritance requires an affected parent" error now applies to parent relationships only; "X-linked recessive needs the mother" applies only when the relative is the father.
  • Compound het with a sibling is unphased - both halves of the two-pass query return the same tuple, so the OR collapses to one branch, and the node warns that the hits may be in cis (an unaffected sibling carrying both is not excluded either - the same gap as QuadCompHet).
  • Absent in parent and mosaic parent raise an inheritance error for a sibling duo; the editor disables them the way it already disables X-linked for a father. ignore_field_errors still lets a user run them.

UI

The node editor's zygosity table is keyed on the plainest name that still tells its rows apart - relative, with a _<relationship> and/or _affected/_unaffected suffix only where the mode reads differently - and the editor's lookup() tries those in the same order. The wizard offers Sibling to either sex and ticks that sample's affected box when picked, and node-icon-duo gained a sibling half (sibship bar, proband beside an overlapped square and circle) shown by .duo-sibling.

Testing

analysis/tests/test_duo_node.py (60 tests, 13 new for the sibling duo), the wizard form/view tests, and snpdb.tests.test_urls renders the view page for a sibling duo. Full suite: 3244 tests, OK.

Deploy

manage.py migrate - the rename has not been run anywhere yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_018pFmKeAyS7Fu5mbpAMqKT2

The Duo now covers both kinds of pair a lab sees: proband + parent, and two
siblings. Duo.parent becomes Duo.relative (parent_affected -> relative_affected)
and DuoRelationship gains Sibling.

A sibling pair carries no parental transmission, so:
- recessive / X-linked recessive ask an affected sibling for the proband's own
  HOM_ALT and an unaffected one for anything short of it
- dominant's affected/unaffected formula already is the sibling rule, so the
  "requires an affected parent" check only applies to a parent duo
- all recessive keeps the XLR branch for anything but the father
- compound het collapses to one unphased branch and warns the hits may be in cis
- absent in parent and mosaic parent raise an inheritance error

The node editor's zygosity table is keyed on the plainest name that still tells
its rows apart, with a _<relationship> and/or _affected suffix only where the
mode reads differently. The wizard offers Sibling to either sex and ticks its
affected box, and node-icon-duo gained a sibling half.
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