PGx: CYP2D6 structures from sub-region CN — *68+*4, *36+*10, *13 (PGX-013/018)

Sub-region CNs (p5, intron 2, exon 9) resolve full copies and *36/*68/*13 units; candidates carry the
tandem names, background alleles, and CPIC activity sums. GeT-RM: CYP2D6 13/15 top (NA12878 *3/*68+*4 and
NA11832 *1/*68+*4 exact), 15/15 within feasible; all genes 132/144.
This commit is contained in:
kemal committed 2026-09-29 16:29:54 +01:00
1 parent e75eea10aa
commit c1de527d75
7 files changed
+129 -31

No files matched your search

+15
View File
@@ -97,3 +97,18 @@ def test_variant_based_gene() -> None: # PGX-021: per-variant notation, diploty
recs = {("1", 100): [{"id": "p1", "ref": "C", "alts": ["T"], "gt": "0/0", "gs": "0.5", "baf": "0"}]}
gj, *_ = call_variant_gene("s", "s", m, recs, set(), StarOptions([], Path("x"), Path("y")))
assert gj is not None and gj["genotype"] == "Reference" and gj["feasible_solutions"] == ["Reference/Reference"]
def test_cyp2d6_structures() -> None: # PGX-013 CN rules
from simurg.pgx.star import Cyp2d6Structure, cyp2d6_structure, structure_candidates
assert cyp2d6_structure(3, 2, 2) == Cyp2d6Structure(2, 0, 1, 0) # *68 unit (NA12878 *3/*68+*4)
assert cyp2d6_structure(3, 3, 2) == Cyp2d6Structure(2, 1, 0, 0) # *36 unit
assert cyp2d6_structure(1, 2, 2) == Cyp2d6Structure(1, 0, 0, 1) # *13 hybrid
assert cyp2d6_structure(2, 2, 2) == Cyp2d6Structure(2, 0, 0, 0)
m = _model()
m.haplotypes = ["*1", "*4", "*10", "*2", "*5"]
names = {n for _, n in structure_candidates(m, Cyp2d6Structure(2, 0, 1, 0))}
assert ("*1", "*68+*4") in names and ("*68+*1", "*2") in names
names = {n for _, n in structure_candidates(m, Cyp2d6Structure(2, 1, 0, 0))}
assert ("*36+*10", "*4") in names and all("*36+*10" in n for n in names)