polygenic-pgx 2.6.2__tar.gz → 2.6.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/CHANGELOG.md +20 -2
  2. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/MANIFEST.in +4 -0
  3. {polygenic_pgx-2.6.2/polygenic_pgx.egg-info → polygenic_pgx-2.6.3}/PKG-INFO +21 -3
  4. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/README.md +20 -2
  5. polygenic_pgx-2.6.3/polygenic/model/core_variants.py +84 -0
  6. polygenic_pgx-2.6.3/polygenic/model/gene_defaults.json +33 -0
  7. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/model/model.py +437 -26
  8. polygenic_pgx-2.6.3/polygenic/model/registry.py +612 -0
  9. polygenic_pgx-2.6.3/polygenic/model/source_releases.json +32 -0
  10. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/model/summary.py +15 -3
  11. polygenic_pgx-2.6.3/polygenic/models/pgx/cyp2c19-pharmvar-5.1.8.yml +425 -0
  12. polygenic_pgx-2.6.3/polygenic/models/pgx/cyp4f2-pharmvar-6.2.29.yml +209 -0
  13. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/dpyd-clinpgx-1.0.0.yml +110 -1
  14. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/manifest.json +254 -34
  15. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/pgstk.py +22 -0
  16. polygenic_pgx-2.6.3/polygenic/tools/modellist.py +283 -0
  17. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/modelmanifest.py +62 -20
  18. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/pgscompute.py +12 -2
  19. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/version.py +1 -1
  20. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3/polygenic_pgx.egg-info}/PKG-INFO +21 -3
  21. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic_pgx.egg-info/SOURCES.txt +5 -1
  22. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/setup.py +3 -2
  23. polygenic_pgx-2.6.2/polygenic/model/registry.py +0 -255
  24. polygenic_pgx-2.6.2/polygenic/models/pgx/cyp4f2-pharmvar-5.1.8.yml +0 -28
  25. polygenic_pgx-2.6.2/polygenic/tools/modellist.py +0 -150
  26. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/LICENSE +0 -0
  27. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/__init__.py +0 -0
  28. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/__main__.py +0 -0
  29. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/__init__.py +0 -0
  30. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/csv_accessor.py +0 -0
  31. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/data_accessor.py +0 -0
  32. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/gwas.py +0 -0
  33. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/mobigen_utils.py +0 -0
  34. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/polars_frame.py +0 -0
  35. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/snp_data.py +0 -0
  36. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/vcf_accessor.py +0 -0
  37. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/data/vcf_record.py +0 -0
  38. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/error/__init__.py +0 -0
  39. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/error/polygenic_exception.py +0 -0
  40. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/model/__init__.py +0 -0
  41. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/model/cnv_depth.py +0 -0
  42. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/model/hgnc.json +0 -0
  43. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/model/indel_alignment.py +0 -0
  44. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/model/panel.py +0 -0
  45. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/model/utils.py +0 -0
  46. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/abcg2-pharmgkb-1.0.0.yml +0 -0
  47. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/apoe-1.0.0.yml +0 -0
  48. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/bche-1.0.0.yml +0 -0
  49. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cacna1s-pharmgkb-1.0.0.yml +0 -0
  50. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cftr-pharmgkb-1.0.0.yml +0 -0
  51. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/comt-1.0.0.yml +0 -0
  52. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp1a1-pharmgkb-1.0.0.yml +0 -0
  53. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp1a2-pharmvar-6.2.25.yml +0 -0
  54. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp26a1-pharmvar-5.1.8.yml +0 -0
  55. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2a13-pharmvar-6.2.29.yml +0 -0
  56. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2a6-pharmvar-6.2.29.yml +0 -0
  57. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2b6-pharmvar-6.2.29.yml +0 -0
  58. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2c19-pharmvar-6.2.29.yml +0 -0
  59. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2c8-pharmvar-5.1.8.yml +0 -0
  60. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2c9-pharmvar-6.2.29.yml +0 -0
  61. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2d6-pharmvar-5.1.8.yml +0 -0
  62. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2e1-pharmgkb-1.0.0.yml +0 -0
  63. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2f1-pharmvar-5.1.8.yml +0 -0
  64. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2j2-pharmvar-5.1.8.yml +0 -0
  65. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2r1-pharmvar-5.1.8.yml +0 -0
  66. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2s1-pharmvar-5.1.8.yml +0 -0
  67. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp2w1-pharmvar-5.1.8.yml +0 -0
  68. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp3a4-pharmvar-6.2.29.yml +0 -0
  69. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp3a43-pharmvar-5.1.8.yml +0 -0
  70. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp3a5-pharmvar-6.2.29.yml +0 -0
  71. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/cyp3a7-pharmvar-5.1.8.yml +0 -0
  72. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/dpyd-pharmvar-6.2.29.yml +0 -0
  73. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/f2-1.0.0.yml +0 -0
  74. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/f5-1.0.0.yml +0 -0
  75. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/g6pd-pharmgkb-1.0.0.yml +0 -0
  76. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/ifnl3-1.0.0.yml +0 -0
  77. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/ifnl4-1.0.0.yml +0 -0
  78. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/mthfr-1.0.0.yml +0 -0
  79. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/mtrnr1-cpic-1.0.0.yml +0 -0
  80. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/nat2-pharmvar-6.2.29.yml +0 -0
  81. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/nudt15-pharmvar-6.2.29.yml +0 -0
  82. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/oprm1-1.0.0.yml +0 -0
  83. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/ryr1-pharmgkb-1.0.0.yml +0 -0
  84. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/slco1b1-pharmvar-6.2.29.yml +0 -0
  85. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/tpmt-cpic-1.0.0.yml +0 -0
  86. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/ugt1a1-pharmgkb-1.0.0.yml +0 -0
  87. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/ugt2b15-pharmgkb-1.0.0.yml +0 -0
  88. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/models/pgx/vkorc1-1.0.0.yml +0 -0
  89. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/resources/chromsizes/hg38.chrom.sizes +0 -0
  90. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/rsidx/__init__.py +0 -0
  91. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/rsidx/__main__.py +0 -0
  92. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/rsidx/_version.py +0 -0
  93. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/rsidx/cli.py +0 -0
  94. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/rsidx/index.py +0 -0
  95. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/rsidx/search.py +0 -0
  96. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/templates/pgscompute-header.md +0 -0
  97. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/templates/pgscompute-model.md +0 -0
  98. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/__init__.py +0 -0
  99. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/data/__init__.py +0 -0
  100. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/data/chromsizes.py +0 -0
  101. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/data/colors.py +0 -0
  102. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/gwasfilecreate.py +0 -0
  103. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/modelbiobankuk.py +0 -0
  104. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/modeldiff.py +0 -0
  105. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/modelgwasfile.py +0 -0
  106. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/modelpgscat.py +0 -0
  107. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/plotmanhattan.py +0 -0
  108. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/tsvtovcf.py +0 -0
  109. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/utils.py +0 -0
  110. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/vcfimpute.py +0 -0
  111. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/vcfindex.py +0 -0
  112. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/vcfstatbaf.py +0 -0
  113. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic/tools/vcfstatzygosity.py +0 -0
  114. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic_pgx.egg-info/dependency_links.txt +0 -0
  115. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic_pgx.egg-info/entry_points.txt +0 -0
  116. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic_pgx.egg-info/requires.txt +0 -0
  117. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/polygenic_pgx.egg-info/top_level.txt +0 -0
  118. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/pyproject.toml +0 -0
  119. {polygenic_pgx-2.6.2 → polygenic_pgx-2.6.3}/setup.cfg +0 -0
@@ -3,6 +3,21 @@
3
3
  Release history for `polygenic-pgx`. Newest first. The three most recent entries are also
4
4
  repeated in `README.md` (which is the PyPI project page).
5
5
 
6
+ ### 2.6.3
7
+
8
+ **`cyp2c19-pharmvar-5.1.8` is back, as a second CYP2C19 model you select by name.** It is the
9
+ model that 2.5.33-2.5.36 shipped (and that pgx task 2.6.2 / 2.7.1 ran as the unversioned
10
+ `CYP2C19.yml`), restored byte-identical: sha256 `7a1bdd54...`, removed in `642b702` when
11
+ CYP2C19 was rebuilt from PharmVar 6.2.29. On a GenosMedica WES sample (BT-2440) 6.2.29 calls
12
+ `*2/*35` (Poor Metabolizer) where the earlier releases reported `*1/*2` (Intermediate
13
+ Metabolizer). The pipeline can now pin the earlier model with `-m cyp2c19-pharmvar-5.1.8`.
14
+ **`-m cyp2c19` and `--genes CYP2C19` still resolve to `cyp2c19-pharmvar-6.2.29`**: both models
15
+ come from PharmVar, so the newer version is the default and `gene_defaults.json` needs no entry.
16
+
17
+ This release also ships multi-version model support (several versions of one gene, a declared
18
+ per-gene default, versions in `model-list`) and the BT-2440 fixes to CYP4F2, CYP2C19, DPYD and
19
+ CYP2F1.
20
+
6
21
  ### 2.6.2
7
22
 
8
23
  **DPYD \*3 and \*7 are callable again, and six other models with them.** `3204249` (2.5.29)
@@ -30,8 +45,11 @@ defined by the GRCh38 reference base at `4-68670366`**, so without a `reference_
30
45
  declaration an unassayed sample reported a confident homozygous call instead of Indeterminate --
31
46
  declared and fixed. DPYD now also ships as `dpyd-clinpgx-1.0.0` (84 alleles, CPIC/HGVS names)
32
47
  beside the PharmVar build, so the gene can be joined to the CPIC function tables again.
33
- **Breaking:** `-m dpyd` is therefore ambiguous and raises -- pass `-m dpyd-clinpgx-1.0.0` or
34
- `-m dpyd-pharmvar-6.2.29`.
48
+ `-m dpyd` was briefly ambiguous and raised; since the per-gene default table it resolves to
49
+ `dpyd-clinpgx-1.0.0`, which is what production runs -- the deployed `DPYD.yml` is content-identical
50
+ to it, and it is the only one of the two that joins the CPIC tables. Pass `-m dpyd-pharmvar` (or the
51
+ full name) for the other. A panel report still carries both: the nomenclatures are not
52
+ interchangeable.
35
53
 
36
54
  ### 2.6.1
37
55
 
@@ -7,5 +7,9 @@ recursive-include polygenic/models *.yml
7
7
  include polygenic/models/pgx/manifest.json
8
8
  # gene symbol -> HGNC id, read at runtime by registry.hgnc_id_for()
9
9
  include polygenic/model/hgnc.json
10
+ # upstream release dates we cannot derive from an export, read by registry.source_release_date()
11
+ include polygenic/model/source_releases.json
12
+ # which packaged model `-m <gene>` resolves to, for genes shipping more than one
13
+ include polygenic/model/gene_defaults.json
10
14
  # full release history (README keeps only the newest entries)
11
15
  include CHANGELOG.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polygenic-pgx
3
- Version: 2.6.2
3
+ Version: 2.6.3
4
4
  Summary: Polygenic score toolkit
5
5
  Home-page: https://github.com/marpiech/polygenic
6
6
  Author: Marcin Piechota, Wojciech Galan
@@ -555,6 +555,21 @@ Proprietary (contact@intelliseq.pl)
555
555
 
556
556
  ## Updates
557
557
 
558
+ ### 2.6.3
559
+
560
+ **`cyp2c19-pharmvar-5.1.8` is back, as a second CYP2C19 model you select by name.** It is the
561
+ model that 2.5.33-2.5.36 shipped (and that pgx task 2.6.2 / 2.7.1 ran as the unversioned
562
+ `CYP2C19.yml`), restored byte-identical: sha256 `7a1bdd54...`, removed in `642b702` when
563
+ CYP2C19 was rebuilt from PharmVar 6.2.29. On a GenosMedica WES sample (BT-2440) 6.2.29 calls
564
+ `*2/*35` (Poor Metabolizer) where the earlier releases reported `*1/*2` (Intermediate
565
+ Metabolizer). The pipeline can now pin the earlier model with `-m cyp2c19-pharmvar-5.1.8`.
566
+ **`-m cyp2c19` and `--genes CYP2C19` still resolve to `cyp2c19-pharmvar-6.2.29`**: both models
567
+ come from PharmVar, so the newer version is the default and `gene_defaults.json` needs no entry.
568
+
569
+ This release also ships multi-version model support (several versions of one gene, a declared
570
+ per-gene default, versions in `model-list`) and the BT-2440 fixes to CYP4F2, CYP2C19, DPYD and
571
+ CYP2F1.
572
+
558
573
  ### 2.6.2
559
574
 
560
575
  **DPYD \*3 and \*7 are callable again, and six other models with them.** `3204249` (2.5.29)
@@ -582,8 +597,11 @@ defined by the GRCh38 reference base at `4-68670366`**, so without a `reference_
582
597
  declaration an unassayed sample reported a confident homozygous call instead of Indeterminate --
583
598
  declared and fixed. DPYD now also ships as `dpyd-clinpgx-1.0.0` (84 alleles, CPIC/HGVS names)
584
599
  beside the PharmVar build, so the gene can be joined to the CPIC function tables again.
585
- **Breaking:** `-m dpyd` is therefore ambiguous and raises -- pass `-m dpyd-clinpgx-1.0.0` or
586
- `-m dpyd-pharmvar-6.2.29`.
600
+ `-m dpyd` was briefly ambiguous and raised; since the per-gene default table it resolves to
601
+ `dpyd-clinpgx-1.0.0`, which is what production runs -- the deployed `DPYD.yml` is content-identical
602
+ to it, and it is the only one of the two that joins the CPIC tables. Pass `-m dpyd-pharmvar` (or the
603
+ full name) for the other. A panel report still carries both: the nomenclatures are not
604
+ interchangeable.
587
605
 
588
606
  ### 2.6.1
589
607
 
@@ -509,6 +509,21 @@ Proprietary (contact@intelliseq.pl)
509
509
 
510
510
  ## Updates
511
511
 
512
+ ### 2.6.3
513
+
514
+ **`cyp2c19-pharmvar-5.1.8` is back, as a second CYP2C19 model you select by name.** It is the
515
+ model that 2.5.33-2.5.36 shipped (and that pgx task 2.6.2 / 2.7.1 ran as the unversioned
516
+ `CYP2C19.yml`), restored byte-identical: sha256 `7a1bdd54...`, removed in `642b702` when
517
+ CYP2C19 was rebuilt from PharmVar 6.2.29. On a GenosMedica WES sample (BT-2440) 6.2.29 calls
518
+ `*2/*35` (Poor Metabolizer) where the earlier releases reported `*1/*2` (Intermediate
519
+ Metabolizer). The pipeline can now pin the earlier model with `-m cyp2c19-pharmvar-5.1.8`.
520
+ **`-m cyp2c19` and `--genes CYP2C19` still resolve to `cyp2c19-pharmvar-6.2.29`**: both models
521
+ come from PharmVar, so the newer version is the default and `gene_defaults.json` needs no entry.
522
+
523
+ This release also ships multi-version model support (several versions of one gene, a declared
524
+ per-gene default, versions in `model-list`) and the BT-2440 fixes to CYP4F2, CYP2C19, DPYD and
525
+ CYP2F1.
526
+
512
527
  ### 2.6.2
513
528
 
514
529
  **DPYD \*3 and \*7 are callable again, and six other models with them.** `3204249` (2.5.29)
@@ -536,8 +551,11 @@ defined by the GRCh38 reference base at `4-68670366`**, so without a `reference_
536
551
  declaration an unassayed sample reported a confident homozygous call instead of Indeterminate --
537
552
  declared and fixed. DPYD now also ships as `dpyd-clinpgx-1.0.0` (84 alleles, CPIC/HGVS names)
538
553
  beside the PharmVar build, so the gene can be joined to the CPIC function tables again.
539
- **Breaking:** `-m dpyd` is therefore ambiguous and raises -- pass `-m dpyd-clinpgx-1.0.0` or
540
- `-m dpyd-pharmvar-6.2.29`.
554
+ `-m dpyd` was briefly ambiguous and raised; since the per-gene default table it resolves to
555
+ `dpyd-clinpgx-1.0.0`, which is what production runs -- the deployed `DPYD.yml` is content-identical
556
+ to it, and it is the only one of the two that joins the CPIC tables. Pass `-m dpyd-pharmvar` (or the
557
+ full name) for the other. A panel report still carries both: the nomenclatures are not
558
+ interchangeable.
541
559
 
542
560
  ### 2.6.1
543
561
 
@@ -0,0 +1,84 @@
1
+ """Which variants in a haplotype model come out CORE (function-level), and whether any does.
2
+
3
+ Why this exists: the engine decides whether a variant is "defining" by asking whether the allele
4
+ DECLARING it has a sub-allele name, and then applies a rescue — when nothing came out core, every
5
+ variant is promoted to core (`Haplotypes.compute_genotypes`). So a model that declares only
6
+ sub-alleles has its purely sub-allele-distinguishing intronic positions counted as function-level
7
+ by the Indeterminate verdict, and such a verdict means "the genotype for this gene is incomplete",
8
+ never "a function-level slot failed".
9
+
10
+ THE PREDICATE THAT MATTERS IS ABOUT VARIANTS, NOT ALLELES, and conflating the two produced a check
11
+ that could be silenced without fixing anything. An earlier cut of `check_core_alleles.py` tested
12
+ "does the model declare a bare core allele", which looks equivalent and is not: the eight packaged
13
+ zero-core models each hold exactly one empty haplotype named `*1.001`, and their deployed twins in
14
+ `task_pgx-polygenic-haplotype:1.7.4` name that same empty haplotype `*1`. Renaming `*1.001` -> `*1`
15
+ therefore adds a bare core allele and changes NOTHING — the allele declares no variants, so no
16
+ variant is marked core, the rescue still fires and `indeterminate.defining_total` is unchanged. The
17
+ deployed models would have passed that check while being equally broken.
18
+
19
+ So: a model has a core variant iff some haplotype whose name carries no trailing `.NNN` declares at
20
+ least one variant key. A `structural:`-only bare allele does not count, and must not — CYP2D6*5,
21
+ CYP2D6*68, CYP2C19*36, CYP2C19*37 and CYP2A6*4 produce no variant genotype, so they set no `core`
22
+ flag. That is the one place where "declares no variants" is not the same as "clinically empty"; do
23
+ not "fix" it.
24
+
25
+ Mirrors `polygenic.model.model.Haplotype`: the reserved metadata keys are the ones that method
26
+ excludes, so a new metadata key added there must be added here too or it is counted as a variant.
27
+ """
28
+ import re
29
+
30
+ # A trailing numeric suffix marks a SUB-allele (CYP2D6*1.001). A bare `.` is not enough: the
31
+ # PharmGKB/CPIC-derived models name haplotypes in HGVS ('c.10042C>T', 'm.1095T>C'), which always
32
+ # contains a dot and is function-level. Kept in step with model.is_suballele_name.
33
+ _SUBALLELE_SUFFIX = re.compile(r"\*\w+\.\d+$")
34
+
35
+ # Keys under a haplotype that are METADATA, not variant positions. `af`/`score` are
36
+ # Haplotype.RESERVED_KEYS; `structural` and `function` are consumed separately by the engine and
37
+ # produce no variant genotype. `copy_number` is a sibling of `haplotypes`, never a haplotype key,
38
+ # but is excluded defensively.
39
+ METADATA_KEYS = frozenset(("af", "score", "structural", "function", "copy_number", "note"))
40
+
41
+
42
+ def is_suballele_name(name) -> bool:
43
+ """True for a sub-allele name (CYP2D6*1.001); False for a bare core allele or an HGVS name."""
44
+ return any(_SUBALLELE_SUFFIX.search(token) for token in str(name).split("/"))
45
+
46
+
47
+ def variant_keys(entries) -> set:
48
+ """The variant keys one haplotype's entries declare, metadata excluded."""
49
+ if not isinstance(entries, dict):
50
+ return set()
51
+ return {key for key in entries if key not in METADATA_KEYS}
52
+
53
+
54
+ def core_variant_ids(haplotypes) -> set:
55
+ """Every variant key that the engine will mark `core`, for a {name: entries} haplotype map.
56
+
57
+ The union of the variant keys declared by bare-named (non-sub-allele) haplotypes — which is
58
+ exactly what `Haplotype.compute_genotypes` marks core, and therefore exactly what decides
59
+ whether the promotion rescue fires."""
60
+ found = set()
61
+ for name, entries in (haplotypes or {}).items():
62
+ if not is_suballele_name(name):
63
+ found |= variant_keys(entries)
64
+ return found
65
+
66
+
67
+ def core_alleles(haplotypes) -> list:
68
+ """Bare-named (non-sub-allele) haplotype names, sorted. Reported alongside the variant count
69
+ because a PharmVar core comparison needs the allele names, not just the predicate."""
70
+ return sorted(name for name in (haplotypes or {}) if not is_suballele_name(name))
71
+
72
+
73
+ def summarise(haplotypes) -> dict:
74
+ """{core_alleles, core_alleles_declaring_variants, core_variants, has_core_variant}.
75
+
76
+ `has_core_variant` is the engine's own condition: False means
77
+ `Haplotypes.compute_genotypes` promotes every variant to defining."""
78
+ bare = core_alleles(haplotypes)
79
+ declaring = [name for name in bare if variant_keys((haplotypes or {}).get(name))]
80
+ core = core_variant_ids(haplotypes)
81
+ return {"core_alleles": bare,
82
+ "core_alleles_declaring_variants": declaring,
83
+ "core_variants": core,
84
+ "has_core_variant": bool(core)}
@@ -0,0 +1,33 @@
1
+ {
2
+ "_comment": [
3
+ "Which packaged model `-m <gene>` resolves to, for the genes that ship more than one.",
4
+ "",
5
+ "A gene with a SINGLE model needs no entry: `registry._pick` returns immediately on one",
6
+ "candidate, so the sole model is already the default. Only a gene whose models would otherwise",
7
+ "be compared across sources - where '6.2.26 > 1.0.0' is arithmetic, not a fact about the",
8
+ "model - needs a human to decide, and this is where that decision is recorded.",
9
+ "",
10
+ "Why here and not in the model YAML: `preferred` answers 'among the models THIS PACKAGE ships",
11
+ "for this gene, which is the default', which is a property of the collection rather than of",
12
+ "any one file - a model copied to /tmp has no business claiming it is the package default. It",
13
+ "also keeps the decision in one reviewable place instead of scattered across 45 files, and it",
14
+ "avoids editing the vendored models, 11 of which assert `sha256(body below this header)` and",
15
+ "that nothing was hand-edited. A model may still declare `preferred: true` in its own",
16
+ "`description:` block and that wins, so an override directory (POLYGENIC_MODELS_DIR) can",
17
+ "carry its own default.",
18
+ "",
19
+ "Values are model stems, exactly as a filename spells them.",
20
+ "`panel` lists the models a panel report carries for that gene, which is a different question:",
21
+ "DPYD ships two nomenclatures a report wants side by side, while `-m dpyd` must still answer",
22
+ "with exactly one."
23
+ ],
24
+ "defaults": {
25
+ "dpyd": "dpyd-clinpgx-1.0.0"
26
+ },
27
+ "panel": {
28
+ "dpyd": ["dpyd-clinpgx-1.0.0", "dpyd-pharmvar-6.2.29"]
29
+ },
30
+ "rationale": {
31
+ "dpyd": "ClinPGx is what production runs: the deployed DPYD.yml in task_pgx-polygenic-haplotype:1.7.4 is CONTENT-IDENTICAL to dpyd-clinpgx-1.0.0 (84 alleles, 0 allele-set differences, 0 shared alleles with differing variant keys), and the PharmVar readme states DPYD is intentionally excluded from that package in favour of this one. It is also the only one of the two that joins the CPIC/DPWG/FDA function and recommendation tables - the PharmVar build names alleles DPYD*rs3918290 and joins none of them - so it is the only one that yields an actionable report. Both stay in the panel set because the two nomenclatures are not interchangeable."
32
+ }
33
+ }