polygenic-pgx 2.5.36__tar.gz → 2.6.2__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.
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/CHANGELOG.md +188 -3
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/MANIFEST.in +2 -0
- {polygenic_pgx-2.5.36/polygenic_pgx.egg-info → polygenic_pgx-2.6.2}/PKG-INFO +203 -80
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/README.md +202 -79
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/data_accessor.py +107 -1
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/vcf_accessor.py +36 -4
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/model/cnv_depth.py +2 -1
- polygenic_pgx-2.6.2/polygenic/model/hgnc.json +46 -0
- polygenic_pgx-2.6.2/polygenic/model/indel_alignment.py +49 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/model/model.py +328 -32
- polygenic_pgx-2.6.2/polygenic/model/panel.py +87 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/model/registry.py +68 -0
- polygenic_pgx-2.6.2/polygenic/model/summary.py +192 -0
- polygenic_pgx-2.6.2/polygenic/models/pgx/cyp1a1-pharmgkb-1.0.0.yml +82 -0
- polygenic_pgx-2.6.2/polygenic/models/pgx/cyp1a2-pharmvar-6.2.25.yml +396 -0
- polygenic_pgx-2.5.36/polygenic/models/pgx/cyp2a13-pharmvar-5.1.8.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/cyp2a13-pharmvar-6.2.29.yml +1 -0
- polygenic_pgx-2.5.36/polygenic/models/pgx/cyp2a6-pharmvar-6.2.25.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/cyp2a6-pharmvar-6.2.29.yml +3 -10
- polygenic_pgx-2.6.2/polygenic/models/pgx/cyp2b6-pharmvar-6.2.29.yml +797 -0
- polygenic_pgx-2.5.36/polygenic/models/pgx/cyp2c19-pharmvar-5.1.8.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/cyp2c19-pharmvar-6.2.29.yml +227 -10
- polygenic_pgx-2.5.36/polygenic/models/pgx/cyp2c9-pharmvar-5.1.8.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/cyp2c9-pharmvar-6.2.29.yml +134 -13
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp2d6-pharmvar-5.1.8.yml +29 -0
- polygenic_pgx-2.6.2/polygenic/models/pgx/cyp2e1-pharmgkb-1.0.0.yml +83 -0
- polygenic_pgx-2.5.36/polygenic/models/pgx/cyp3a4-pharmvar-6.2.26.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/cyp3a4-pharmvar-6.2.29.yml +1 -3
- polygenic_pgx-2.5.36/polygenic/models/pgx/cyp3a5-pharmvar-5.1.8.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/cyp3a5-pharmvar-6.2.29.yml +54 -6
- polygenic_pgx-2.6.2/polygenic/models/pgx/cyp4f2-pharmvar-5.1.8.yml +28 -0
- polygenic_pgx-2.6.2/polygenic/models/pgx/dpyd-clinpgx-1.0.0.yml +441 -0
- polygenic_pgx-2.5.36/polygenic/models/pgx/dpyd-pharmvar-5.1.8.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/dpyd-pharmvar-6.2.29.yml +90 -89
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/manifest.json +674 -130
- polygenic_pgx-2.5.36/polygenic/models/pgx/nat2-pharmvar-6.2.25.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/nat2-pharmvar-6.2.29.yml +73 -11
- polygenic_pgx-2.5.36/polygenic/models/pgx/nudt15-pharmvar-5.1.8.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/nudt15-pharmvar-6.2.29.yml +22 -7
- polygenic_pgx-2.5.36/polygenic/models/pgx/slco1b1-pharmvar-5.1.8.yml → polygenic_pgx-2.6.2/polygenic/models/pgx/slco1b1-pharmvar-6.2.29.yml +157 -34
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/ugt1a1-pharmgkb-1.0.0.yml +1 -1
- polygenic_pgx-2.6.2/polygenic/models/pgx/ugt2b15-pharmgkb-1.0.0.yml +60 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/pgstk.py +50 -14
- polygenic_pgx-2.6.2/polygenic/tools/modeldiff.py +205 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/modelmanifest.py +63 -1
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/pgscompute.py +141 -18
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/version.py +1 -1
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2/polygenic_pgx.egg-info}/PKG-INFO +203 -80
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic_pgx.egg-info/SOURCES.txt +21 -11
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/setup.py +3 -2
- polygenic_pgx-2.5.36/polygenic/models/pgx/cyp2b6-pharmvar-5.1.8.yml +0 -328
- polygenic_pgx-2.5.36/polygenic/models/pgx/cyp4f2-pharmvar-5.1.8.yml +0 -7
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/LICENSE +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/__init__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/__main__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/__init__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/csv_accessor.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/gwas.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/mobigen_utils.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/polars_frame.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/snp_data.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/data/vcf_record.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/error/__init__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/error/polygenic_exception.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/model/__init__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/model/utils.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/abcg2-pharmgkb-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/apoe-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/bche-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cacna1s-pharmgkb-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cftr-pharmgkb-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/comt-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp26a1-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp2c8-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp2f1-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp2j2-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp2r1-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp2s1-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp2w1-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp3a43-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/cyp3a7-pharmvar-5.1.8.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/f2-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/f5-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/g6pd-pharmgkb-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/ifnl3-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/ifnl4-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/mthfr-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/mtrnr1-cpic-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/oprm1-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/ryr1-pharmgkb-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/tpmt-cpic-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/models/pgx/vkorc1-1.0.0.yml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/resources/chromsizes/hg38.chrom.sizes +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/rsidx/__init__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/rsidx/__main__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/rsidx/_version.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/rsidx/cli.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/rsidx/index.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/rsidx/search.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/templates/pgscompute-header.md +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/templates/pgscompute-model.md +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/__init__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/data/__init__.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/data/chromsizes.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/data/colors.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/gwasfilecreate.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/modelbiobankuk.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/modelgwasfile.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/modellist.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/modelpgscat.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/plotmanhattan.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/tsvtovcf.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/utils.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/vcfimpute.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/vcfindex.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/vcfstatbaf.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic/tools/vcfstatzygosity.py +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic_pgx.egg-info/dependency_links.txt +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic_pgx.egg-info/entry_points.txt +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic_pgx.egg-info/requires.txt +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/polygenic_pgx.egg-info/top_level.txt +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/pyproject.toml +0 -0
- {polygenic_pgx-2.5.36 → polygenic_pgx-2.6.2}/setup.cfg +0 -0
|
@@ -3,6 +3,191 @@
|
|
|
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.2
|
|
7
|
+
|
|
8
|
+
**DPYD \*3 and \*7 are callable again, and six other models with them.** `3204249` (2.5.29)
|
|
9
|
+
left-aligned every model's indel keys; `642b702` regenerated 11 genes straight from the PharmVar
|
|
10
|
+
6.2.29 export and silently reverted it, because the generator had no normalization step. Variants
|
|
11
|
+
are matched by the exact `chrom-pos-ref-alt` key, so a right-shifted key never matches a
|
|
12
|
+
`bcftools norm`-ed VCF -- and the miss is silent, since the Indeterminate verdict only considers
|
|
13
|
+
variants present in the VCF. DPYD \*3 and \*7 are each defined by their indel alone in 6.2.29,
|
|
14
|
+
so they were unreachable, not merely degraded; both are no-function for fluoropyrimidines.
|
|
15
|
+
28 keys across cyp2a6, nudt15, cyp2c9, cyp2c19, dpyd, cyp3a4 and cyp2a13 are rebuilt and
|
|
16
|
+
left-aligned, with normalization now inside `rebuild_pharmvar.py` (`--ref` required) and enforced
|
|
17
|
+
by a reference-free CI check.
|
|
18
|
+
|
|
19
|
+
**Up to 10x faster, and bounded.** `compute_haplotype` deepcopied the whole genotype dict twice
|
|
20
|
+
per haplotype -- 92% of runtime on DPYD. One WGS sample went 33.8s -> 3.4s and the unit suite
|
|
21
|
+
841s -> 229s, with byte-identical results. Separately, the tied-haplotype second round is now
|
|
22
|
+
bounded by `max_first_haplotypes` (default 200): dpyd-pharmvar over 20 samples went from not
|
|
23
|
+
finishing in 1200s to 26.9s. When the bound bites the engine returns a no-call
|
|
24
|
+
(`reason: too_many_tied_haplotypes`) rather than the best of a truncated search, because that is
|
|
25
|
+
how a performance bound otherwise becomes a wrong answer.
|
|
26
|
+
|
|
27
|
+
**Five more models (45 total).** CYP1A1, CYP1A2, CYP2E1 and UGT2B15 reach customer reports but had
|
|
28
|
+
never been packaged; they are now vendored verbatim from the deployed tree. **UGT2B15 \*2/\*5 are
|
|
29
|
+
defined by the GRCh38 reference base at `4-68670366`**, so without a `reference_defining_variants`
|
|
30
|
+
declaration an unassayed sample reported a confident homozygous call instead of Indeterminate --
|
|
31
|
+
declared and fixed. DPYD now also ships as `dpyd-clinpgx-1.0.0` (84 alleles, CPIC/HGVS names)
|
|
32
|
+
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`.
|
|
35
|
+
|
|
36
|
+
### 2.6.1
|
|
37
|
+
|
|
38
|
+
**Haplotype assembly no longer chains across `FORMAT/PS` phase sets.** The engine never read
|
|
39
|
+
`FORMAT/PS`: it treated any `|` genotype as globally phased and assigned allele 0 to haplotype 1
|
|
40
|
+
across phase-set boundaries. `|` order is only meaningful *within* a block, so this asserted
|
|
41
|
+
linkage the data does not contain. Measured on NA19207 CYP3A5, where two panels with identical
|
|
42
|
+
genotype evidence produced different calls (`*3/*7.001` vs `*1.001/*3.018`) purely because
|
|
43
|
+
whatshap emitted one block as `1|0` in one run and `0|1` in the other - the correct answer was
|
|
44
|
+
luck. `data_accessor` now surfaces `genotype["phase_set"]`, and only the largest block is trusted
|
|
45
|
+
for orientation; variants outside it take the unphased path, which tries both orders rather than
|
|
46
|
+
assuming one. Backward compatible: with no `PS` anywhere it falls back to the previous whole-VCF
|
|
47
|
+
behaviour.
|
|
48
|
+
|
|
49
|
+
**`pgstk model-diff`: drift detection against a reference model set (BT-2379).** Our models drift
|
|
50
|
+
from upstream without anyone noticing - RYR1 missing 7 variants and MT-RNR1 differing were both
|
|
51
|
+
found by spot-check, not by tooling. This is the **detection**; which source is authoritative is
|
|
52
|
+
a separate decision, and the tool never edits a model.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
pgstk model-diff --against /path/to/freshly/built/models
|
|
56
|
+
pgstk model-diff --gene ryr1 --against <dir>
|
|
57
|
+
pgstk model-diff --against <dir> --json # for CI
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Per gene it reports alleles only in ours, alleles missing from ours, alleles whose defining
|
|
61
|
+
variant set differs (naming the variant keys), and **variants whose representation differs** -
|
|
62
|
+
the same site spelled two ways, which is the indel left-alignment class already hit with CYP2A6
|
|
63
|
+
and which a plain set difference would report as two unrelated variants. Exits non-zero on any
|
|
64
|
+
difference, so it can run as a release gate. A gene absent from the reference set is reported but
|
|
65
|
+
does **not** fail the gate: the reference legitimately covers a different gene list.
|
|
66
|
+
|
|
67
|
+
**Release automation (BT-2378).** A git tag now drives the release:
|
|
68
|
+
`.github/workflows/release.yml` runs the suite on Python 3.8, checks that the tag matches
|
|
69
|
+
`setup.py`, verifies the manifest and model checksums, runs the clean-install gate, then
|
|
70
|
+
publishes to PyPI via **Trusted Publishing** (no stored token). `workflow_dispatch` runs the same
|
|
71
|
+
checks publishing nothing. See `docs/releasing.md`.
|
|
72
|
+
|
|
73
|
+
The docker image is **not** built here - it is owned by the WDL team, which bases it on the
|
|
74
|
+
published package. The enabler for dropping the task's model resource mounts was models shipping
|
|
75
|
+
inside the package (2.5.33), not an image built in this repo.
|
|
76
|
+
|
|
77
|
+
**Per-sample run summary (BT-2376).** Every run now also writes
|
|
78
|
+
`{sample}-pgx-summary.json`, so a consumer reads one finished file instead of stitching
|
|
79
|
+
per-model JSONs. Additive - the per-model results are untouched; `--no-summary` disables it.
|
|
80
|
+
|
|
81
|
+
- Per gene: canonical `gene` + `gene_hgnc_id`, the model's name/source/version/**sha256**/origin,
|
|
82
|
+
`call`, `call_core`, `status`, `possible_calls` and the `copy_number` block when present,
|
|
83
|
+
covered/total/missing defining-variant counts, and the uncovered defining positions.
|
|
84
|
+
- Run level: polygenic version, `manifest_digest` naming the exact model set, the effective
|
|
85
|
+
parameters, `models_not_assayed`, per-status `counts`, and a `schema_version` from day one.
|
|
86
|
+
- **`status` distinguishes `called` / `indeterminate` / `no_call` / `not_assayed`** as four
|
|
87
|
+
separate values. Collapsing them is the BT-2323 failure: a *called* MT-RNR1 result was reported
|
|
88
|
+
as Indeterminate because the consumer could not tell "the engine refused to guess" from "this
|
|
89
|
+
gene was never on the panel".
|
|
90
|
+
- Every gene row carries the **same keys whatever its status**, so a consumer never has to branch
|
|
91
|
+
before it can read a field.
|
|
92
|
+
- Fixed in passing: inside the model loop, a score model's `description.parameters` was assigned
|
|
93
|
+
to the same name as the **run** parameters, so one score model could silently become the run
|
|
94
|
+
parameters for every model after it in the same invocation.
|
|
95
|
+
|
|
96
|
+
**Per-gene run parameters (BT-2375).** Every run toggle now takes an optional gene list, so one
|
|
97
|
+
invocation can mix policies instead of the caller running `pgs-compute` again for the one gene
|
|
98
|
+
that needs a different flag.
|
|
99
|
+
|
|
100
|
+
- `--no-ref-fallback=cyp2c19,cyp2d6` and the same shape for `--no-safety-lock`,
|
|
101
|
+
`--no-indeterminate`, `--no-ad-arrangement`, `--all-model-variants`. **Bare keeps today's
|
|
102
|
+
global meaning**, so nothing breaks. Prefer the `--flag=value` form: with optional arity,
|
|
103
|
+
`--flag cyp2c19` is ambiguous next to other options.
|
|
104
|
+
- The same structure is accepted in `-p/--parameters`
|
|
105
|
+
(`{"per_gene": {"CYP2C19": {"ref_fallback": false}}}`), and CLI and JSON combine. Gene names
|
|
106
|
+
are matched loosely (`mt-rnr1` == `MT-RNR1` == `mtrnr1`) against the model's own gene.
|
|
107
|
+
- **A gene naming no model in the run raises**, rather than quietly applying nothing - a typo
|
|
108
|
+
that does nothing is indistinguishable from the flag working.
|
|
109
|
+
- Applied overrides are recorded at `description.parameter_overrides` in the result.
|
|
110
|
+
- Fixed in passing: `ref_fallback` given in `-p/--parameters` was **silently ignored**, because
|
|
111
|
+
the CLI default overwrote it unconditionally. A JSON-supplied value is now honoured.
|
|
112
|
+
|
|
113
|
+
**Panel mode: one invocation calls every gene the VCF covers (BT-2374).** `-m` is now optional.
|
|
114
|
+
With neither `-m` nor `--genes`, `pgs-compute` runs every built-in model the input VCF actually
|
|
115
|
+
assays, so the caller no longer loops per model.
|
|
116
|
+
|
|
117
|
+
- Coverage is decided from a per-model **footprint** (chromosome + min/max of its variant keys,
|
|
118
|
+
plus any `copy_number.region`) newly stored in `manifest.json`: **one index query per model**,
|
|
119
|
+
never a trial run. The 10 rsID-keyed models carry `probe_rsids` instead, because an rsID has no
|
|
120
|
+
coordinate without a dbSNP build the package does not ship.
|
|
121
|
+
- `--genes cyp2c19,cyp2d6` keeps the subset case. A gene named explicitly **always runs** and is
|
|
122
|
+
never filtered out, so asking for a gene the panel lacks gives a visible `Indeterminate` rather
|
|
123
|
+
than silence. A model whose footprint is unknown (e.g. one from `POLYGENIC_MODELS_DIR`, which
|
|
124
|
+
has no manifest) also runs - "unknown" is not "absent".
|
|
125
|
+
- Every decision is logged with its reason, because panel mode makes the gene set implicit and a
|
|
126
|
+
panel change would otherwise change the report's gene list silently.
|
|
127
|
+
- **Reads are now shared across models and samples.** `VcfAccessor` caches records by variant id,
|
|
128
|
+
so a position is read once per run instead of once per model per sample - 44x on repeated
|
|
129
|
+
lookups. The rsID index is also opened once: it was reconnected on every single lookup, and
|
|
130
|
+
leaked the handle each time (`with sqlite3.connect(...)` commits, it does not close). The
|
|
131
|
+
per-model `DataAccessor` is deliberately not shared, since its cache holds genotype
|
|
132
|
+
*interpretation* that depends on that model's `ref_fallback` and `reference_defining_variants`.
|
|
133
|
+
|
|
134
|
+
**Output naming contract (BT-2377).** Three guarantees so no consumer has to parse or rewrite a
|
|
135
|
+
call string:
|
|
136
|
+
|
|
137
|
+
- **One separator.** An assembled diplotype is joined by `/`, always. It used to be `_` for
|
|
138
|
+
ordinary diplotypes and `/` only for copy-number calls, which is why the downstream pipeline
|
|
139
|
+
carried a normalisation step commented *"until polygenic uses a consistent separator"*. `/` is
|
|
140
|
+
the safe choice because allele ids legitimately contain `_` (RYR1 `c.51_53del`, `c.992_994dup`)
|
|
141
|
+
and no allele id in any of the 40 packaged models contains `/` - asserted by reading every
|
|
142
|
+
model, not assumed. Calls written by older versions are still accepted on input.
|
|
143
|
+
- **`haplotype_id_core`** carries the same call with star sub-allele suffixes dropped
|
|
144
|
+
(`CYP2D6*2.002x2/CYP2D6*4.006x2` -> `CYP2D6*2x2/CYP2D6*4x2`). The **xN multiplier survives** -
|
|
145
|
+
dropping it changes the activity score, which is the bug in the pipeline's own strip that this
|
|
146
|
+
replaces. HGVS-style names are untouched (a blanket strip turns `c.51_53del` into `c51_53del`),
|
|
147
|
+
a haploid collapse stays collapsed, and verdicts (`Indeterminate`) pass through.
|
|
148
|
+
- **`description.gene_hgnc_id`** (e.g. `HGNC:2625`) alongside `description.gene`, so reports join
|
|
149
|
+
on a stable identifier rather than a symbol. Sourced from a committed `hgnc.json` - no network
|
|
150
|
+
at runtime; an unknown symbol yields `null`, never a guess.
|
|
151
|
+
|
|
152
|
+
### 2.5.37
|
|
153
|
+
|
|
154
|
+
**The Indeterminate verdict was unreachable for whole genes, and RYR1 was the one that mattered.**
|
|
155
|
+
A wild-type call resting on allele-defining positions that were never covered was reported as a
|
|
156
|
+
confident normal result. On one validated 8-sample run every RYR1 row read
|
|
157
|
+
`Reference/Reference -> uncertain susceptibility` while 5-6 malignant-hyperthermia defining
|
|
158
|
+
positions sat at read depth 0-1.
|
|
159
|
+
|
|
160
|
+
Two independent causes, and fixing either alone changes nothing:
|
|
161
|
+
|
|
162
|
+
- **`core` (function-level) was decided by "the haplotype name contains a dot".** That marks a
|
|
163
|
+
sub-allele in star nomenclature (`CYP2D6*1.001`), but the PharmGKB/CPIC-derived models name
|
|
164
|
+
haplotypes in **HGVS** - RYR1 `c.10042C>T`, CACNA1S `c.3257G>A`, MT-RNR1 `m.1095T>C` - which
|
|
165
|
+
always contains a dot. So 339 of RYR1's 340 haplotypes counted as sub-alleles, every variant
|
|
166
|
+
became non-core, and `indeterminate.defining_total` collapsed to 0 - which the verdict is gated
|
|
167
|
+
on. Now only a **trailing numeric suffix** on a star/rsID allele marks a sub-allele
|
|
168
|
+
(`is_suballele_name`), which also keeps `DPYD*rs112766203.1` correctly non-core.
|
|
169
|
+
- **`_is_wildtype_pair` matched only `*1`**, so `Reference_Reference` was never recognised as a
|
|
170
|
+
wild-type call in the first place. It now accepts a `Reference` allele too.
|
|
171
|
+
|
|
172
|
+
Related: a model that declares **only** sub-alleles (CYP4F2 is just `*1.001`..`*4.001`; likewise
|
|
173
|
+
CYP2J2, CYP3A7, CYP2S1, CYP2W1, CYP3A43, CYP26A1, CYP2F1, CYP2R1) has nothing to contrast against,
|
|
174
|
+
so nothing was core there either. When no variant in a model is core, every variant is defining.
|
|
175
|
+
|
|
176
|
+
- **Scoring is unchanged, and that is checked rather than assumed.** `core` also drives the
|
|
177
|
+
weighted haplotype match (`weight * 0.05`), but `percent_weight_match` is a ratio, so a flip of
|
|
178
|
+
*every* genotype in a model cancels. Only uniform flips are safe, and all 12 affected models
|
|
179
|
+
flip uniformly. An A/B of all 40 packaged models on one sample, old engine vs new on the same
|
|
180
|
+
tree: **36 results byte-identical, exactly one call moves** (RYR1 -> `Indeterminate`, with
|
|
181
|
+
`call_filled` keeping the best-effort answer), and 3 bookkeeping-only changes where
|
|
182
|
+
`defining_total` becomes honest (CACNA1S and CYP4F2 0 -> 2, G6PD 181 -> 182) without triggering.
|
|
183
|
+
- **`INFO/MODEL_FILL` is carried into the genotype** as `model_fill` / `model_fill_depth`. A
|
|
184
|
+
pipeline that fills model sites from read depth *before* polygenic produces genotypes that read
|
|
185
|
+
as `source: genotyping`, making a depth-verified assumption indistinguishable from a
|
|
186
|
+
measurement. Recorded as its own field, deliberately not folded into `source`: `compute_qc`
|
|
187
|
+
rejects an unknown source, and a fill that passed its depth gate is real evidence, so no verdict
|
|
188
|
+
moves.
|
|
189
|
+
- `indeterminate`'s reason string now names the actual call instead of always saying `*1/*1`.
|
|
190
|
+
|
|
6
191
|
### 2.5.36
|
|
7
192
|
|
|
8
193
|
**The packaged models now cover the whole PGx report (33 -> 40 models).** Seven genes existed
|
|
@@ -19,9 +204,9 @@ would have silently dropped them from every report.
|
|
|
19
204
|
and UGT1A1 carries the `(TA)n` promoter repeat (`*28`/`*36`/`*37`).
|
|
20
205
|
- All their indels (CFTR 1, G6PD 10, RYR1 4, UGT1A1 3) were checked against GRCh38 with
|
|
21
206
|
`bcftools norm` and were already left-aligned, so nothing was rewritten.
|
|
22
|
-
- Every added model was validated against real output: NAT2 matches
|
|
207
|
+
- Every added model was validated against real output: NAT2 matches an external review sheet on
|
|
23
208
|
4/5 samples (the fifth is PharmVar vs legacy naming, `*5/*16` vs `*5/*5`), and the six others
|
|
24
|
-
reproduce the production
|
|
209
|
+
reproduce the production star-allele JSON exactly.
|
|
25
210
|
- Manifest fix: a model added by **copying** an existing file is now dated at the copy. git
|
|
26
211
|
reported NAT2 as a copy (`C096`) of a file vendored elsewhere a day earlier, and the manifest
|
|
27
212
|
dated the model before it existed in the package. A copy is not a move - the source still
|
|
@@ -89,7 +274,7 @@ calls in a customer validation). Full guide: `docs/models.md`.
|
|
|
89
274
|
gain arrives unphased (`GT 0/1` + `FORMAT/CN`), `pgs-compute` reads `AD` at the sites that
|
|
90
275
|
distinguish the two base alleles and names the arrangement when the evidence is decisive — CN=4
|
|
91
276
|
with both `*4` sites at ~0.50 is `*2x2/*4x2`, where the canonical arrangement said `*2/*4x3`
|
|
92
|
-
(real case: an amplicon panel
|
|
277
|
+
(real case: an amplicon panel). Phase still wins whenever it is present.
|
|
93
278
|
|
|
94
279
|
- Scoring is a beta-binomial likelihood (overdispersion `rho`, default 0.02), not a binomial: on an
|
|
95
280
|
amplicon panel the dominant error is systematic allelic bias of 10-20 pp, not read sampling.
|
|
@@ -5,5 +5,7 @@ recursive-include polygenic/resources *.sizes
|
|
|
5
5
|
# see the note in setup.py.
|
|
6
6
|
recursive-include polygenic/models *.yml
|
|
7
7
|
include polygenic/models/pgx/manifest.json
|
|
8
|
+
# gene symbol -> HGNC id, read at runtime by registry.hgnc_id_for()
|
|
9
|
+
include polygenic/model/hgnc.json
|
|
8
10
|
# full release history (README keeps only the newest entries)
|
|
9
11
|
include CHANGELOG.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polygenic-pgx
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.6.2
|
|
4
4
|
Summary: Polygenic score toolkit
|
|
5
5
|
Home-page: https://github.com/marpiech/polygenic
|
|
6
6
|
Author: Marcin Piechota, Wojciech Galan
|
|
@@ -124,29 +124,28 @@ The point of the annotation: were rs3758581 blindly filled with reference `A/A`,
|
|
|
124
124
|
|
|
125
125
|
## Installation
|
|
126
126
|
|
|
127
|
-
###
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
(APOE, MTHFR, COMT, F2, F5, IFNL4, OPRM1) — resolve genotypes through `rsidx`, which shells
|
|
131
|
-
out to `tabix`; without it those lookups fail with `FileNotFoundError: 'tabix'`. (Positional
|
|
132
|
-
`chrom-pos-ref-alt` keyed models use the bundled `pytabix` library and do not need the binary,
|
|
133
|
-
but installing `tabix` is required for full functionality.) The input VCF must also be
|
|
134
|
-
bgzipped and tabix-indexed (`.tbi`).
|
|
127
|
+
### Requirements
|
|
128
|
+
`pip install polygenic-pgx` is enough — there is **no system dependency and no C compiler**
|
|
129
|
+
needed. Index access goes through **pysam**, which bundles htslib and ships manylinux wheels.
|
|
135
130
|
|
|
136
|
-
|
|
131
|
+
Older releases (before 2.5.34) required the **`tabix`** binary on `PATH`, because rsID-keyed
|
|
132
|
+
models resolved genotypes by shelling out to it; that is no longer the case, and neither is the
|
|
133
|
+
`pytabix` build step those instructions existed for.
|
|
134
|
+
|
|
135
|
+
The **input VCF** must still be bgzipped and **tabix-indexed** (a `.tbi` next to the `.vcf.gz`).
|
|
136
|
+
If you need to create one, any htslib build will do:
|
|
137
137
|
```
|
|
138
|
-
|
|
139
|
-
# or: conda install -c bioconda htslib | brew install htslib
|
|
138
|
+
tabix -p vcf sample.vcf.gz # or: bcftools index -t sample.vcf.gz
|
|
140
139
|
```
|
|
141
140
|
|
|
142
141
|
### With pip
|
|
143
142
|
#### Install for user account
|
|
144
143
|
```
|
|
145
|
-
python3 -m pip install --upgrade polygenic
|
|
144
|
+
python3 -m pip install --upgrade polygenic-pgx
|
|
146
145
|
```
|
|
147
146
|
#### Install globally
|
|
148
147
|
```
|
|
149
|
-
sudo -H python3 -m pip install polygenic
|
|
148
|
+
sudo -H python3 -m pip install polygenic-pgx
|
|
150
149
|
```
|
|
151
150
|
### With conda
|
|
152
151
|
Run conda image
|
|
@@ -161,11 +160,7 @@ conda activate py38
|
|
|
161
160
|
### should be 3.8
|
|
162
161
|
python --version
|
|
163
162
|
|
|
164
|
-
|
|
165
|
-
apt -qq update
|
|
166
|
-
apt -y install build-essential tabix
|
|
167
|
-
|
|
168
|
-
pip install polygenic
|
|
163
|
+
pip install polygenic-pgx
|
|
169
164
|
```
|
|
170
165
|
### With docker
|
|
171
166
|
#### Large image with all data included
|
|
@@ -551,8 +546,8 @@ description:
|
|
|
551
546
|
#### PGX
|
|
552
547
|
|
|
553
548
|
```
|
|
554
|
-
python3 -m pip install polygenic
|
|
555
|
-
pgstk pgs-compute --vcf [PATH_TO_VCF_GZ] --model cyp2d6
|
|
549
|
+
python3 -m pip install polygenic-pgx
|
|
550
|
+
pgstk pgs-compute --vcf [PATH_TO_VCF_GZ] --model cyp2d6 --print | jq .haplotype_model.haplotypes.match
|
|
556
551
|
```
|
|
557
552
|
|
|
558
553
|
## License
|
|
@@ -560,6 +555,190 @@ Proprietary (contact@intelliseq.pl)
|
|
|
560
555
|
|
|
561
556
|
## Updates
|
|
562
557
|
|
|
558
|
+
### 2.6.2
|
|
559
|
+
|
|
560
|
+
**DPYD \*3 and \*7 are callable again, and six other models with them.** `3204249` (2.5.29)
|
|
561
|
+
left-aligned every model's indel keys; `642b702` regenerated 11 genes straight from the PharmVar
|
|
562
|
+
6.2.29 export and silently reverted it, because the generator had no normalization step. Variants
|
|
563
|
+
are matched by the exact `chrom-pos-ref-alt` key, so a right-shifted key never matches a
|
|
564
|
+
`bcftools norm`-ed VCF -- and the miss is silent, since the Indeterminate verdict only considers
|
|
565
|
+
variants present in the VCF. DPYD \*3 and \*7 are each defined by their indel alone in 6.2.29,
|
|
566
|
+
so they were unreachable, not merely degraded; both are no-function for fluoropyrimidines.
|
|
567
|
+
28 keys across cyp2a6, nudt15, cyp2c9, cyp2c19, dpyd, cyp3a4 and cyp2a13 are rebuilt and
|
|
568
|
+
left-aligned, with normalization now inside `rebuild_pharmvar.py` (`--ref` required) and enforced
|
|
569
|
+
by a reference-free CI check.
|
|
570
|
+
|
|
571
|
+
**Up to 10x faster, and bounded.** `compute_haplotype` deepcopied the whole genotype dict twice
|
|
572
|
+
per haplotype -- 92% of runtime on DPYD. One WGS sample went 33.8s -> 3.4s and the unit suite
|
|
573
|
+
841s -> 229s, with byte-identical results. Separately, the tied-haplotype second round is now
|
|
574
|
+
bounded by `max_first_haplotypes` (default 200): dpyd-pharmvar over 20 samples went from not
|
|
575
|
+
finishing in 1200s to 26.9s. When the bound bites the engine returns a no-call
|
|
576
|
+
(`reason: too_many_tied_haplotypes`) rather than the best of a truncated search, because that is
|
|
577
|
+
how a performance bound otherwise becomes a wrong answer.
|
|
578
|
+
|
|
579
|
+
**Five more models (45 total).** CYP1A1, CYP1A2, CYP2E1 and UGT2B15 reach customer reports but had
|
|
580
|
+
never been packaged; they are now vendored verbatim from the deployed tree. **UGT2B15 \*2/\*5 are
|
|
581
|
+
defined by the GRCh38 reference base at `4-68670366`**, so without a `reference_defining_variants`
|
|
582
|
+
declaration an unassayed sample reported a confident homozygous call instead of Indeterminate --
|
|
583
|
+
declared and fixed. DPYD now also ships as `dpyd-clinpgx-1.0.0` (84 alleles, CPIC/HGVS names)
|
|
584
|
+
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`.
|
|
587
|
+
|
|
588
|
+
### 2.6.1
|
|
589
|
+
|
|
590
|
+
**Haplotype assembly no longer chains across `FORMAT/PS` phase sets.** The engine never read
|
|
591
|
+
`FORMAT/PS`: it treated any `|` genotype as globally phased and assigned allele 0 to haplotype 1
|
|
592
|
+
across phase-set boundaries. `|` order is only meaningful *within* a block, so this asserted
|
|
593
|
+
linkage the data does not contain. Measured on NA19207 CYP3A5, where two panels with identical
|
|
594
|
+
genotype evidence produced different calls (`*3/*7.001` vs `*1.001/*3.018`) purely because
|
|
595
|
+
whatshap emitted one block as `1|0` in one run and `0|1` in the other - the correct answer was
|
|
596
|
+
luck. `data_accessor` now surfaces `genotype["phase_set"]`, and only the largest block is trusted
|
|
597
|
+
for orientation; variants outside it take the unphased path, which tries both orders rather than
|
|
598
|
+
assuming one. Backward compatible: with no `PS` anywhere it falls back to the previous whole-VCF
|
|
599
|
+
behaviour.
|
|
600
|
+
|
|
601
|
+
**`pgstk model-diff`: drift detection against a reference model set (BT-2379).** Our models drift
|
|
602
|
+
from upstream without anyone noticing - RYR1 missing 7 variants and MT-RNR1 differing were both
|
|
603
|
+
found by spot-check, not by tooling. This is the **detection**; which source is authoritative is
|
|
604
|
+
a separate decision, and the tool never edits a model.
|
|
605
|
+
|
|
606
|
+
```
|
|
607
|
+
pgstk model-diff --against /path/to/freshly/built/models
|
|
608
|
+
pgstk model-diff --gene ryr1 --against <dir>
|
|
609
|
+
pgstk model-diff --against <dir> --json # for CI
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
Per gene it reports alleles only in ours, alleles missing from ours, alleles whose defining
|
|
613
|
+
variant set differs (naming the variant keys), and **variants whose representation differs** -
|
|
614
|
+
the same site spelled two ways, which is the indel left-alignment class already hit with CYP2A6
|
|
615
|
+
and which a plain set difference would report as two unrelated variants. Exits non-zero on any
|
|
616
|
+
difference, so it can run as a release gate. A gene absent from the reference set is reported but
|
|
617
|
+
does **not** fail the gate: the reference legitimately covers a different gene list.
|
|
618
|
+
|
|
619
|
+
**Release automation (BT-2378).** A git tag now drives the whole release:
|
|
620
|
+
`.github/workflows/release.yml` runs the suite on Python 3.8, checks that the tag matches
|
|
621
|
+
`setup.py`, verifies the manifest and model checksums, runs the clean-install gate, publishes to
|
|
622
|
+
PyPI via **Trusted Publishing** (no stored token), then builds, smoke-tests and pushes
|
|
623
|
+
`intelliseqngs/polygenic-pgx:<version>`. A new runtime `Dockerfile` builds the wheel from source
|
|
624
|
+
and asserts the models are inside the installed package - the WDL can pin a version instead of
|
|
625
|
+
wiring model resources in as task inputs. `workflow_dispatch` runs the same checks publishing
|
|
626
|
+
nothing. See `docs/releasing.md`.
|
|
627
|
+
|
|
628
|
+
**Per-sample run summary (BT-2376).** Every run now also writes
|
|
629
|
+
`{sample}-pgx-summary.json`, so a consumer reads one finished file instead of stitching
|
|
630
|
+
per-model JSONs. Additive - the per-model results are untouched; `--no-summary` disables it.
|
|
631
|
+
|
|
632
|
+
- Per gene: canonical `gene` + `gene_hgnc_id`, the model's name/source/version/**sha256**/origin,
|
|
633
|
+
`call`, `call_core`, `status`, `possible_calls` and the `copy_number` block when present,
|
|
634
|
+
covered/total/missing defining-variant counts, and the uncovered defining positions.
|
|
635
|
+
- Run level: polygenic version, `manifest_digest` naming the exact model set, the effective
|
|
636
|
+
parameters, `models_not_assayed`, per-status `counts`, and a `schema_version` from day one.
|
|
637
|
+
- **`status` distinguishes `called` / `indeterminate` / `no_call` / `not_assayed`** as four
|
|
638
|
+
separate values. Collapsing them is the BT-2323 failure: a *called* MT-RNR1 result was reported
|
|
639
|
+
as Indeterminate because the consumer could not tell "the engine refused to guess" from "this
|
|
640
|
+
gene was never on the panel".
|
|
641
|
+
- Every gene row carries the **same keys whatever its status**, so a consumer never has to branch
|
|
642
|
+
before it can read a field.
|
|
643
|
+
- Fixed in passing: inside the model loop, a score model's `description.parameters` was assigned
|
|
644
|
+
to the same name as the **run** parameters, so one score model could silently become the run
|
|
645
|
+
parameters for every model after it in the same invocation.
|
|
646
|
+
|
|
647
|
+
**Per-gene run parameters (BT-2375).** Every run toggle now takes an optional gene list, so one
|
|
648
|
+
invocation can mix policies instead of the caller running `pgs-compute` again for the one gene
|
|
649
|
+
that needs a different flag.
|
|
650
|
+
|
|
651
|
+
- `--no-ref-fallback=cyp2c19,cyp2d6` and the same shape for `--no-safety-lock`,
|
|
652
|
+
`--no-indeterminate`, `--no-ad-arrangement`, `--all-model-variants`. **Bare keeps today's
|
|
653
|
+
global meaning**, so nothing breaks. Prefer the `--flag=value` form: with optional arity,
|
|
654
|
+
`--flag cyp2c19` is ambiguous next to other options.
|
|
655
|
+
- The same structure is accepted in `-p/--parameters`
|
|
656
|
+
(`{"per_gene": {"CYP2C19": {"ref_fallback": false}}}`), and CLI and JSON combine. Gene names
|
|
657
|
+
are matched loosely (`mt-rnr1` == `MT-RNR1` == `mtrnr1`) against the model's own gene.
|
|
658
|
+
- **A gene naming no model in the run raises**, rather than quietly applying nothing - a typo
|
|
659
|
+
that does nothing is indistinguishable from the flag working.
|
|
660
|
+
- Applied overrides are recorded at `description.parameter_overrides` in the result.
|
|
661
|
+
- Fixed in passing: `ref_fallback` given in `-p/--parameters` was **silently ignored**, because
|
|
662
|
+
the CLI default overwrote it unconditionally. A JSON-supplied value is now honoured.
|
|
663
|
+
|
|
664
|
+
**Panel mode: one invocation calls every gene the VCF covers (BT-2374).** `-m` is now optional.
|
|
665
|
+
With neither `-m` nor `--genes`, `pgs-compute` runs every built-in model the input VCF actually
|
|
666
|
+
assays, so the caller no longer loops per model.
|
|
667
|
+
|
|
668
|
+
- Coverage is decided from a per-model **footprint** (chromosome + min/max of its variant keys,
|
|
669
|
+
plus any `copy_number.region`) newly stored in `manifest.json`: **one index query per model**,
|
|
670
|
+
never a trial run. The 10 rsID-keyed models carry `probe_rsids` instead, because an rsID has no
|
|
671
|
+
coordinate without a dbSNP build the package does not ship.
|
|
672
|
+
- `--genes cyp2c19,cyp2d6` keeps the subset case. A gene named explicitly **always runs** and is
|
|
673
|
+
never filtered out, so asking for a gene the panel lacks gives a visible `Indeterminate` rather
|
|
674
|
+
than silence. A model whose footprint is unknown (e.g. one from `POLYGENIC_MODELS_DIR`, which
|
|
675
|
+
has no manifest) also runs - "unknown" is not "absent".
|
|
676
|
+
- Every decision is logged with its reason, because panel mode makes the gene set implicit and a
|
|
677
|
+
panel change would otherwise change the report's gene list silently.
|
|
678
|
+
- **Reads are now shared across models and samples.** `VcfAccessor` caches records by variant id,
|
|
679
|
+
so a position is read once per run instead of once per model per sample - 44x on repeated
|
|
680
|
+
lookups. The rsID index is also opened once: it was reconnected on every single lookup, and
|
|
681
|
+
leaked the handle each time (`with sqlite3.connect(...)` commits, it does not close). The
|
|
682
|
+
per-model `DataAccessor` is deliberately not shared, since its cache holds genotype
|
|
683
|
+
*interpretation* that depends on that model's `ref_fallback` and `reference_defining_variants`.
|
|
684
|
+
|
|
685
|
+
**Output naming contract (BT-2377).** Three guarantees so no consumer has to parse or rewrite a
|
|
686
|
+
call string:
|
|
687
|
+
|
|
688
|
+
- **One separator.** An assembled diplotype is joined by `/`, always. It used to be `_` for
|
|
689
|
+
ordinary diplotypes and `/` only for copy-number calls, which is why the downstream pipeline
|
|
690
|
+
carried a normalisation step commented *"until polygenic uses a consistent separator"*. `/` is
|
|
691
|
+
the safe choice because allele ids legitimately contain `_` (RYR1 `c.51_53del`, `c.992_994dup`)
|
|
692
|
+
and no allele id in any of the 40 packaged models contains `/` - asserted by reading every
|
|
693
|
+
model, not assumed. Calls written by older versions are still accepted on input.
|
|
694
|
+
- **`haplotype_id_core`** carries the same call with star sub-allele suffixes dropped
|
|
695
|
+
(`CYP2D6*2.002x2/CYP2D6*4.006x2` -> `CYP2D6*2x2/CYP2D6*4x2`). The **xN multiplier survives** -
|
|
696
|
+
dropping it changes the activity score, which is the bug in the pipeline's own strip that this
|
|
697
|
+
replaces. HGVS-style names are untouched (a blanket strip turns `c.51_53del` into `c51_53del`),
|
|
698
|
+
a haploid collapse stays collapsed, and verdicts (`Indeterminate`) pass through.
|
|
699
|
+
- **`description.gene_hgnc_id`** (e.g. `HGNC:2625`) alongside `description.gene`, so reports join
|
|
700
|
+
on a stable identifier rather than a symbol. Sourced from a committed `hgnc.json` - no network
|
|
701
|
+
at runtime; an unknown symbol yields `null`, never a guess.
|
|
702
|
+
|
|
703
|
+
### 2.5.37
|
|
704
|
+
|
|
705
|
+
**The Indeterminate verdict was unreachable for whole genes, and RYR1 was the one that mattered.**
|
|
706
|
+
A wild-type call resting on allele-defining positions that were never covered was reported as a
|
|
707
|
+
confident normal result. On one validated 8-sample run every RYR1 row read
|
|
708
|
+
`Reference/Reference -> uncertain susceptibility` while 5-6 malignant-hyperthermia defining
|
|
709
|
+
positions sat at read depth 0-1.
|
|
710
|
+
|
|
711
|
+
Two independent causes, and fixing either alone changes nothing:
|
|
712
|
+
|
|
713
|
+
- **`core` (function-level) was decided by "the haplotype name contains a dot".** That marks a
|
|
714
|
+
sub-allele in star nomenclature (`CYP2D6*1.001`), but the PharmGKB/CPIC-derived models name
|
|
715
|
+
haplotypes in **HGVS** - RYR1 `c.10042C>T`, CACNA1S `c.3257G>A`, MT-RNR1 `m.1095T>C` - which
|
|
716
|
+
always contains a dot. So 339 of RYR1's 340 haplotypes counted as sub-alleles, every variant
|
|
717
|
+
became non-core, and `indeterminate.defining_total` collapsed to 0 - which the verdict is gated
|
|
718
|
+
on. Now only a **trailing numeric suffix** on a star/rsID allele marks a sub-allele
|
|
719
|
+
(`is_suballele_name`), which also keeps `DPYD*rs112766203.1` correctly non-core.
|
|
720
|
+
- **`_is_wildtype_pair` matched only `*1`**, so `Reference_Reference` was never recognised as a
|
|
721
|
+
wild-type call in the first place. It now accepts a `Reference` allele too.
|
|
722
|
+
|
|
723
|
+
Related: a model that declares **only** sub-alleles (CYP4F2 is just `*1.001`..`*4.001`; likewise
|
|
724
|
+
CYP2J2, CYP3A7, CYP2S1, CYP2W1, CYP3A43, CYP26A1, CYP2F1, CYP2R1) has nothing to contrast against,
|
|
725
|
+
so nothing was core there either. When no variant in a model is core, every variant is defining.
|
|
726
|
+
|
|
727
|
+
- **Scoring is unchanged, and that is checked rather than assumed.** `core` also drives the
|
|
728
|
+
weighted haplotype match (`weight * 0.05`), but `percent_weight_match` is a ratio, so a flip of
|
|
729
|
+
*every* genotype in a model cancels. Only uniform flips are safe, and all 12 affected models
|
|
730
|
+
flip uniformly. An A/B of all 40 packaged models on one sample, old engine vs new on the same
|
|
731
|
+
tree: **36 results byte-identical, exactly one call moves** (RYR1 -> `Indeterminate`, with
|
|
732
|
+
`call_filled` keeping the best-effort answer), and 3 bookkeeping-only changes where
|
|
733
|
+
`defining_total` becomes honest (CACNA1S and CYP4F2 0 -> 2, G6PD 181 -> 182) without triggering.
|
|
734
|
+
- **`INFO/MODEL_FILL` is carried into the genotype** as `model_fill` / `model_fill_depth`. A
|
|
735
|
+
pipeline that fills model sites from read depth *before* polygenic produces genotypes that read
|
|
736
|
+
as `source: genotyping`, making a depth-verified assumption indistinguishable from a
|
|
737
|
+
measurement. Recorded as its own field, deliberately not folded into `source`: `compute_qc`
|
|
738
|
+
rejects an unknown source, and a fill that passed its depth gate is real evidence, so no verdict
|
|
739
|
+
moves.
|
|
740
|
+
- `indeterminate`'s reason string now names the actual call instead of always saying `*1/*1`.
|
|
741
|
+
|
|
563
742
|
### 2.5.36
|
|
564
743
|
|
|
565
744
|
**The packaged models now cover the whole PGx report (33 -> 40 models).** Seven genes existed
|
|
@@ -576,68 +755,12 @@ would have silently dropped them from every report.
|
|
|
576
755
|
and UGT1A1 carries the `(TA)n` promoter repeat (`*28`/`*36`/`*37`).
|
|
577
756
|
- All their indels (CFTR 1, G6PD 10, RYR1 4, UGT1A1 3) were checked against GRCh38 with
|
|
578
757
|
`bcftools norm` and were already left-aligned, so nothing was rewritten.
|
|
579
|
-
- Every added model was validated against real output: NAT2 matches
|
|
758
|
+
- Every added model was validated against real output: NAT2 matches an external review sheet on
|
|
580
759
|
4/5 samples (the fifth is PharmVar vs legacy naming, `*5/*16` vs `*5/*5`), and the six others
|
|
581
|
-
reproduce the production
|
|
760
|
+
reproduce the production star-allele JSON exactly.
|
|
582
761
|
- Manifest fix: a model added by **copying** an existing file is now dated at the copy. git
|
|
583
762
|
reported NAT2 as a copy (`C096`) of a file vendored elsewhere a day earlier, and the manifest
|
|
584
763
|
dated the model before it existed in the package. A copy is not a move - the source still
|
|
585
764
|
exists.
|
|
586
765
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
**Every result now states its gene (BT-2323).** `description.gene` carries the canonical symbol,
|
|
590
|
-
so consumers never have to derive it from the model file name.
|
|
591
|
-
|
|
592
|
-
- The file stem equalled the gene only because models were deployed renamed to `GENE.yml`.
|
|
593
|
-
Packaged models keep `{gene}-{source}-{version}.yml`, so anything parsing the name broke - the
|
|
594
|
-
pgx pipeline's gene key became `CYP2D6-PHARMVAR-5.1.8` instead of `CYP2D6`.
|
|
595
|
-
- Precedence: a model's own `description.gene` (curatorial) wins, then the shipped manifest, then
|
|
596
|
-
the file name - and only when the name really looks like a model (`CYP2D6.yml` or the
|
|
597
|
-
`{gene}-{source}-{version}` grammar). An arbitrary name yields **no** gene field rather than an
|
|
598
|
-
invented one, so the field can be trusted when present.
|
|
599
|
-
- `MT-RNR1` now declares its symbol in the model: the file-name convention cannot carry the
|
|
600
|
-
hyphen (`mtrnr1-cpic-1.0.0.yml` would give `MTRNR1`). `pgstk model-list` and the manifest honour
|
|
601
|
-
a declared gene too.
|
|
602
|
-
|
|
603
|
-
### 2.5.34
|
|
604
|
-
|
|
605
|
-
**`pip install polygenic-pgx` no longer needs a C compiler.** `pytabix` publishes no wheels, so
|
|
606
|
-
pip compiled it from source and the install failed with `command 'gcc' failed` on any machine
|
|
607
|
-
without a toolchain - including `python:3.8-slim`. That mattered more since 2.5.33, which tells
|
|
608
|
-
people to pip install and expect working models.
|
|
609
|
-
|
|
610
|
-
- `VcfAccessor` now queries the tabix index through **pysam** (already a declared dependency,
|
|
611
|
-
ships manylinux wheels) instead of pytabix; `pytabix` is dropped from `install_requires`.
|
|
612
|
-
- No behavioural change: the same records come back for point and region queries, the chr-prefix
|
|
613
|
-
retry still works, and an absent contig still yields no records rather than an error. The two
|
|
614
|
-
call sites now share one `query_lines()` helper instead of duplicating the retry.
|
|
615
|
-
- Verified by installing the wheel in `python:3.8-slim` with `gcc` absent, and by the full test
|
|
616
|
-
suite (162 tests) against the real fixtures.
|
|
617
|
-
|
|
618
|
-
### 2.5.33
|
|
619
|
-
|
|
620
|
-
**The PGx models now ship inside the package.** `pip install polygenic-pgx` installs the 33
|
|
621
|
-
PGx star-allele models alongside the engine, so there is a single source of truth instead of the
|
|
622
|
-
engine and its models arriving by separate routes (which is how a stale-model image produced wrong
|
|
623
|
-
calls in a customer validation). Full guide: `docs/models.md`.
|
|
624
|
-
|
|
625
|
-
- `-m` accepts a **built-in name or a path**: `pgs-compute -m cyp2d6` as well as
|
|
626
|
-
`-m /path/to/cyp2d6.yml`. An explicit path always wins; names never prefix-match; a gene with
|
|
627
|
-
two models from different sources raises rather than guessing. Results record both
|
|
628
|
-
`model_name` (what ran) and `model_requested` (what was asked for).
|
|
629
|
-
- New `pgstk model-list`: every model with its version, creation/update dates, checksum and
|
|
630
|
-
origin. `-m X --path-only` for scripting, `--json`, `--gene`/`--source` filters, `--verify`
|
|
631
|
-
(checksums vs the manifest), `--models-dir`.
|
|
632
|
-
- New `pgstk model-manifest` regenerates the committed `manifest.json` from git history.
|
|
633
|
-
Creation dates survive both traps: a rebuild that renames a file is dated at the rebuild, while
|
|
634
|
-
relocating the models wholesale does not reset them. Dates are never inferred from filesystem
|
|
635
|
-
timestamps, and a model whose bytes drift from the manifest reports `unknown` rather than a
|
|
636
|
-
stale date.
|
|
637
|
-
- `POLYGENIC_MODELS_DIR` is now honoured by the engine (previously shell-only) and searched before
|
|
638
|
-
the built-ins, so a pipeline can override part or all of the set.
|
|
639
|
-
- Packaging: models moved to `polygenic/models/pgx/`; the shipped directory is data-pure and the
|
|
640
|
-
release gate asserts that notes/scripts are absent from the wheel. `build.sh` now uses the same
|
|
641
|
-
PEP 517 build as the gate, with an upload glob that matches the actual artifact names.
|
|
642
|
-
|
|
643
|
-
Older releases: see `CHANGELOG.md` in the repository (it ships in the sdist).
|
|
766
|
+
Older entries: see [CHANGELOG.md](CHANGELOG.md), which ships with the source distribution and holds the full release history.
|