@genobank/biofs 3.22.0 → 3.23.0
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.
- package/CHANGELOG.md +32 -0
- package/dist/abi/sequentia/ConsentGrant.json +1909 -0
- package/dist/commands/admin/verify-lab.js +1 -1
- package/dist/commands/admin/verify-lab.js.map +1 -1
- package/dist/commands/alphagenome/index.d.ts +26 -0
- package/dist/commands/alphagenome/index.d.ts.map +1 -0
- package/dist/commands/alphagenome/index.js +72 -0
- package/dist/commands/alphagenome/index.js.map +1 -0
- package/dist/commands/annotate/signed_headers.d.ts +5 -0
- package/dist/commands/annotate/signed_headers.d.ts.map +1 -0
- package/dist/commands/annotate/signed_headers.js +10 -0
- package/dist/commands/annotate/signed_headers.js.map +1 -0
- package/dist/commands/annotate/status.d.ts.map +1 -1
- package/dist/commands/annotate/status.js +4 -0
- package/dist/commands/annotate/status.js.map +1 -1
- package/dist/commands/annotate/submit.d.ts +4 -1
- package/dist/commands/annotate/submit.d.ts.map +1 -1
- package/dist/commands/annotate/submit.js +41 -12
- package/dist/commands/annotate/submit.js.map +1 -1
- package/dist/commands/biofiles.d.ts.map +1 -1
- package/dist/commands/biofiles.js +10 -2
- package/dist/commands/biofiles.js.map +1 -1
- package/dist/commands/clawbio/submit.d.ts +24 -0
- package/dist/commands/clawbio/submit.d.ts.map +1 -0
- package/dist/commands/clawbio/submit.js +175 -0
- package/dist/commands/clawbio/submit.js.map +1 -0
- package/dist/commands/consent.d.ts +1 -0
- package/dist/commands/consent.d.ts.map +1 -1
- package/dist/commands/consent.js +3 -2
- package/dist/commands/consent.js.map +1 -1
- package/dist/commands/context/create.d.ts.map +1 -1
- package/dist/commands/context/create.js +40 -5
- package/dist/commands/context/create.js.map +1 -1
- package/dist/commands/crypt4gh.d.ts +24 -0
- package/dist/commands/crypt4gh.d.ts.map +1 -0
- package/dist/commands/crypt4gh.js +220 -0
- package/dist/commands/crypt4gh.js.map +1 -0
- package/dist/commands/fluency/index.d.ts +6 -0
- package/dist/commands/fluency/index.d.ts.map +1 -1
- package/dist/commands/fluency/index.js +64 -0
- package/dist/commands/fluency/index.js.map +1 -1
- package/dist/commands/fourier-score.d.ts +2 -0
- package/dist/commands/fourier-score.d.ts.map +1 -1
- package/dist/commands/fourier-score.js +201 -107
- package/dist/commands/fourier-score.js.map +1 -1
- package/dist/commands/fusion-evidence/index.d.ts +25 -0
- package/dist/commands/fusion-evidence/index.d.ts.map +1 -0
- package/dist/commands/fusion-evidence/index.js +136 -0
- package/dist/commands/fusion-evidence/index.js.map +1 -0
- package/dist/commands/governance.d.ts +46 -0
- package/dist/commands/governance.d.ts.map +1 -0
- package/dist/commands/governance.js +126 -0
- package/dist/commands/governance.js.map +1 -0
- package/dist/commands/humanmark.d.ts +68 -0
- package/dist/commands/humanmark.d.ts.map +1 -0
- package/dist/commands/humanmark.js +278 -0
- package/dist/commands/humanmark.js.map +1 -0
- package/dist/commands/imaging/compare.d.ts +1 -0
- package/dist/commands/imaging/compare.d.ts.map +1 -1
- package/dist/commands/imaging/compare.js +1 -0
- package/dist/commands/imaging/compare.js.map +1 -1
- package/dist/commands/imaging/lesions.d.ts +1 -0
- package/dist/commands/imaging/lesions.d.ts.map +1 -1
- package/dist/commands/imaging/lesions.js +2 -1
- package/dist/commands/imaging/lesions.js.map +1 -1
- package/dist/commands/imaging/register.d.ts +1 -0
- package/dist/commands/imaging/register.d.ts.map +1 -1
- package/dist/commands/imaging/register.js +24 -0
- package/dist/commands/imaging/register.js.map +1 -1
- package/dist/commands/imaging/trajectory.d.ts +1 -0
- package/dist/commands/imaging/trajectory.d.ts.map +1 -1
- package/dist/commands/imaging/trajectory.js +2 -1
- package/dist/commands/imaging/trajectory.js.map +1 -1
- package/dist/commands/imaging/twin.d.ts +1 -0
- package/dist/commands/imaging/twin.d.ts.map +1 -1
- package/dist/commands/imaging/twin.js +1 -0
- package/dist/commands/imaging/twin.js.map +1 -1
- package/dist/commands/inventory-register-sqlite.d.ts +10 -0
- package/dist/commands/inventory-register-sqlite.d.ts.map +1 -1
- package/dist/commands/inventory-register-sqlite.js +62 -8
- package/dist/commands/inventory-register-sqlite.js.map +1 -1
- package/dist/commands/job/submit-clara.d.ts.map +1 -1
- package/dist/commands/job/submit-clara.js +71 -50
- package/dist/commands/job/submit-clara.js.map +1 -1
- package/dist/commands/kiosk/canon.d.ts +95 -0
- package/dist/commands/kiosk/canon.d.ts.map +1 -0
- package/dist/commands/kiosk/canon.js +120 -0
- package/dist/commands/kiosk/canon.js.map +1 -0
- package/dist/commands/kiosk/cli.d.ts +12 -0
- package/dist/commands/kiosk/cli.d.ts.map +1 -0
- package/dist/commands/kiosk/cli.js +784 -0
- package/dist/commands/kiosk/cli.js.map +1 -0
- package/dist/commands/kiosk/client.d.ts +32 -0
- package/dist/commands/kiosk/client.d.ts.map +1 -0
- package/dist/commands/kiosk/client.js +179 -0
- package/dist/commands/kiosk/client.js.map +1 -0
- package/dist/commands/kiosk/cryptobox.d.ts +41 -0
- package/dist/commands/kiosk/cryptobox.d.ts.map +1 -0
- package/dist/commands/kiosk/cryptobox.js +126 -0
- package/dist/commands/kiosk/cryptobox.js.map +1 -0
- package/dist/commands/kiosk/gate.d.ts +13 -0
- package/dist/commands/kiosk/gate.d.ts.map +1 -0
- package/dist/commands/kiosk/gate.js +174 -0
- package/dist/commands/kiosk/gate.js.map +1 -0
- package/dist/commands/kiosk/home.d.ts +80 -0
- package/dist/commands/kiosk/home.d.ts.map +1 -0
- package/dist/commands/kiosk/home.js +265 -0
- package/dist/commands/kiosk/home.js.map +1 -0
- package/dist/commands/kiosk/hooks.d.ts +24 -0
- package/dist/commands/kiosk/hooks.d.ts.map +1 -0
- package/dist/commands/kiosk/hooks.js +305 -0
- package/dist/commands/kiosk/hooks.js.map +1 -0
- package/dist/commands/kiosk/invitemail.d.ts +17 -0
- package/dist/commands/kiosk/invitemail.d.ts.map +1 -0
- package/dist/commands/kiosk/invitemail.js +58 -0
- package/dist/commands/kiosk/invitemail.js.map +1 -0
- package/dist/commands/kiosk/main.d.ts +7 -0
- package/dist/commands/kiosk/main.d.ts.map +1 -0
- package/dist/commands/kiosk/main.js +20 -0
- package/dist/commands/kiosk/main.js.map +1 -0
- package/dist/commands/kiosk/mcp.d.ts +28 -0
- package/dist/commands/kiosk/mcp.d.ts.map +1 -0
- package/dist/commands/kiosk/mcp.js +304 -0
- package/dist/commands/kiosk/mcp.js.map +1 -0
- package/dist/commands/kiosk/pairing.d.ts +28 -0
- package/dist/commands/kiosk/pairing.d.ts.map +1 -0
- package/dist/commands/kiosk/pairing.js +147 -0
- package/dist/commands/kiosk/pairing.js.map +1 -0
- package/dist/commands/kiosk/presence.d.ts +11 -0
- package/dist/commands/kiosk/presence.d.ts.map +1 -0
- package/dist/commands/kiosk/presence.js +105 -0
- package/dist/commands/kiosk/presence.js.map +1 -0
- package/dist/commands/kiosk/profile.d.ts +59 -0
- package/dist/commands/kiosk/profile.d.ts.map +1 -0
- package/dist/commands/kiosk/profile.js +266 -0
- package/dist/commands/kiosk/profile.js.map +1 -0
- package/dist/commands/kiosk/room.d.ts +252 -0
- package/dist/commands/kiosk/room.d.ts.map +1 -0
- package/dist/commands/kiosk/room.js +1057 -0
- package/dist/commands/kiosk/room.js.map +1 -0
- package/dist/commands/mirror.d.ts +16 -0
- package/dist/commands/mirror.d.ts.map +1 -0
- package/dist/commands/mirror.js +172 -0
- package/dist/commands/mirror.js.map +1 -0
- package/dist/commands/neoantigen/align.d.ts +15 -0
- package/dist/commands/neoantigen/align.d.ts.map +1 -0
- package/dist/commands/neoantigen/align.js +74 -0
- package/dist/commands/neoantigen/align.js.map +1 -0
- package/dist/commands/neoantigen/fabricate.d.ts +20 -0
- package/dist/commands/neoantigen/fabricate.d.ts.map +1 -0
- package/dist/commands/neoantigen/fabricate.js +119 -0
- package/dist/commands/neoantigen/fabricate.js.map +1 -0
- package/dist/commands/neoantigen/ingest.d.ts +14 -0
- package/dist/commands/neoantigen/ingest.d.ts.map +1 -0
- package/dist/commands/neoantigen/ingest.js +62 -0
- package/dist/commands/neoantigen/ingest.js.map +1 -0
- package/dist/commands/neoantigen/status.d.ts +4 -0
- package/dist/commands/neoantigen/status.d.ts.map +1 -0
- package/dist/commands/neoantigen/status.js +69 -0
- package/dist/commands/neoantigen/status.js.map +1 -0
- package/dist/commands/neoantigen-pipeline/index.d.ts +146 -2
- package/dist/commands/neoantigen-pipeline/index.d.ts.map +1 -1
- package/dist/commands/neoantigen-pipeline/index.js +413 -1
- package/dist/commands/neoantigen-pipeline/index.js.map +1 -1
- package/dist/commands/onramp/huggingface.d.ts +33 -0
- package/dist/commands/onramp/huggingface.d.ts.map +1 -0
- package/dist/commands/onramp/huggingface.js +124 -0
- package/dist/commands/onramp/huggingface.js.map +1 -0
- package/dist/commands/parabricks/index.d.ts +3 -1
- package/dist/commands/parabricks/index.d.ts.map +1 -1
- package/dist/commands/parabricks/index.js +16 -6
- package/dist/commands/parabricks/index.js.map +1 -1
- package/dist/commands/parabricks/registry.json +105 -3
- package/dist/commands/protein-impact/benchmark.d.ts +34 -0
- package/dist/commands/protein-impact/benchmark.d.ts.map +1 -0
- package/dist/commands/protein-impact/benchmark.js +75 -0
- package/dist/commands/protein-impact/benchmark.js.map +1 -0
- package/dist/commands/protein-impact/benchmark_v1.json +1 -0
- package/dist/commands/protein-impact/constants.d.ts +54 -0
- package/dist/commands/protein-impact/constants.d.ts.map +1 -0
- package/dist/commands/protein-impact/constants.js +47 -0
- package/dist/commands/protein-impact/constants.js.map +1 -0
- package/dist/commands/protein-impact/core.d.ts +145 -0
- package/dist/commands/protein-impact/core.d.ts.map +1 -0
- package/dist/commands/protein-impact/core.js +288 -0
- package/dist/commands/protein-impact/core.js.map +1 -0
- package/dist/commands/protein-impact/domain_table.json +23 -0
- package/dist/commands/protein-impact/domains.d.ts +9 -0
- package/dist/commands/protein-impact/domains.d.ts.map +1 -0
- package/dist/commands/protein-impact/domains.js +29 -0
- package/dist/commands/protein-impact/domains.js.map +1 -0
- package/dist/commands/protein-impact/estimate.d.ts +48 -0
- package/dist/commands/protein-impact/estimate.d.ts.map +1 -0
- package/dist/commands/protein-impact/estimate.js +101 -0
- package/dist/commands/protein-impact/estimate.js.map +1 -0
- package/dist/commands/protein-impact/exec.d.ts +60 -0
- package/dist/commands/protein-impact/exec.d.ts.map +1 -0
- package/dist/commands/protein-impact/exec.js +227 -0
- package/dist/commands/protein-impact/exec.js.map +1 -0
- package/dist/commands/protein-impact/features.d.ts +24 -0
- package/dist/commands/protein-impact/features.d.ts.map +1 -0
- package/dist/commands/protein-impact/features.js +93 -0
- package/dist/commands/protein-impact/features.js.map +1 -0
- package/dist/commands/protein-impact/gate.d.ts +94 -0
- package/dist/commands/protein-impact/gate.d.ts.map +1 -0
- package/dist/commands/protein-impact/gate.js +120 -0
- package/dist/commands/protein-impact/gate.js.map +1 -0
- package/dist/commands/protein-impact/gate_rules.json +10 -0
- package/dist/commands/protein-impact/guard.d.ts +44 -0
- package/dist/commands/protein-impact/guard.d.ts.map +1 -0
- package/dist/commands/protein-impact/guard.js +189 -0
- package/dist/commands/protein-impact/guard.js.map +1 -0
- package/dist/commands/protein-impact/metrics.d.ts +44 -0
- package/dist/commands/protein-impact/metrics.d.ts.map +1 -0
- package/dist/commands/protein-impact/metrics.js +178 -0
- package/dist/commands/protein-impact/metrics.js.map +1 -0
- package/dist/commands/protein-impact/numbering.d.ts +33 -0
- package/dist/commands/protein-impact/numbering.d.ts.map +1 -0
- package/dist/commands/protein-impact/numbering.js +115 -0
- package/dist/commands/protein-impact/numbering.js.map +1 -0
- package/dist/commands/protein-impact/register.d.ts +6 -0
- package/dist/commands/protein-impact/register.d.ts.map +1 -0
- package/dist/commands/protein-impact/register.js +139 -0
- package/dist/commands/protein-impact/register.js.map +1 -0
- package/dist/commands/protein-impact/request.d.ts +14 -0
- package/dist/commands/protein-impact/request.d.ts.map +1 -0
- package/dist/commands/protein-impact/request.js +73 -0
- package/dist/commands/protein-impact/request.js.map +1 -0
- package/dist/commands/protein-impact/submit.d.ts +117 -0
- package/dist/commands/protein-impact/submit.d.ts.map +1 -0
- package/dist/commands/protein-impact/submit.js +460 -0
- package/dist/commands/protein-impact/submit.js.map +1 -0
- package/dist/commands/protein-impact/tools.lock.json +53 -0
- package/dist/commands/protein-impact/tools_lock.d.ts +41 -0
- package/dist/commands/protein-impact/tools_lock.d.ts.map +1 -0
- package/dist/commands/protein-impact/tools_lock.js +52 -0
- package/dist/commands/protein-impact/tools_lock.js.map +1 -0
- package/dist/commands/psm-consensus.d.ts.map +1 -1
- package/dist/commands/psm-consensus.js +65 -26
- package/dist/commands/psm-consensus.js.map +1 -1
- package/dist/commands/reconcile-owners.d.ts +21 -0
- package/dist/commands/reconcile-owners.d.ts.map +1 -0
- package/dist/commands/reconcile-owners.js +86 -0
- package/dist/commands/reconcile-owners.js.map +1 -0
- package/dist/commands/reference-register/index.d.ts +8 -0
- package/dist/commands/reference-register/index.d.ts.map +1 -0
- package/dist/commands/reference-register/index.js +58 -0
- package/dist/commands/reference-register/index.js.map +1 -0
- package/dist/commands/register-derived-file.d.ts +9 -0
- package/dist/commands/register-derived-file.d.ts.map +1 -0
- package/dist/commands/register-derived-file.js +101 -0
- package/dist/commands/register-derived-file.js.map +1 -0
- package/dist/commands/rrm-consensus.d.ts.map +1 -1
- package/dist/commands/rrm-consensus.js +65 -26
- package/dist/commands/rrm-consensus.js.map +1 -1
- package/dist/commands/rrm-validate.d.ts +22 -0
- package/dist/commands/rrm-validate.d.ts.map +1 -0
- package/dist/commands/rrm-validate.js +109 -0
- package/dist/commands/rrm-validate.js.map +1 -0
- package/dist/commands/tele.d.ts +1 -0
- package/dist/commands/tele.d.ts.map +1 -1
- package/dist/commands/tele.js +37 -2
- package/dist/commands/tele.js.map +1 -1
- package/dist/commands/tokenize.d.ts.map +1 -1
- package/dist/commands/tokenize.js +35 -0
- package/dist/commands/tokenize.js.map +1 -1
- package/dist/commands/upload.d.ts +28 -1
- package/dist/commands/upload.d.ts.map +1 -1
- package/dist/commands/upload.js +174 -31
- package/dist/commands/upload.js.map +1 -1
- package/dist/commands/vault/mount.d.ts.map +1 -1
- package/dist/commands/vault/mount.js +6 -0
- package/dist/commands/vault/mount.js.map +1 -1
- package/dist/commands/workspace.d.ts +2 -0
- package/dist/commands/workspace.d.ts.map +1 -1
- package/dist/commands/workspace.js +16 -4
- package/dist/commands/workspace.js.map +1 -1
- package/dist/commands/x402/submit.d.ts.map +1 -1
- package/dist/commands/x402/submit.js +7 -4
- package/dist/commands/x402/submit.js.map +1 -1
- package/dist/index.js +810 -31
- package/dist/index.js.map +1 -1
- package/dist/lib/api/bionft-client.d.ts.map +1 -1
- package/dist/lib/api/bionft-client.js +1 -1
- package/dist/lib/api/bionft-client.js.map +1 -1
- package/dist/lib/api/fuse-client.d.ts.map +1 -1
- package/dist/lib/api/fuse-client.js +8 -1
- package/dist/lib/api/fuse-client.js.map +1 -1
- package/dist/lib/biofiles/resolver.d.ts.map +1 -1
- package/dist/lib/biofiles/resolver.js +5 -2
- package/dist/lib/biofiles/resolver.js.map +1 -1
- package/dist/lib/crypt4gh/bind.d.ts +51 -0
- package/dist/lib/crypt4gh/bind.d.ts.map +1 -0
- package/dist/lib/crypt4gh/bind.js +140 -0
- package/dist/lib/crypt4gh/bind.js.map +1 -0
- package/dist/lib/crypt4gh/index.d.ts +45 -0
- package/dist/lib/crypt4gh/index.d.ts.map +1 -0
- package/dist/lib/crypt4gh/index.js +391 -0
- package/dist/lib/crypt4gh/index.js.map +1 -0
- package/dist/lib/gene-map.d.ts.map +1 -1
- package/dist/lib/gene-map.js +13 -0
- package/dist/lib/gene-map.js.map +1 -1
- package/dist/lib/rrm_fft.py +555 -0
- package/dist/lib/sequentia/BioPIL.js +1 -1
- package/dist/lib/sequentia/BioPIL.js.map +1 -1
- package/dist/lib/sequentia/ConsentManager.js +1 -1
- package/dist/lib/sequentia/ConsentManager.js.map +1 -1
- package/dist/lib/sequentia/OpenCravatJobs.js +1 -1
- package/dist/lib/sequentia/OpenCravatJobs.js.map +1 -1
- package/dist/lib/sequentia/PaymentRouter.js +1 -1
- package/dist/lib/sequentia/PaymentRouter.js.map +1 -1
- package/dist/lib/sequentia/consent-grant-c2pa.d.ts +134 -0
- package/dist/lib/sequentia/consent-grant-c2pa.d.ts.map +1 -0
- package/dist/lib/sequentia/consent-grant-c2pa.js +218 -0
- package/dist/lib/sequentia/consent-grant-c2pa.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statistics for the validation gate. Deterministic (seeded) and dependency free.
|
|
3
|
+
*
|
|
4
|
+
* The score under test has no fitted weights: the components are oriented so that a higher number means
|
|
5
|
+
* "more likely damaging" and are combined by averaging their ranks. So there is no train/test split to leave a
|
|
6
|
+
* domain out of; the checks are the pooled AUROC with a stratified bootstrap interval, the AUROC inside each
|
|
7
|
+
* structural domain, the comparison with simple baselines, and a permutation null as a sanity check of the
|
|
8
|
+
* evaluation code itself.
|
|
9
|
+
*/
|
|
10
|
+
import { Auc, GateMetrics } from './gate';
|
|
11
|
+
import type { BenchRow } from './benchmark';
|
|
12
|
+
export declare const GATE_SEED = 20261021;
|
|
13
|
+
export declare const BOOTSTRAP_B = 2000;
|
|
14
|
+
export declare const PERMUTATION_B = 1000;
|
|
15
|
+
/** Small seeded PRNG (mulberry32): the same seed always gives the same stream. */
|
|
16
|
+
export declare function mulberry32(seed: number): () => number;
|
|
17
|
+
/** Average ranks (1 = smallest); ties share their mean rank. */
|
|
18
|
+
export declare function ranks(values: number[]): number[];
|
|
19
|
+
/** Rank-average of oriented components (each: higher = more damaging). No weights are learned. */
|
|
20
|
+
export declare function rankAverage(components: number[][]): number[];
|
|
21
|
+
/** AUROC with a bootstrap 95% interval; resampling is stratified by (stratum, label) so every domain keeps its size. */
|
|
22
|
+
export declare function pooledAuroc(scores: number[], labels: number[], strata: string[], B?: number, seed?: number): Auc;
|
|
23
|
+
/** AUROC under randomly permuted labels: a sanity check of the evaluation, centred on 0.5. */
|
|
24
|
+
export declare function permutationNull(scores: number[], labels: number[], B?: number, seed?: number): {
|
|
25
|
+
ci_low: number;
|
|
26
|
+
ci_high: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function perDomain(scores: number[], labels: number[], domains: string[]): Record<string, {
|
|
29
|
+
auroc: number | null;
|
|
30
|
+
pos: number;
|
|
31
|
+
neg: number;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Domain prior: the share of damaging variants in the variant's own domain, computed on the benchmark itself. This
|
|
35
|
+
* is deliberately optimistic (it has seen the labels), so it is an upper bound for any score that only knows which
|
|
36
|
+
* domain a variant is in; the model has to beat it, not just chance. (A leave-one-out version is anti-informative
|
|
37
|
+
* inside a domain by construction, so it would be a bad bar.)
|
|
38
|
+
*/
|
|
39
|
+
export declare function domainPrior(labels: number[], domains: string[]): number[];
|
|
40
|
+
/** Uncontaminated baselines: nothing here was trained on ClinVar. Higher = more damaging. */
|
|
41
|
+
export declare function baselineScores(rows: BenchRow[]): Record<string, number[]>;
|
|
42
|
+
/** Everything the gate rules read, from the benchmark rows and the combined score under test. */
|
|
43
|
+
export declare function assembleMetrics(rows: BenchRow[], ensemble: number[], baselines?: Record<string, number[]>): GateMetrics;
|
|
44
|
+
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/commands/protein-impact/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,SAAS,WAAW,CAAC;AAClC,eAAO,MAAM,WAAW,OAAO,CAAC;AAChC,eAAO,MAAM,aAAa,OAAO,CAAC;AAIlC,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,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MAAM,EAAE,MAAM,EAAE,CAAwB,GAAG,WAAW,CAqB7I"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Statistics for the validation gate. Deterministic (seeded) and dependency free.
|
|
4
|
+
*
|
|
5
|
+
* The score under test has no fitted weights: the components are oriented so that a higher number means
|
|
6
|
+
* "more likely damaging" and are combined by averaging their ranks. So there is no train/test split to leave a
|
|
7
|
+
* domain out of; the checks are the pooled AUROC with a stratified bootstrap interval, the AUROC inside each
|
|
8
|
+
* structural domain, the comparison with simple baselines, and a permutation null as a sanity check of the
|
|
9
|
+
* evaluation code itself.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PERMUTATION_B = exports.BOOTSTRAP_B = exports.GATE_SEED = void 0;
|
|
13
|
+
exports.mulberry32 = mulberry32;
|
|
14
|
+
exports.ranks = ranks;
|
|
15
|
+
exports.rankAverage = rankAverage;
|
|
16
|
+
exports.pooledAuroc = pooledAuroc;
|
|
17
|
+
exports.permutationNull = permutationNull;
|
|
18
|
+
exports.perDomain = perDomain;
|
|
19
|
+
exports.domainPrior = domainPrior;
|
|
20
|
+
exports.baselineScores = baselineScores;
|
|
21
|
+
exports.assembleMetrics = assembleMetrics;
|
|
22
|
+
const features_1 = require("./features");
|
|
23
|
+
exports.GATE_SEED = 20261021;
|
|
24
|
+
exports.BOOTSTRAP_B = 2000;
|
|
25
|
+
exports.PERMUTATION_B = 1000;
|
|
26
|
+
const round = (x) => Math.round(x * 10000) / 10000;
|
|
27
|
+
/** Small seeded PRNG (mulberry32): the same seed always gives the same stream. */
|
|
28
|
+
function mulberry32(seed) {
|
|
29
|
+
let a = seed >>> 0;
|
|
30
|
+
return () => {
|
|
31
|
+
a = (a + 0x6d2b79f5) >>> 0;
|
|
32
|
+
let t = a;
|
|
33
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
34
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
35
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** Average ranks (1 = smallest); ties share their mean rank. */
|
|
39
|
+
function ranks(values) {
|
|
40
|
+
const idx = values.map((v, i) => [v, i]).sort((x, y) => x[0] - y[0]);
|
|
41
|
+
const out = new Array(values.length);
|
|
42
|
+
let i = 0;
|
|
43
|
+
while (i < idx.length) {
|
|
44
|
+
let j = i;
|
|
45
|
+
while (j + 1 < idx.length && idx[j + 1][0] === idx[i][0])
|
|
46
|
+
j++;
|
|
47
|
+
const mean = (i + j) / 2 + 1;
|
|
48
|
+
for (let k = i; k <= j; k++)
|
|
49
|
+
out[idx[k][1]] = mean;
|
|
50
|
+
i = j + 1;
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
54
|
+
/** Rank-average of oriented components (each: higher = more damaging). No weights are learned. */
|
|
55
|
+
function rankAverage(components) {
|
|
56
|
+
if (components.length === 0)
|
|
57
|
+
throw new Error('no components to combine');
|
|
58
|
+
const n = components[0].length;
|
|
59
|
+
const rs = components.map(c => {
|
|
60
|
+
if (c.length !== n)
|
|
61
|
+
throw new Error('components differ in length');
|
|
62
|
+
if (c.some(v => !Number.isFinite(v)))
|
|
63
|
+
throw new Error('a component holds a non-finite score');
|
|
64
|
+
return ranks(c);
|
|
65
|
+
});
|
|
66
|
+
return Array.from({ length: n }, (_, i) => rs.reduce((a, r) => a + r[i], 0) / rs.length);
|
|
67
|
+
}
|
|
68
|
+
const percentile = (sorted, p) => {
|
|
69
|
+
const pos = (sorted.length - 1) * p;
|
|
70
|
+
const lo = Math.floor(pos), hi = Math.ceil(pos);
|
|
71
|
+
return sorted[lo] + (sorted[hi] - sorted[lo]) * (pos - lo);
|
|
72
|
+
};
|
|
73
|
+
/** AUROC with a bootstrap 95% interval; resampling is stratified by (stratum, label) so every domain keeps its size. */
|
|
74
|
+
function pooledAuroc(scores, labels, strata, B = exports.BOOTSTRAP_B, seed = exports.GATE_SEED) {
|
|
75
|
+
const point = (0, features_1.auroc)(scores, labels);
|
|
76
|
+
const cells = new Map();
|
|
77
|
+
labels.forEach((l, i) => {
|
|
78
|
+
const k = `${strata[i]}|${l}`;
|
|
79
|
+
if (!cells.has(k))
|
|
80
|
+
cells.set(k, []);
|
|
81
|
+
cells.get(k).push(i);
|
|
82
|
+
});
|
|
83
|
+
const rnd = mulberry32(seed);
|
|
84
|
+
const draws = [];
|
|
85
|
+
for (let b = 0; b < B; b++) {
|
|
86
|
+
const s = [], l = [];
|
|
87
|
+
for (const members of cells.values()) {
|
|
88
|
+
for (let k = 0; k < members.length; k++) {
|
|
89
|
+
const i = members[Math.floor(rnd() * members.length)];
|
|
90
|
+
s.push(scores[i]);
|
|
91
|
+
l.push(labels[i]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const a = (0, features_1.auroc)(s, l);
|
|
95
|
+
if (Number.isFinite(a))
|
|
96
|
+
draws.push(a);
|
|
97
|
+
}
|
|
98
|
+
draws.sort((x, y) => x - y);
|
|
99
|
+
return { point: round(point), ci_low: round(percentile(draws, 0.025)), ci_high: round(percentile(draws, 0.975)) };
|
|
100
|
+
}
|
|
101
|
+
/** AUROC under randomly permuted labels: a sanity check of the evaluation, centred on 0.5. */
|
|
102
|
+
function permutationNull(scores, labels, B = exports.PERMUTATION_B, seed = exports.GATE_SEED + 1) {
|
|
103
|
+
const rnd = mulberry32(seed);
|
|
104
|
+
const draws = [];
|
|
105
|
+
const perm = [...labels];
|
|
106
|
+
for (let b = 0; b < B; b++) {
|
|
107
|
+
for (let i = perm.length - 1; i > 0; i--) {
|
|
108
|
+
const j = Math.floor(rnd() * (i + 1));
|
|
109
|
+
[perm[i], perm[j]] = [perm[j], perm[i]];
|
|
110
|
+
}
|
|
111
|
+
const a = (0, features_1.auroc)(scores, perm);
|
|
112
|
+
if (Number.isFinite(a))
|
|
113
|
+
draws.push(a);
|
|
114
|
+
}
|
|
115
|
+
draws.sort((x, y) => x - y);
|
|
116
|
+
return { ci_low: round(percentile(draws, 0.025)), ci_high: round(percentile(draws, 0.975)) };
|
|
117
|
+
}
|
|
118
|
+
function perDomain(scores, labels, domains) {
|
|
119
|
+
const groups = new Map();
|
|
120
|
+
domains.forEach((d, i) => {
|
|
121
|
+
if (!groups.has(d))
|
|
122
|
+
groups.set(d, []);
|
|
123
|
+
groups.get(d).push(i);
|
|
124
|
+
});
|
|
125
|
+
const res = {};
|
|
126
|
+
for (const [d, idx] of groups) {
|
|
127
|
+
const l = idx.map(i => labels[i]);
|
|
128
|
+
const a = (0, features_1.auroc)(idx.map(i => scores[i]), l);
|
|
129
|
+
res[d] = { auroc: Number.isFinite(a) ? round(a) : null, pos: l.filter(x => x === 1).length, neg: l.filter(x => x === 0).length };
|
|
130
|
+
}
|
|
131
|
+
return res;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Domain prior: the share of damaging variants in the variant's own domain, computed on the benchmark itself. This
|
|
135
|
+
* is deliberately optimistic (it has seen the labels), so it is an upper bound for any score that only knows which
|
|
136
|
+
* domain a variant is in; the model has to beat it, not just chance. (A leave-one-out version is anti-informative
|
|
137
|
+
* inside a domain by construction, so it would be a bad bar.)
|
|
138
|
+
*/
|
|
139
|
+
function domainPrior(labels, domains) {
|
|
140
|
+
const tot = new Map(), pos = new Map();
|
|
141
|
+
domains.forEach((d, i) => { tot.set(d, (tot.get(d) ?? 0) + 1); pos.set(d, (pos.get(d) ?? 0) + labels[i]); });
|
|
142
|
+
return domains.map(d => (pos.get(d) ?? 0) / (tot.get(d) ?? 1));
|
|
143
|
+
}
|
|
144
|
+
/** Uncontaminated baselines: nothing here was trained on ClinVar. Higher = more damaging. */
|
|
145
|
+
function baselineScores(rows) {
|
|
146
|
+
const f = rows.map(r => (0, features_1.substitutionFeatures)(r.ref, r.alt));
|
|
147
|
+
return {
|
|
148
|
+
blosum62: f.map(x => -x.blosum62),
|
|
149
|
+
hydropathy_change: f.map(x => Math.abs(x.delta_hydropathy)),
|
|
150
|
+
volume_change: f.map(x => Math.abs(x.delta_volume)),
|
|
151
|
+
domain_prior: domainPrior(rows.map(r => r.label), rows.map(r => r.domain)),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/** Everything the gate rules read, from the benchmark rows and the combined score under test. */
|
|
155
|
+
function assembleMetrics(rows, ensemble, baselines = baselineScores(rows)) {
|
|
156
|
+
const labels = rows.map(r => r.label);
|
|
157
|
+
const domains = rows.map(r => r.domain);
|
|
158
|
+
const base = Object.entries(baselines).map(([name, s]) => ({ name, auroc: round((0, features_1.auroc)(s, labels)) }));
|
|
159
|
+
const best = base.reduce((a, b) => (b.auroc > a.auroc ? b : a));
|
|
160
|
+
const dom = perDomain(ensemble, labels, domains);
|
|
161
|
+
const domain_auroc = {};
|
|
162
|
+
const domain_n = {};
|
|
163
|
+
for (const [d, v] of Object.entries(dom)) {
|
|
164
|
+
domain_n[d] = { pos: v.pos, neg: v.neg };
|
|
165
|
+
if (v.auroc !== null)
|
|
166
|
+
domain_auroc[d] = v.auroc;
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
n_pos: labels.filter(l => l === 1).length,
|
|
170
|
+
n_neg: labels.filter(l => l === 0).length,
|
|
171
|
+
pooled_auroc: pooledAuroc(ensemble, labels, domains),
|
|
172
|
+
best_baseline: best,
|
|
173
|
+
domain_auroc,
|
|
174
|
+
domain_n,
|
|
175
|
+
shuffled_label: permutationNull(ensemble, labels),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/commands/protein-impact/metrics.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAaH,gCASC;AAGD,sBAYC;AAGD,kCASC;AASD,kCAuBC;AAGD,0CAcC;AAED,8BAaC;AAQD,kCAIC;AAG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AAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;QACzC,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI;YAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;IAClD,CAAC;IACD,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;QACzC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;QACzC,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;QACpD,aAAa,EAAE,IAAI;QACnB,YAAY;QACZ,QAAQ;QACR,cAAc,EAAE,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Residue numbering for protein-impact.
|
|
3
|
+
*
|
|
4
|
+
* HGVS protein positions count from the precursor Met. The GT literature and the PDB entries use the
|
|
5
|
+
* mature chain, so every literature or structure comparison must convert first:
|
|
6
|
+
* ITGA2B (P08514): signal 1..31, mature = HGVS - 31 (Val779 = 748, Leu225 = 194, Asn2 = 33)
|
|
7
|
+
* ITGB3 (P05106): signal 1..26, mature = HGVS - 26 (ONE global offset would corrupt ITGB3 rows)
|
|
8
|
+
* `structureOffset` derives the offset of a structure chain from its own sequence instead of assuming it.
|
|
9
|
+
*/
|
|
10
|
+
export interface Substitution {
|
|
11
|
+
gene: string;
|
|
12
|
+
ref: string;
|
|
13
|
+
pos: number;
|
|
14
|
+
alt: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class NumberingError extends Error {
|
|
17
|
+
}
|
|
18
|
+
/** Parse `ITGA2B:p.Leu225Arg`, `ITGA2B:p.L225R` or `ITGA2B:L225R`. Missense only. */
|
|
19
|
+
export declare function parseVariant(spec: string): Substitution;
|
|
20
|
+
export declare function formatVariant(s: Substitution, style?: 'three' | 'one'): string;
|
|
21
|
+
/** HGVS (precursor) -> classical mature-chain numbering. */
|
|
22
|
+
export declare function toMature(gene: string, hgvsPos: number): number;
|
|
23
|
+
/** Classical mature-chain numbering -> HGVS (precursor). */
|
|
24
|
+
export declare function fromMature(gene: string, maturePos: number): number;
|
|
25
|
+
/** Throw unless the pinned UniProt sequence has the stated reference residue at the stated position. */
|
|
26
|
+
export declare function assertResidue(sub: Substitution, sequence: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Offset between HGVS numbering and a structure chain: position_in_structure = hgvsPos - offset.
|
|
29
|
+
* Found by locating the chain's own sequence inside the UniProt sequence (first 12 residues as the
|
|
30
|
+
* anchor, then verified over the first 50), never assumed. Returns null when it cannot be anchored.
|
|
31
|
+
*/
|
|
32
|
+
export declare function structureOffset(uniprotSeq: string, chainSeq: string): number | null;
|
|
33
|
+
//# sourceMappingURL=numbering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbering.d.ts","sourceRoot":"","sources":["../../../src/commands/protein-impact/numbering.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,cAAe,SAAQ,KAAK;CAAG;AAW5C,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAsBvD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,GAAE,OAAO,GAAG,KAAe,GAAG,MAAM,CAIvF;AAED,4DAA4D;AAC5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED,4DAA4D;AAC5D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAOlE;AAED,wGAAwG;AACxG,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CASvE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQnF"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Residue numbering for protein-impact.
|
|
4
|
+
*
|
|
5
|
+
* HGVS protein positions count from the precursor Met. The GT literature and the PDB entries use the
|
|
6
|
+
* mature chain, so every literature or structure comparison must convert first:
|
|
7
|
+
* ITGA2B (P08514): signal 1..31, mature = HGVS - 31 (Val779 = 748, Leu225 = 194, Asn2 = 33)
|
|
8
|
+
* ITGB3 (P05106): signal 1..26, mature = HGVS - 26 (ONE global offset would corrupt ITGB3 rows)
|
|
9
|
+
* `structureOffset` derives the offset of a structure chain from its own sequence instead of assuming it.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.NumberingError = void 0;
|
|
13
|
+
exports.parseVariant = parseVariant;
|
|
14
|
+
exports.formatVariant = formatVariant;
|
|
15
|
+
exports.toMature = toMature;
|
|
16
|
+
exports.fromMature = fromMature;
|
|
17
|
+
exports.assertResidue = assertResidue;
|
|
18
|
+
exports.structureOffset = structureOffset;
|
|
19
|
+
const constants_1 = require("./constants");
|
|
20
|
+
class NumberingError extends Error {
|
|
21
|
+
}
|
|
22
|
+
exports.NumberingError = NumberingError;
|
|
23
|
+
const THREE = /^p\.([A-Z][a-z]{2})(\d+)([A-Z][a-z]{2})$/;
|
|
24
|
+
const ONE = /^p?\.?([A-Z])(\d+)([A-Z])$/;
|
|
25
|
+
function geneSpec(gene) {
|
|
26
|
+
const g = constants_1.GENES[gene.toUpperCase()];
|
|
27
|
+
if (!g)
|
|
28
|
+
throw new NumberingError(`gene not supported: ${gene} (supported: ${Object.keys(constants_1.GENES).join(', ')})`);
|
|
29
|
+
return g;
|
|
30
|
+
}
|
|
31
|
+
/** Parse `ITGA2B:p.Leu225Arg`, `ITGA2B:p.L225R` or `ITGA2B:L225R`. Missense only. */
|
|
32
|
+
function parseVariant(spec) {
|
|
33
|
+
const s = (spec || '').trim();
|
|
34
|
+
const colon = s.indexOf(':');
|
|
35
|
+
if (colon < 1)
|
|
36
|
+
throw new NumberingError(`variant must look like GENE:p.Leu225Arg, got "${spec}"`);
|
|
37
|
+
const g = geneSpec(s.slice(0, colon));
|
|
38
|
+
const rest = s.slice(colon + 1).trim();
|
|
39
|
+
let ref, pos, alt;
|
|
40
|
+
const m3 = THREE.exec(rest);
|
|
41
|
+
if (m3) {
|
|
42
|
+
ref = constants_1.AA3_TO_1[m3[1]];
|
|
43
|
+
alt = constants_1.AA3_TO_1[m3[3]];
|
|
44
|
+
pos = parseInt(m3[2], 10);
|
|
45
|
+
if (!ref || !alt)
|
|
46
|
+
throw new NumberingError(`only missense substitutions are accepted (both residues must be standard amino acids; no stop, Ter or Sec): ${rest}`);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const m1 = ONE.exec(rest);
|
|
50
|
+
if (!m1)
|
|
51
|
+
throw new NumberingError(`only missense substitutions are accepted (no stop, frameshift, deletion or synonymous): ${rest}`);
|
|
52
|
+
ref = m1[1];
|
|
53
|
+
pos = parseInt(m1[2], 10);
|
|
54
|
+
alt = m1[3];
|
|
55
|
+
}
|
|
56
|
+
if (!constants_1.STANDARD_AA.includes(ref) || !constants_1.STANDARD_AA.includes(alt))
|
|
57
|
+
throw new NumberingError(`non-standard residue in ${rest}`);
|
|
58
|
+
if (ref === alt)
|
|
59
|
+
throw new NumberingError(`reference and alternate residue are identical: ${rest}`);
|
|
60
|
+
if (!Number.isInteger(pos) || pos <= g.signal || pos > g.length) {
|
|
61
|
+
throw new NumberingError(`position ${pos} is outside ${g.gene} mature protein (${g.signal + 1}..${g.length}, HGVS numbering)`);
|
|
62
|
+
}
|
|
63
|
+
return { gene: g.gene, ref, pos, alt };
|
|
64
|
+
}
|
|
65
|
+
function formatVariant(s, style = 'three') {
|
|
66
|
+
return style === 'three'
|
|
67
|
+
? `${s.gene}:p.${constants_1.AA1_TO_3[s.ref]}${s.pos}${constants_1.AA1_TO_3[s.alt]}`
|
|
68
|
+
: `${s.gene}:p.${s.ref}${s.pos}${s.alt}`;
|
|
69
|
+
}
|
|
70
|
+
/** HGVS (precursor) -> classical mature-chain numbering. */
|
|
71
|
+
function toMature(gene, hgvsPos) {
|
|
72
|
+
const g = geneSpec(gene);
|
|
73
|
+
if (!Number.isInteger(hgvsPos) || hgvsPos <= g.signal || hgvsPos > g.length) {
|
|
74
|
+
throw new NumberingError(`${g.gene} position ${hgvsPos} is not in the mature chain`);
|
|
75
|
+
}
|
|
76
|
+
return hgvsPos - g.signal;
|
|
77
|
+
}
|
|
78
|
+
/** Classical mature-chain numbering -> HGVS (precursor). */
|
|
79
|
+
function fromMature(gene, maturePos) {
|
|
80
|
+
const g = geneSpec(gene);
|
|
81
|
+
const hgvs = maturePos + g.signal;
|
|
82
|
+
if (!Number.isInteger(maturePos) || maturePos < 1 || hgvs > g.length) {
|
|
83
|
+
throw new NumberingError(`${g.gene} mature position ${maturePos} is out of range`);
|
|
84
|
+
}
|
|
85
|
+
return hgvs;
|
|
86
|
+
}
|
|
87
|
+
/** Throw unless the pinned UniProt sequence has the stated reference residue at the stated position. */
|
|
88
|
+
function assertResidue(sub, sequence) {
|
|
89
|
+
const g = geneSpec(sub.gene);
|
|
90
|
+
if (sequence.length !== g.length) {
|
|
91
|
+
throw new NumberingError(`${g.gene} sequence has ${sequence.length} residues, expected ${g.length} (wrong UniProt release or isoform)`);
|
|
92
|
+
}
|
|
93
|
+
const found = sequence[sub.pos - 1];
|
|
94
|
+
if (found !== sub.ref) {
|
|
95
|
+
throw new NumberingError(`${formatVariant(sub)}: the reference sequence has ${found} (${constants_1.AA1_TO_3[found] || '?'}) at ${sub.pos}, not ${sub.ref}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Offset between HGVS numbering and a structure chain: position_in_structure = hgvsPos - offset.
|
|
100
|
+
* Found by locating the chain's own sequence inside the UniProt sequence (first 12 residues as the
|
|
101
|
+
* anchor, then verified over the first 50), never assumed. Returns null when it cannot be anchored.
|
|
102
|
+
*/
|
|
103
|
+
function structureOffset(uniprotSeq, chainSeq) {
|
|
104
|
+
const anchor = chainSeq.slice(0, 12);
|
|
105
|
+
if (anchor.length < 12)
|
|
106
|
+
return null;
|
|
107
|
+
const first = uniprotSeq.indexOf(anchor);
|
|
108
|
+
if (first < 0 || uniprotSeq.indexOf(anchor, first + 1) >= 0)
|
|
109
|
+
return null;
|
|
110
|
+
const n = Math.min(50, chainSeq.length, uniprotSeq.length - first);
|
|
111
|
+
if (uniprotSeq.slice(first, first + n) !== chainSeq.slice(0, n))
|
|
112
|
+
return null;
|
|
113
|
+
return first; // structure residue 1 is UniProt first + 1, so offset = first
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=numbering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbering.js","sourceRoot":"","sources":["../../../src/commands/protein-impact/numbering.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAuBH,oCAsBC;AAED,sCAIC;AAGD,4BAMC;AAGD,gCAOC;AAGD,sCASC;AAOD,0CAQC;AA/FD,2CAAqE;AASrE,MAAa,cAAe,SAAQ,KAAK;CAAG;AAA5C,wCAA4C;AAE5C,MAAM,KAAK,GAAG,0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;IAC7E,OAAO,KAAK,CAAC,CAAC,8DAA8D;AAC9E,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commander wiring for `biofs protein-impact`. Kept out of index.ts so the verb is one import and one call.
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
export declare function registerProteinImpact(program: Command): void;
|
|
6
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/protein-impact/register.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4F5D"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Commander wiring for `biofs protein-impact`. Kept out of index.ts so the verb is one import and one call.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerProteinImpact = registerProteinImpact;
|
|
7
|
+
const logger_1 = require("../../lib/utils/logger");
|
|
8
|
+
const exec_1 = require("./exec");
|
|
9
|
+
const submit_1 = require("./submit");
|
|
10
|
+
const collect = (v, prev) => [...(prev || []), v];
|
|
11
|
+
function registerProteinImpact(program) {
|
|
12
|
+
const cmd = program
|
|
13
|
+
.command('protein-impact')
|
|
14
|
+
.description('Protein-level impact of KNOWN missense substitutions in ITGA2B and ITGB3 (research-grade analysis; it cannot design anything)');
|
|
15
|
+
cmd
|
|
16
|
+
.command('fetch')
|
|
17
|
+
.description('Fetch and pin the UniProt reference sequences (public data only)')
|
|
18
|
+
.option('--genes <csv>', 'Genes to fetch', 'ITGA2B,ITGB3')
|
|
19
|
+
.option('--json', 'Output as JSON')
|
|
20
|
+
.action(async (options) => {
|
|
21
|
+
try {
|
|
22
|
+
await (0, submit_1.fetchCommand)(options);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
logger_1.Logger.error(`protein-impact fetch failed: ${error}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
cmd
|
|
30
|
+
.command('validate')
|
|
31
|
+
.description('Score the public benchmark (known pathogenic and benign missense changes) and write the gate document; public data only')
|
|
32
|
+
.option('--genes <csv>', 'Genes to validate', 'ITGA2B,ITGB3')
|
|
33
|
+
.option('--layers <csv>', 'Scoring layers to rank: plm (more with structure)', 'plm')
|
|
34
|
+
.option('--estimate', 'Print the price and the estimate id, and submit nothing')
|
|
35
|
+
.option('--approve <estimate_id>', 'Estimate id printed by --estimate (GPU layers only)')
|
|
36
|
+
.option('--max-usd <n>', 'Most you approve to spend on this job (GPU layers only)')
|
|
37
|
+
.option('--json', 'Output as JSON')
|
|
38
|
+
.action(async (options) => {
|
|
39
|
+
try {
|
|
40
|
+
await (0, submit_1.validateCommand)(options);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
logger_1.Logger.error(`protein-impact validate failed: ${error}`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
cmd
|
|
48
|
+
.command('apply <serial>')
|
|
49
|
+
.description('Score variants a sample carries. Needs a passing, signed gate; GPU layers need --approve after --estimate')
|
|
50
|
+
.option('--variant <hgvs>', 'Variant as GENE:p.Leu225Arg (repeat for several)', collect, [])
|
|
51
|
+
.option('--source <biocid>', 'Biocid the variants were read from (repeat for several)', collect, [])
|
|
52
|
+
.requiredOption('--gate-file <path>', 'Signed gate document (from `gate-sign`)')
|
|
53
|
+
.option('--layers <csv>', 'Layers to run: fetch,features,plm,structure,complex,probe,md', 'features')
|
|
54
|
+
.option('--estimate', 'Print the price and the estimate id, and submit nothing')
|
|
55
|
+
.option('--approve <estimate_id>', 'Estimate id printed by --estimate (GPU layers)')
|
|
56
|
+
.option('--max-usd <n>', 'Most you approve to spend on this job (GPU layers)')
|
|
57
|
+
.option('--diagnosis-assumption <text>', 'Recorded in the manifest, e.g. GT/ITGA2B')
|
|
58
|
+
.option('--json', 'Output as JSON')
|
|
59
|
+
.action(async (serial, options) => {
|
|
60
|
+
try {
|
|
61
|
+
await (0, submit_1.applyCommand)(serial, options);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
logger_1.Logger.error(`protein-impact apply failed: ${error}`);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
cmd
|
|
69
|
+
.command('probe')
|
|
70
|
+
.description('Measure peak GPU memory of the full ITGA2B plus ITGB3 complex on the wild-type sequences (public data only; GPU)')
|
|
71
|
+
.option('--genes <csv>', 'Genes in the complex', 'ITGA2B,ITGB3')
|
|
72
|
+
.option('--estimate', 'Print the price and the estimate id, and submit nothing')
|
|
73
|
+
.option('--approve <estimate_id>', 'Estimate id printed by --estimate')
|
|
74
|
+
.option('--max-usd <n>', 'Most you approve to spend on this job')
|
|
75
|
+
.option('--json', 'Output as JSON')
|
|
76
|
+
.action(async (options) => {
|
|
77
|
+
try {
|
|
78
|
+
await (0, submit_1.probeCommand)(options);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
logger_1.Logger.error(`protein-impact probe failed: ${error}`);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
cmd
|
|
86
|
+
.command('gate-sign <file>')
|
|
87
|
+
.description('Review a passing gate document and sign it as the operator (writes <file>.signed.json and prints its gate id)')
|
|
88
|
+
.option('--yes', 'Sign after reviewing the numbers')
|
|
89
|
+
.option('--out <path>', 'Where to write the signed document')
|
|
90
|
+
.action(async (file, options) => {
|
|
91
|
+
try {
|
|
92
|
+
await (0, submit_1.gateSignCommand)(file, options);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
logger_1.Logger.error(`protein-impact gate-sign failed: ${error}`);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
cmd
|
|
100
|
+
.command('results <jobId>')
|
|
101
|
+
.description('Fetch the manifest of a finished job, then file it with `biofs register-derived`')
|
|
102
|
+
.option('--out <path>', 'Where to save the manifest')
|
|
103
|
+
.option('--json', 'Output as JSON')
|
|
104
|
+
.action(async (jobId, options) => {
|
|
105
|
+
try {
|
|
106
|
+
await (0, submit_1.resultsCommand)(jobId, options);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
logger_1.Logger.error(`protein-impact results failed: ${error}`);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
cmd
|
|
114
|
+
.command('exec')
|
|
115
|
+
.description('VM-side executor (spawned by biofs-node): re-checks guard, approval and gate, runs the stages, writes the manifest')
|
|
116
|
+
.option('--sample <serial>', 'Biosample serial (public for public modes)')
|
|
117
|
+
.option('--ref <ref>', 'Reference (accepted for the spawner, unused)')
|
|
118
|
+
.option('--job-id <id>', 'Job id')
|
|
119
|
+
.option('--batch-id <id>', 'Batch id')
|
|
120
|
+
.option('--creator <wallet>', 'Creator wallet (lowercased for the GCS path)')
|
|
121
|
+
.option('--out-bucket <name>', 'Output bucket', 'genobank-parabricks-output')
|
|
122
|
+
.option('--ref-bucket <name>', 'Reference bucket', 'genobank-references')
|
|
123
|
+
.option('--request-b64 <b64>', 'The request JSON, base64')
|
|
124
|
+
.option('--request-file <path>', 'The request JSON file')
|
|
125
|
+
.option('--gate-b64 <b64>', 'The gate document JSON, base64 (apply)')
|
|
126
|
+
.option('--gate-file <path>', 'The gate document JSON file (apply)')
|
|
127
|
+
.option('--work-dir <path>', 'Scratch directory')
|
|
128
|
+
.option('--local-root <path>', 'Dry run: map gs:// paths into this local directory')
|
|
129
|
+
.action(async (options) => {
|
|
130
|
+
try {
|
|
131
|
+
await (0, exec_1.proteinImpactExecCommand)(options);
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
logger_1.Logger.error(`protein-impact exec failed: ${error}`);
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/commands/protein-impact/register.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAYH,sDA4FC;AArGD,mDAAgD;AAChD,iCAA4E;AAC5E,qCAGkB;AAElB,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,IAAc,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAEpE,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,+HAA+H,CAAC,CAAC;IAEhJ,GAAG;SACA,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,kEAAkE,CAAC;SAC/E,MAAM,CAAC,eAAe,EAAE,gBAAgB,EAAE,cAAc,CAAC;SACzD,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,KAAK,EAAE,OAAqB,EAAE,EAAE;QACtC,IAAI,CAAC;YAAC,MAAM,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,eAAM,CAAC,KAAK,CAAC,gCAAgC,KAAK,EAAE,CAAC,CAAC;YAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAAC,CAAC;IAChI,CAAC,CAAC,CAAC;IAEL,GAAG;SACA,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,yHAAyH,CAAC;SACtI,MAAM,CAAC,eAAe,EAAE,mBAAmB,EAAE,cAAc,CAA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E,mBAAmB,CAAC;SAChD,MAAM,CAAC,qBAAqB,EAAE,oDAAoD,CAAC;SACnF,MAAM,CAAC,KAAK,EAAE,OAAiC,EAAE,EAAE;QAClD,IAAI,CAAC;YAAC,MAAM,IAAA,+BAAwB,EAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,eAAM,CAAC,KAAK,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAC;YAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAAC,CAAC;IAC3I,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical JSON, request hash and job id for protein-impact. An identical request always yields the
|
|
3
|
+
* same hash and job id, so a rerun finds its per-stage cache and does zero compute.
|
|
4
|
+
*/
|
|
5
|
+
import { ProteinImpactRequest } from './guard';
|
|
6
|
+
export declare function canonicalJson(v: unknown): string;
|
|
7
|
+
export declare function sha256Hex(s: string | Buffer): string;
|
|
8
|
+
/**
|
|
9
|
+
* The approval block never enters the hash: approving a GPU estimate must not change which job it is.
|
|
10
|
+
* Substitutions and genes are sorted so order does not matter.
|
|
11
|
+
*/
|
|
12
|
+
export declare function requestHash(req: ProteinImpactRequest): string;
|
|
13
|
+
export declare function jobIdFor(req: ProteinImpactRequest): string;
|
|
14
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/commands/protein-impact/request.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAOhD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAEpD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,oBAAoB,GAAG,MAAM,CAQ7D;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,MAAM,CAE1D"}
|