@genobank/biofs 3.21.1 → 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-delegate/index.d.ts +28 -0
- package/dist/commands/inventory-delegate/index.d.ts.map +1 -0
- package/dist/commands/inventory-delegate/index.js +171 -0
- package/dist/commands/inventory-delegate/index.js.map +1 -0
- package/dist/commands/inventory-list/index.d.ts +33 -0
- package/dist/commands/inventory-list/index.d.ts.map +1 -0
- package/dist/commands/inventory-list/index.js +74 -0
- package/dist/commands/inventory-list/index.js.map +1 -0
- package/dist/commands/inventory-register/index.d.ts +8 -0
- package/dist/commands/inventory-register/index.d.ts.map +1 -0
- package/dist/commands/inventory-register/index.js +57 -0
- package/dist/commands/inventory-register/index.js.map +1 -0
- 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/job-view/index.d.ts +15 -0
- package/dist/commands/job-view/index.d.ts.map +1 -0
- package/dist/commands/job-view/index.js +88 -0
- package/dist/commands/job-view/index.js.map +1 -0
- 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 +180 -2
- package/dist/commands/neoantigen-pipeline/index.d.ts.map +1 -1
- package/dist/commands/neoantigen-pipeline/index.js +520 -2
- 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 +85 -0
- package/dist/commands/parabricks/index.d.ts.map +1 -0
- package/dist/commands/parabricks/index.js +350 -0
- package/dist/commands/parabricks/index.js.map +1 -0
- package/dist/commands/parabricks/registry.json +15202 -0
- 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/whoami.d.ts +1 -0
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +20 -0
- package/dist/commands/whoami.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 +944 -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/dist/lib/utils/node_roles.d.ts +16 -0
- package/dist/lib/utils/node_roles.d.ts.map +1 -0
- package/dist/lib/utils/node_roles.js +34 -0
- package/dist/lib/utils/node_roles.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SYN_RE = exports.GENE_RE = exports.HLA_RE = exports.BIOCID_RE = void 0;
|
|
39
|
+
exports.HPO_RELEASES = exports.SYN_RE = exports.GENE_RE = exports.HLA_RE = exports.BIOCID_RE = void 0;
|
|
7
40
|
exports.requireBiocid = requireBiocid;
|
|
8
41
|
exports.parseHla = parseHla;
|
|
9
42
|
exports.parseWeights = parseWeights;
|
|
@@ -23,6 +56,7 @@ exports.parseSynId = parseSynId;
|
|
|
23
56
|
exports.parseSynIds = parseSynIds;
|
|
24
57
|
exports.parseSuffixes = parseSuffixes;
|
|
25
58
|
exports.buildSynapseBody = buildSynapseBody;
|
|
59
|
+
exports.buildPublicFetchBody = buildPublicFetchBody;
|
|
26
60
|
exports.parseSha256 = parseSha256;
|
|
27
61
|
exports.parseFeatures = parseFeatures;
|
|
28
62
|
exports.buildTeslaGateBody = buildTeslaGateBody;
|
|
@@ -33,8 +67,31 @@ exports.neoantigenHlaSubmitCommand = neoantigenHlaSubmitCommand;
|
|
|
33
67
|
exports.neoantigenFusionSubmitCommand = neoantigenFusionSubmitCommand;
|
|
34
68
|
exports.neoantigenIndelSubmitCommand = neoantigenIndelSubmitCommand;
|
|
35
69
|
exports.synapsePullSubmitCommand = synapsePullSubmitCommand;
|
|
70
|
+
exports.publicFetchSubmitCommand = publicFetchSubmitCommand;
|
|
71
|
+
exports.parseSamples = parseSamples;
|
|
72
|
+
exports.buildIdentityBody = buildIdentityBody;
|
|
73
|
+
exports.identitySubmitCommand = identitySubmitCommand;
|
|
74
|
+
exports.parseDesignBiocids = parseDesignBiocids;
|
|
75
|
+
exports.buildCaptureBody = buildCaptureBody;
|
|
76
|
+
exports.captureSubmitCommand = captureSubmitCommand;
|
|
77
|
+
exports.buildAcmgBody = buildAcmgBody;
|
|
78
|
+
exports.acmgSubmitCommand = acmgSubmitCommand;
|
|
79
|
+
exports.buildVcfCompareBody = buildVcfCompareBody;
|
|
80
|
+
exports.vcfCompareSubmitCommand = vcfCompareSubmitCommand;
|
|
81
|
+
exports.buildRefIndexBody = buildRefIndexBody;
|
|
82
|
+
exports.refIndexSubmitCommand = refIndexSubmitCommand;
|
|
83
|
+
exports.buildTwinBody = buildTwinBody;
|
|
84
|
+
exports.twinClassifySubmitCommand = twinClassifySubmitCommand;
|
|
85
|
+
exports.buildWindowsBody = buildWindowsBody;
|
|
86
|
+
exports.windowsSubmitCommand = windowsSubmitCommand;
|
|
87
|
+
exports.parsePeptidesTsv = parsePeptidesTsv;
|
|
88
|
+
exports.peptidesSha256 = peptidesSha256;
|
|
89
|
+
exports.buildRescoreBody = buildRescoreBody;
|
|
90
|
+
exports.rescoreSubmitCommand = rescoreSubmitCommand;
|
|
36
91
|
exports.teslaGateSubmitCommand = teslaGateSubmitCommand;
|
|
92
|
+
exports.parabricksSubmit = parabricksSubmit;
|
|
37
93
|
exports.neoantigenStatusCommand = neoantigenStatusCommand;
|
|
94
|
+
exports.submitKindCommand = submitKindCommand;
|
|
38
95
|
/**
|
|
39
96
|
* biofs neoantigen-evidence submit <caseId> --somatic-sqlite <biocid> --filtered-vcf <biocid> --tumor <biocid> --normal <biocid> [--second-dna <biocid>] [--rna <biocid>] [--tpm <biocid>]
|
|
40
97
|
* biofs neoantigen-evidence status <job> [--wait]
|
|
@@ -43,6 +100,7 @@ exports.neoantigenStatusCommand = neoantigenStatusCommand;
|
|
|
43
100
|
* biofs neoantigen-fusion submit <caseId> --fusion-evidence <biocid> --five-gene <symbol> --three-gene <symbol> (--hla <alleles> | --hla-from <biocid>) [--min-templates 10]
|
|
44
101
|
* biofs neoantigen-indel submit <caseId> --somatic-sqlite <biocid> (--hla <alleles> | --hla-from <biocid>) [--tpm <biocid>] [--rna <biocid>] [--min-alt 8] [--genes TGFBR2,...]
|
|
45
102
|
* biofs synapse-pull submit <caseId> (--entities syn1,syn2 | --folder syn123 [--suffixes .fastq.gz,.bam]) [--project syn123] [--list-only] --access-basis "<approval>" [--max-total-bytes N]
|
|
103
|
+
* biofs identity-concordance submit <caseId> --sample label=<gvcf biocid> ... --code-sha256 <hex> --protocol-sha256 <hex> --ledger-record <n> are these samples the same individual (decision support)
|
|
46
104
|
* biofs tesla-gate submit <caseId> --outcomes <biocid> --features 1=<biocid> 2=<biocid> ... --code-sha256 <hex> --protocol-sha256 <hex> --ledger-record <n> [--selftest]
|
|
47
105
|
* every submit verb takes [--executor auto|worker|local]: auto (default) runs on a healthy neoantigen worker agent and otherwise on the node, worker never falls back, local never uses a worker.
|
|
48
106
|
* biofs neoantigen-design status <job> [--wait]
|
|
@@ -60,8 +118,11 @@ exports.neoantigenStatusCommand = neoantigenStatusCommand;
|
|
|
60
118
|
* Decision support for a human review, never a clinical device. Server routes: POST /neoantigen_evidence, _hla, _design, _fusion, _indel; GET the same names with _status.
|
|
61
119
|
*/
|
|
62
120
|
const axios_1 = __importDefault(require("axios"));
|
|
121
|
+
const fs = __importStar(require("fs"));
|
|
122
|
+
const crypto_1 = require("crypto");
|
|
63
123
|
const chalk_1 = __importDefault(require("chalk"));
|
|
64
124
|
const credentials_1 = require("../../lib/auth/credentials");
|
|
125
|
+
const node_roles_1 = require("../../lib/utils/node_roles");
|
|
65
126
|
const logger_1 = require("../../lib/utils/logger");
|
|
66
127
|
const BIOFS_NODE_BASE = process.env.BIOFS_NODE_URL
|
|
67
128
|
|| `${process.env.GENOBANK_API_URL || 'https://genobank.app'}/api_biofs_node`;
|
|
@@ -284,6 +345,31 @@ function buildSynapseBody(caseId, o, wallet, signature) {
|
|
|
284
345
|
}
|
|
285
346
|
return body;
|
|
286
347
|
}
|
|
348
|
+
/** biofs public-fetch: a PUBLIC ENA paired FASTQ run onto a governed worker. The body names an accession and nothing that names a place (no URL, no host): the worker asks the archive. */
|
|
349
|
+
function buildPublicFetchBody(caseId, o, wallet, signature) {
|
|
350
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
351
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or - (never a person name)');
|
|
352
|
+
const acc = (o.accession || '').trim();
|
|
353
|
+
if (!/^[SED]RR[0-9]{6,9}$/.test(acc))
|
|
354
|
+
throw new Error('--accession must be an ENA run accession like SRR1234567');
|
|
355
|
+
const body = { wallet: ownerOr(o.owner, wallet), signature, case_id: caseId, executor: 'worker', accession: acc };
|
|
356
|
+
if (o.outName) {
|
|
357
|
+
if (!/^[A-Za-z][A-Za-z0-9_-]{0,40}$/.test(o.outName))
|
|
358
|
+
throw new Error('--out-name must be letters, digits, _ or -, starting with a letter, up to 41 characters');
|
|
359
|
+
body.out_name = o.outName;
|
|
360
|
+
}
|
|
361
|
+
if (o.pairs !== undefined && o.pairs !== '') {
|
|
362
|
+
const n = Number(o.pairs);
|
|
363
|
+
if (!Number.isInteger(n) || n < 1000 || n > 50000000)
|
|
364
|
+
throw new Error('--pairs must be an integer from 1000 to 50000000');
|
|
365
|
+
body.subsample_pairs = n;
|
|
366
|
+
}
|
|
367
|
+
const cap = Number(o.maxTotalBytes);
|
|
368
|
+
if (o.maxTotalBytes === undefined || o.maxTotalBytes === '' || !Number.isInteger(cap) || cap < 1 || cap > 2e12)
|
|
369
|
+
throw new Error('--max-total-bytes is required: a positive integer up to 2000000000000 (the download is refused above it)');
|
|
370
|
+
body.max_total_bytes = cap;
|
|
371
|
+
return body;
|
|
372
|
+
}
|
|
287
373
|
function parseSha256(flag, v) {
|
|
288
374
|
const x = (v || '').trim().toLowerCase();
|
|
289
375
|
if (!/^[0-9a-f]{64}$/.test(x))
|
|
@@ -346,6 +432,17 @@ const ROUTE = {
|
|
|
346
432
|
indel: { post: 'neoantigen_indel', status: 'neoantigen_indel_status', id: 'neoantigen_job_id', verb: 'neoantigen-indel' },
|
|
347
433
|
synapse: { post: 'neoantigen_synapse', status: 'neoantigen_synapse_status', id: 'neoantigen_job_id', verb: 'synapse-pull' },
|
|
348
434
|
tesla_gate: { post: 'neoantigen_tesla_gate', status: 'neoantigen_tesla_gate_status', id: 'neoantigen_job_id', verb: 'tesla-gate' },
|
|
435
|
+
parabricks: { post: 'neoantigen_parabricks', status: 'neoantigen_parabricks_status', id: 'neoantigen_job_id', verb: 'pbrun' },
|
|
436
|
+
public_fetch: { post: 'neoantigen_public_fetch', status: 'neoantigen_public_fetch_status', id: 'neoantigen_job_id', verb: 'public-fetch' },
|
|
437
|
+
identity: { post: 'neoantigen_identity', status: 'neoantigen_identity_status', id: 'neoantigen_job_id', verb: 'identity-concordance' },
|
|
438
|
+
capture: { post: 'neoantigen_capture', status: 'neoantigen_capture_status', id: 'neoantigen_job_id', verb: 'capture-compare' },
|
|
439
|
+
windows: { post: 'neoantigen_windows', status: 'neoantigen_windows_status', id: 'neoantigen_job_id', verb: 'windows-geometry' },
|
|
440
|
+
rescore: { post: 'neoantigen_rescore', status: 'neoantigen_rescore_status', id: 'neoantigen_job_id', verb: 'rescore' },
|
|
441
|
+
acmg: { post: 'neoantigen_acmg', status: 'neoantigen_acmg_status', id: 'neoantigen_job_id', verb: 'acmg-triage' },
|
|
442
|
+
refindex: { post: 'neoantigen_refindex', status: 'neoantigen_refindex_status', id: 'neoantigen_job_id', verb: 'reference-index' },
|
|
443
|
+
vcfcompare: { post: 'neoantigen_vcfcompare', status: 'neoantigen_vcfcompare_status', id: 'neoantigen_job_id', verb: 'vcf-compare' },
|
|
444
|
+
alphagenome: { post: 'neoantigen_alphagenome', status: 'neoantigen_alphagenome_status', id: 'neoantigen_job_id', verb: 'alphagenome' },
|
|
445
|
+
twin: { post: 'neoantigen_twin', status: 'neoantigen_twin_status', id: 'neoantigen_job_id', verb: 'twin' },
|
|
349
446
|
};
|
|
350
447
|
async function fetchStatus(kind, id, headers) {
|
|
351
448
|
const r = await axios_1.default.get(`${BIOFS_NODE_BASE}/${ROUTE[kind].status}`, {
|
|
@@ -403,7 +500,7 @@ async function waitFor(kind, id, headers, json) {
|
|
|
403
500
|
async function submit(kind, body, headers, opts) {
|
|
404
501
|
const r = await axios_1.default.post(`${BIOFS_NODE_BASE}/${ROUTE[kind].post}`, body, { headers, timeout: 60000, validateStatus: (s) => s < 500 });
|
|
405
502
|
if (r.status >= 400)
|
|
406
|
-
throw new Error(
|
|
503
|
+
throw new Error((0, node_roles_1.nodeErrorMessage)(r.status, r.data?.error, typeof body.wallet === 'string' ? body.wallet : undefined));
|
|
407
504
|
const id = r.data[ROUTE[kind].id];
|
|
408
505
|
if (!opts.wait) {
|
|
409
506
|
if (opts.json)
|
|
@@ -476,6 +573,411 @@ async function synapsePullSubmitCommand(caseId, options) {
|
|
|
476
573
|
process.exit(1);
|
|
477
574
|
}
|
|
478
575
|
}
|
|
576
|
+
async function publicFetchSubmitCommand(caseId, options) {
|
|
577
|
+
try {
|
|
578
|
+
const a = await auth();
|
|
579
|
+
await submit('public_fetch', buildPublicFetchBody(caseId, options, a.wallet, a.signature), a.headers, options);
|
|
580
|
+
}
|
|
581
|
+
catch (e) {
|
|
582
|
+
logger_1.Logger.error(`public-fetch submit failed: ${e.message}`);
|
|
583
|
+
process.exit(1);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
/** label=biocid entries, 2 to 8, labels of letters, digits, _ and - (never a person name), no biocid twice. */
|
|
587
|
+
function parseSamples(items) {
|
|
588
|
+
const raw = [].concat(items || []).flatMap((x) => String(x).split(/,(?=[A-Za-z0-9_-]{1,32}=)/)).map((x) => x.trim()).filter(Boolean);
|
|
589
|
+
if (raw.length < 2 || raw.length > 8)
|
|
590
|
+
throw new Error('--sample needs 2 to 8 entries of label=biocid, for example L13972=biocid://genobank/0x.../gvcf/neo-....g.vcf.gz');
|
|
591
|
+
const out = {};
|
|
592
|
+
const seen = new Set();
|
|
593
|
+
for (const r of raw) {
|
|
594
|
+
const i = r.indexOf('=');
|
|
595
|
+
const id = r.slice(0, i);
|
|
596
|
+
if (i < 1 || !/^[A-Za-z0-9_-]{1,32}$/.test(id))
|
|
597
|
+
throw new Error(`--sample entry "${r}" is not label=biocid (letters, digits, _ and - only)`);
|
|
598
|
+
if (out[id])
|
|
599
|
+
throw new Error(`--sample names label ${id} twice`);
|
|
600
|
+
const b = requireBiocid(`--sample ${id}`, r.slice(i + 1));
|
|
601
|
+
if (seen.has(b.toLowerCase()))
|
|
602
|
+
throw new Error(`--sample lists the same biocid twice (${id})`);
|
|
603
|
+
seen.add(b.toLowerCase());
|
|
604
|
+
out[id] = b;
|
|
605
|
+
}
|
|
606
|
+
return out;
|
|
607
|
+
}
|
|
608
|
+
/** Are these samples the same individual? The registered identity protocol: the code hash, protocol hash and ledger record must be the frozen ones; the worker refuses code that differs. */
|
|
609
|
+
function buildIdentityBody(caseId, o, wallet, signature) {
|
|
610
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
611
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or - (never a person name)');
|
|
612
|
+
const rec = Number(o.ledgerRecord);
|
|
613
|
+
if (!Number.isInteger(rec) || rec < 1)
|
|
614
|
+
throw new Error('--ledger-record must be the pre-registration ledger record number');
|
|
615
|
+
const num = (name, v, lo, hi, def) => {
|
|
616
|
+
const n = v === undefined ? def : Number(v);
|
|
617
|
+
if (!Number.isInteger(n) || n < lo || n > hi)
|
|
618
|
+
throw new Error(`${name} must be an integer from ${lo} to ${hi}`);
|
|
619
|
+
return n;
|
|
620
|
+
};
|
|
621
|
+
return {
|
|
622
|
+
wallet: ownerOr(o.owner, wallet), signature, case_id: caseId,
|
|
623
|
+
samples_biocids: parseSamples(o.sample),
|
|
624
|
+
min_depth: num('--min-depth', o.minDepth, 1, 200, 10), min_gq: num('--min-gq', o.minGq, 0, 99, 20),
|
|
625
|
+
code_sha256: parseSha256('--code-sha256', o.codeSha256),
|
|
626
|
+
protocol_sha256: parseSha256('--protocol-sha256', o.protocolSha256),
|
|
627
|
+
ledger_record: rec,
|
|
628
|
+
executor: parseExecutor(o.executor),
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
async function identitySubmitCommand(caseId, options) {
|
|
632
|
+
try {
|
|
633
|
+
const a = await auth();
|
|
634
|
+
await submit('identity', buildIdentityBody(caseId, options, a.wallet, a.signature), a.headers, options);
|
|
635
|
+
}
|
|
636
|
+
catch (e) {
|
|
637
|
+
logger_1.Logger.error(`identity-concordance submit failed: ${e.message}`);
|
|
638
|
+
process.exit(1);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
/** label=biocid entries for BED designs (labels of letters, digits, _ and -). */
|
|
642
|
+
function parseDesignBiocids(items) {
|
|
643
|
+
const raw = [].concat(items || []).map((x) => String(x).trim()).filter(Boolean);
|
|
644
|
+
const out = {};
|
|
645
|
+
for (const r of raw) {
|
|
646
|
+
const i = r.indexOf('=');
|
|
647
|
+
const id = r.slice(0, i);
|
|
648
|
+
if (i < 1 || !/^[A-Za-z0-9_-]{1,32}$/.test(id))
|
|
649
|
+
throw new Error(`--design-biocid entry "${r}" is not label=biocid (letters, digits, _ and - only)`);
|
|
650
|
+
if (out[id])
|
|
651
|
+
throw new Error(`--design-biocid names label ${id} twice`);
|
|
652
|
+
out[id] = requireBiocid(`--design-biocid ${id}`, r.slice(i + 1));
|
|
653
|
+
}
|
|
654
|
+
return out;
|
|
655
|
+
}
|
|
656
|
+
/** Which capture design does this alignment come from? The registered protocol capture_compare_v1: the code hash, protocol hash and ledger record must be the frozen ones. */
|
|
657
|
+
function buildCaptureBody(caseId, o, wallet, signature) {
|
|
658
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
659
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or - (never a person name)');
|
|
660
|
+
const rec = Number(o.ledgerRecord);
|
|
661
|
+
if (!Number.isInteger(rec) || rec < 1)
|
|
662
|
+
throw new Error('--ledger-record must be the pre-registration ledger record number');
|
|
663
|
+
const designs = [].concat(o.design || []).flatMap((x) => String(x).split(',')).map((x) => x.trim()).filter(Boolean);
|
|
664
|
+
for (const d of designs)
|
|
665
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$/.test(d))
|
|
666
|
+
throw new Error(`--design ${d} is not a catalog design name`);
|
|
667
|
+
if (new Set(designs).size !== designs.length)
|
|
668
|
+
throw new Error('--design lists a name twice');
|
|
669
|
+
const db = parseDesignBiocids(o.designBiocid);
|
|
670
|
+
if (designs.length + Object.keys(db).length < 1)
|
|
671
|
+
throw new Error('give at least one candidate design (--design <catalog name> or --design-biocid label=biocid)');
|
|
672
|
+
const pad = o.pad === undefined ? 0 : Number(o.pad);
|
|
673
|
+
if (!Number.isInteger(pad) || pad < 0 || pad > 1000)
|
|
674
|
+
throw new Error('--pad must be an integer from 0 to 1000');
|
|
675
|
+
return {
|
|
676
|
+
wallet: ownerOr(o.owner, wallet), signature, case_id: caseId,
|
|
677
|
+
bam_biocid: requireBiocid('--bam', o.bam), designs, designs_biocids: db, pad,
|
|
678
|
+
code_sha256: parseSha256('--code-sha256', o.codeSha256),
|
|
679
|
+
protocol_sha256: parseSha256('--protocol-sha256', o.protocolSha256),
|
|
680
|
+
ledger_record: rec,
|
|
681
|
+
executor: parseExecutor(o.executor),
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
async function captureSubmitCommand(caseId, options) {
|
|
685
|
+
try {
|
|
686
|
+
const a = await auth();
|
|
687
|
+
await submit('capture', buildCaptureBody(caseId, options, a.wallet, a.signature), a.headers, options);
|
|
688
|
+
}
|
|
689
|
+
catch (e) {
|
|
690
|
+
logger_1.Logger.error(`capture-compare submit failed: ${e.message}`);
|
|
691
|
+
process.exit(1);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
/** The HPO releases whose files are in gs://genobank-references/hpo/<release>/, with the SHA-256 of each file as read in the session that uploaded them. A release not listed needs both hashes on the command line. */
|
|
695
|
+
exports.HPO_RELEASES = {
|
|
696
|
+
'2026-09-01': { obo: '93dace952fcb3ec4728818857f6ba76bc2d5312f4d83266519b8694b8e798f22', genes: '507a17bff9c49e6329fbd88b1f91734fa7e9fdea5c06304044c0892eb6ab248c' },
|
|
697
|
+
};
|
|
698
|
+
/** Phenotype-driven variant triage with an ACMG/AMP points classification over an annotation sqlite (and its VCF). --schema only profiles the sqlite's columns and classifies nothing. */
|
|
699
|
+
function buildAcmgBody(caseId, o, wallet, signature) {
|
|
700
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
701
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or - (never a person name)');
|
|
702
|
+
if ([o.coverage, o.schema, o.smn, o.support].filter(Boolean).length > 1)
|
|
703
|
+
throw new Error('--coverage, --schema, --smn and --support are different modes: give one');
|
|
704
|
+
const body = {
|
|
705
|
+
wallet: ownerOr(o.owner, wallet), signature, case_id: caseId,
|
|
706
|
+
code_sha256: parseSha256('--code-sha256', o.codeSha256),
|
|
707
|
+
executor: parseExecutor(o.executor),
|
|
708
|
+
mode: o.support ? 'support' : o.smn ? 'smn' : o.coverage ? 'coverage' : o.schema ? 'schema' : 'classify',
|
|
709
|
+
};
|
|
710
|
+
if (o.support) {
|
|
711
|
+
body.bam_biocid = requireBiocid('--bam', o.bam);
|
|
712
|
+
body.report_biocid = requireBiocid('--report-biocid', o.reportBiocid);
|
|
713
|
+
if (o.reference !== 'hg38_noalt')
|
|
714
|
+
throw new Error('--reference must be hg38_noalt (the catalog reference whose FASTA is checked by its recorded MD5)');
|
|
715
|
+
body.reference = o.reference;
|
|
716
|
+
if (o.scope !== undefined && !['all', 'vus'].includes(o.scope))
|
|
717
|
+
throw new Error('--scope must be all or vus');
|
|
718
|
+
body.scope = o.scope || 'all';
|
|
719
|
+
body.case_label = o.caseLabel || caseId;
|
|
720
|
+
return body;
|
|
721
|
+
}
|
|
722
|
+
if (o.coverage || o.smn) {
|
|
723
|
+
body.bam_biocid = requireBiocid('--bam', o.bam);
|
|
724
|
+
if (!o.gtfBucket || !o.gtfObject)
|
|
725
|
+
throw new Error('--gtf-bucket and --gtf-object name the pinned gene annotation (a reference object)');
|
|
726
|
+
body.gtf_bucket = o.gtfBucket;
|
|
727
|
+
body.gtf_object = o.gtfObject;
|
|
728
|
+
body.gtf_sha256 = parseSha256('--gtf-sha256', o.gtfSha256);
|
|
729
|
+
const genes = [].concat(o.genes || []).flatMap((x) => String(x).split(',')).map((x) => x.trim()).filter(Boolean);
|
|
730
|
+
if (genes.length)
|
|
731
|
+
body.genes = genes;
|
|
732
|
+
if (o.smn) {
|
|
733
|
+
if (o.reference !== 'hg38_noalt')
|
|
734
|
+
throw new Error('--reference must be hg38_noalt (the catalog reference whose FASTA is checked by its recorded MD5)');
|
|
735
|
+
body.reference = o.reference;
|
|
736
|
+
body.panel = o.panel || 'skeletal_dysplasia';
|
|
737
|
+
body.case_label = o.caseLabel || caseId;
|
|
738
|
+
delete body.genes;
|
|
739
|
+
return body;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
else {
|
|
743
|
+
body.sqlite_biocid = requireBiocid('--sqlite', o.sqlite);
|
|
744
|
+
}
|
|
745
|
+
if (o.schema)
|
|
746
|
+
return body;
|
|
747
|
+
if (o.vcf && !o.coverage)
|
|
748
|
+
body.vcf_biocid = requireBiocid('--vcf', o.vcf);
|
|
749
|
+
const terms = [].concat(o.hpo || []).flatMap((x) => String(x).split(',')).map((x) => x.trim()).filter(Boolean);
|
|
750
|
+
if (!terms.length)
|
|
751
|
+
throw new Error('give the patient HPO terms with --hpo HP:0002757,HP:0000924');
|
|
752
|
+
for (const t of terms)
|
|
753
|
+
if (!/^HP:[0-9]{7}$/.test(t))
|
|
754
|
+
throw new Error(`--hpo ${t} is not an HPO id like HP:0002757`);
|
|
755
|
+
if (new Set(terms).size !== terms.length)
|
|
756
|
+
throw new Error('--hpo lists a term twice');
|
|
757
|
+
body.hpo_terms = terms;
|
|
758
|
+
body.panel = o.panel || 'none';
|
|
759
|
+
if (o.maxAf !== undefined && !o.coverage) {
|
|
760
|
+
const m = Number(o.maxAf);
|
|
761
|
+
if (!(m > 0 && m <= 0.5))
|
|
762
|
+
throw new Error('--max-af must be above 0 and at most 0.5');
|
|
763
|
+
body.max_af = m;
|
|
764
|
+
}
|
|
765
|
+
const rel = o.hpoRelease;
|
|
766
|
+
if (!rel)
|
|
767
|
+
throw new Error('--hpo-release is required (the folder under genobank-references/hpo, for example 2026-09-01)');
|
|
768
|
+
const known = exports.HPO_RELEASES[rel];
|
|
769
|
+
const obo = o.hpoOboSha256 || (known && known.obo);
|
|
770
|
+
const genes = o.hpoGenesSha256 || (known && known.genes);
|
|
771
|
+
if (!obo || !genes)
|
|
772
|
+
throw new Error(`HPO release ${rel} has no recorded file hashes: give --hpo-obo-sha256 and --hpo-genes-sha256`);
|
|
773
|
+
if (o.constraintObject) {
|
|
774
|
+
body.constraint_object = o.constraintObject;
|
|
775
|
+
body.constraint_sha256 = parseSha256('--constraint-sha256', o.constraintSha256);
|
|
776
|
+
}
|
|
777
|
+
else if (o.constraintSha256) {
|
|
778
|
+
throw new Error('--constraint-sha256 needs --constraint-object');
|
|
779
|
+
}
|
|
780
|
+
if (o.listAll)
|
|
781
|
+
body.list_all = true;
|
|
782
|
+
body.hpo_release = rel;
|
|
783
|
+
body.hpo_obo_sha256 = parseSha256('--hpo-obo-sha256', obo);
|
|
784
|
+
body.hpo_genes_sha256 = parseSha256('--hpo-genes-sha256', genes);
|
|
785
|
+
body.case_label = o.caseLabel || caseId;
|
|
786
|
+
return body;
|
|
787
|
+
}
|
|
788
|
+
async function acmgSubmitCommand(caseId, options) {
|
|
789
|
+
try {
|
|
790
|
+
const a = await auth();
|
|
791
|
+
await submit('acmg', buildAcmgBody(caseId, options, a.wallet, a.signature), a.headers, options);
|
|
792
|
+
}
|
|
793
|
+
catch (e) {
|
|
794
|
+
logger_1.Logger.error(`acmg-triage submit failed: ${e.message}`);
|
|
795
|
+
process.exit(1);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
/** How two callers' VCFs of one sample agree (shared and private calls, genotype concordance, Ti/Tv, the evidence of every private call). Descriptive: it never says which caller is right. */
|
|
799
|
+
function buildVcfCompareBody(caseId, o, wallet, signature) {
|
|
800
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
801
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or - (never a person name)');
|
|
802
|
+
const body = {
|
|
803
|
+
wallet: ownerOr(o.owner, wallet), signature, case_id: caseId,
|
|
804
|
+
vcf_a_biocid: requireBiocid('--a', o.a), vcf_b_biocid: requireBiocid('--b', o.b),
|
|
805
|
+
label_a: o.labelA || 'a', label_b: o.labelB || 'b',
|
|
806
|
+
code_sha256: parseSha256('--code-sha256', o.codeSha256), executor: parseExecutor(o.executor),
|
|
807
|
+
};
|
|
808
|
+
if (body.vcf_a_biocid === body.vcf_b_biocid)
|
|
809
|
+
throw new Error('--a and --b are the same file');
|
|
810
|
+
if (!/^[A-Za-z0-9_-]{1,30}$/.test(String(body.label_a)) || !/^[A-Za-z0-9_-]{1,30}$/.test(String(body.label_b)))
|
|
811
|
+
throw new Error('labels are letters, digits, _ or - (up to 30)');
|
|
812
|
+
if (body.label_a === body.label_b)
|
|
813
|
+
throw new Error('--label-a and --label-b must differ');
|
|
814
|
+
if (o.bed)
|
|
815
|
+
body.bed_biocid = requireBiocid('--bed', o.bed);
|
|
816
|
+
for (const [flag, key, v] of [['--min-dp', 'min_dp', o.minDp], ['--min-gq', 'min_gq', o.minGq]]) {
|
|
817
|
+
if (v !== undefined) {
|
|
818
|
+
const n = Number(v);
|
|
819
|
+
if (!Number.isInteger(n) || n < 0 || n > 200)
|
|
820
|
+
throw new Error(`${flag} must be an integer from 0 to 200`);
|
|
821
|
+
body[key] = n;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
return body;
|
|
825
|
+
}
|
|
826
|
+
async function vcfCompareSubmitCommand(caseId, options) {
|
|
827
|
+
try {
|
|
828
|
+
const a = await auth();
|
|
829
|
+
await submit('vcfcompare', buildVcfCompareBody(caseId, options, a.wallet, a.signature), a.headers, options);
|
|
830
|
+
}
|
|
831
|
+
catch (e) {
|
|
832
|
+
logger_1.Logger.error(`vcf-compare submit failed: ${e.message}`);
|
|
833
|
+
process.exit(1);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
/** Build and verify the BWA-MEM index and sequence dictionary of a catalog reference that has none (a node operator only: it writes beside the reference FASTA, create-only). */
|
|
837
|
+
function buildRefIndexBody(caseId, o, wallet, signature) {
|
|
838
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
839
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or -');
|
|
840
|
+
if (!['hg38_noalt'].includes(String(o.reference)))
|
|
841
|
+
throw new Error('--reference must be a catalog reference without an index: hg38_noalt');
|
|
842
|
+
const body = { wallet: ownerOr(o.owner, wallet), signature, case_id: caseId, reference: o.reference, code_sha256: parseSha256('--code-sha256', o.codeSha256), executor: 'worker' };
|
|
843
|
+
if (o.mode && o.mode !== 'index') {
|
|
844
|
+
// known_sites: copies of catalog known-sites VCFs restricted to the reference's contigs, checked record by record and written create-only beside the reference
|
|
845
|
+
// intervals: copies of catalog capture designs (target Regions BEDs) restricted to the reference's contigs, checked line by line, written create-only beside the reference
|
|
846
|
+
const SOURCES = { known_sites: ['dbsnp138', 'known_indels', 'mills_1000g'], intervals: ['agilent_v8_regions'] };
|
|
847
|
+
const known = SOURCES[String(o.mode)];
|
|
848
|
+
if (!known)
|
|
849
|
+
throw new Error('--mode must be index (default), known_sites or intervals');
|
|
850
|
+
const src = (o.sources || []).flatMap((x) => String(x).split(',')).map((x) => x.trim()).filter(Boolean);
|
|
851
|
+
if (!src.length || src.some((x) => !known.includes(x)) || new Set(src).size !== src.length)
|
|
852
|
+
throw new Error(`--sources must be distinct names of ${known.join(', ')}`);
|
|
853
|
+
body.mode = String(o.mode);
|
|
854
|
+
body.sources = src;
|
|
855
|
+
}
|
|
856
|
+
return body;
|
|
857
|
+
}
|
|
858
|
+
async function refIndexSubmitCommand(caseId, options) {
|
|
859
|
+
try {
|
|
860
|
+
const a = await auth();
|
|
861
|
+
await submit('refindex', buildRefIndexBody(caseId, options, a.wallet, a.signature), a.headers, options);
|
|
862
|
+
}
|
|
863
|
+
catch (e) {
|
|
864
|
+
logger_1.Logger.error(`reference-index submit failed: ${e.message}`);
|
|
865
|
+
process.exit(1);
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
/** Classify every object of a vault into the patient-owned cancer digital twin (layer, specimen, timepoint, matched set) and compute the vaccine-readiness table.
|
|
869
|
+
* Report only unless --apply writes the twin block onto the owner's rows. Runs on the node that holds the registry (executor local), never on a worker. */
|
|
870
|
+
function buildTwinBody(caseId, o, wallet, signature) {
|
|
871
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
872
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or - (never a person name)');
|
|
873
|
+
return {
|
|
874
|
+
wallet: ownerOr(o.owner, wallet), signature, case_id: caseId,
|
|
875
|
+
apply: o.apply === true,
|
|
876
|
+
code_sha256: parseSha256('--code-sha256', o.codeSha256),
|
|
877
|
+
executor: 'local',
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
async function twinClassifySubmitCommand(caseId, options) {
|
|
881
|
+
try {
|
|
882
|
+
const a = await auth();
|
|
883
|
+
await submit('twin', buildTwinBody(caseId, options, a.wallet, a.signature), a.headers, options);
|
|
884
|
+
}
|
|
885
|
+
catch (e) {
|
|
886
|
+
logger_1.Logger.error(`twin classify submit failed: ${e.message}`);
|
|
887
|
+
process.exit(1);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
/** The GENCODE window, CDS and exon geometry of a list of substitutions (the registered window_geometry code). items: [{id, gene, change}] read from a local JSON file. */
|
|
891
|
+
function buildWindowsBody(caseId, o, wallet, signature, items) {
|
|
892
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
893
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or - (never a person name)');
|
|
894
|
+
if (!Array.isArray(items) || items.length < 1 || items.length > 200)
|
|
895
|
+
throw new Error('--items must be a JSON file holding a list of 1 to 200 {id, gene, change}');
|
|
896
|
+
const flank = o.flank === undefined ? 40 : Number(o.flank);
|
|
897
|
+
if (!Number.isInteger(flank) || flank < 1 || flank > 100)
|
|
898
|
+
throw new Error('--flank must be an integer from 1 to 100');
|
|
899
|
+
const rec = Number(o.ledgerRecord);
|
|
900
|
+
if (!Number.isInteger(rec) || rec < 1)
|
|
901
|
+
throw new Error('--ledger-record must be the pre-registration ledger record number');
|
|
902
|
+
return {
|
|
903
|
+
wallet: ownerOr(o.owner, wallet), signature, case_id: caseId,
|
|
904
|
+
items: items.map((i) => ({ id: String(i.id), gene: String(i.gene), change: String(i.change) })), flank,
|
|
905
|
+
code_sha256: parseSha256('--code-sha256', o.codeSha256),
|
|
906
|
+
protocol_sha256: parseSha256('--protocol-sha256', o.protocolSha256),
|
|
907
|
+
ledger_record: rec,
|
|
908
|
+
executor: parseExecutor(o.executor),
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
async function windowsSubmitCommand(caseId, options) {
|
|
912
|
+
try {
|
|
913
|
+
const a = await auth();
|
|
914
|
+
let items;
|
|
915
|
+
try {
|
|
916
|
+
items = JSON.parse(fs.readFileSync(options.items, 'utf8'));
|
|
917
|
+
}
|
|
918
|
+
catch (e) {
|
|
919
|
+
throw new Error(`--items could not be read as JSON: ${e.message}`);
|
|
920
|
+
}
|
|
921
|
+
await submit('windows', buildWindowsBody(caseId, options, a.wallet, a.signature, items), a.headers, options);
|
|
922
|
+
}
|
|
923
|
+
catch (e) {
|
|
924
|
+
logger_1.Logger.error(`windows-geometry submit failed: ${e.message}`);
|
|
925
|
+
process.exit(1);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
/** Peptides from a TSV with the header peptide_id<TAB>peptide. Nothing is repaired: a malformed row is an error. */
|
|
929
|
+
function parsePeptidesTsv(text) {
|
|
930
|
+
const lines = text.split(/\r?\n/).filter((l) => l.length > 0);
|
|
931
|
+
if (lines.length < 2)
|
|
932
|
+
throw new Error('--peptides must be a TSV with the header peptide_id<TAB>peptide and at least one row');
|
|
933
|
+
const head = lines[0].split('\t');
|
|
934
|
+
if (head[0] !== 'peptide_id' || head[1] !== 'peptide')
|
|
935
|
+
throw new Error('--peptides: the first line must be the header peptide_id<TAB>peptide');
|
|
936
|
+
return lines.slice(1).map((l, i) => {
|
|
937
|
+
const f = l.split('\t');
|
|
938
|
+
if (f.length < 2 || !f[0] || !f[1])
|
|
939
|
+
throw new Error(`--peptides: row ${i + 2} has no peptide_id and peptide`);
|
|
940
|
+
return { id: f[0], peptide: f[1].trim().toUpperCase() };
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
/** SHA-256 of the distinct peptide strings, sorted, one per line: the same value the worker recomputes (rescore.peptides_sha256). */
|
|
944
|
+
function peptidesSha256(peps) {
|
|
945
|
+
const h = (0, crypto_1.createHash)('sha256');
|
|
946
|
+
for (const p of [...new Set(peps.map((q) => q.peptide))].sort())
|
|
947
|
+
h.update(`${p}\n`);
|
|
948
|
+
return h.digest('hex');
|
|
949
|
+
}
|
|
950
|
+
/** Binding of caller peptides on caller alleles (MHCflurry class I) and molecules (MHCnuggets class II), under the registered rescore protocol. */
|
|
951
|
+
function buildRescoreBody(caseId, o, wallet, signature, peps) {
|
|
952
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(caseId))
|
|
953
|
+
throw new Error('caseId must be a case identifier of letters, digits, _ or - (never a person name)');
|
|
954
|
+
const split = (v) => [].concat(v || []).flatMap((x) => String(x).split(',')).map((x) => x.trim()).filter(Boolean);
|
|
955
|
+
const c1 = split(o.class1), c2 = split(o.class2);
|
|
956
|
+
if (c1.length + c2.length < 1)
|
|
957
|
+
throw new Error('give at least one --class1 allele (HLA-A*02:01) or --class2 molecule (HLA-DRB104:02)');
|
|
958
|
+
const rec = Number(o.ledgerRecord);
|
|
959
|
+
if (!Number.isInteger(rec) || rec < 1)
|
|
960
|
+
throw new Error('--ledger-record must be the pre-registration ledger record number');
|
|
961
|
+
return {
|
|
962
|
+
wallet: ownerOr(o.owner, wallet), signature, case_id: caseId,
|
|
963
|
+
peptides: peps, peptides_sha256: peptidesSha256(peps), class1_alleles: c1, class2_molecules: c2,
|
|
964
|
+
code_sha256: parseSha256('--code-sha256', o.codeSha256),
|
|
965
|
+
protocol_sha256: parseSha256('--protocol-sha256', o.protocolSha256),
|
|
966
|
+
ledger_record: rec,
|
|
967
|
+
executor: parseExecutor(o.executor),
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
async function rescoreSubmitCommand(caseId, options) {
|
|
971
|
+
try {
|
|
972
|
+
const a = await auth();
|
|
973
|
+
const peps = parsePeptidesTsv(fs.readFileSync(options.peptides, 'utf8'));
|
|
974
|
+
await submit('rescore', buildRescoreBody(caseId, options, a.wallet, a.signature, peps), a.headers, options);
|
|
975
|
+
}
|
|
976
|
+
catch (e) {
|
|
977
|
+
logger_1.Logger.error(`rescore submit failed: ${e.message}`);
|
|
978
|
+
process.exit(1);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
479
981
|
async function teslaGateSubmitCommand(caseId, options) {
|
|
480
982
|
try {
|
|
481
983
|
const a = await auth();
|
|
@@ -486,6 +988,11 @@ async function teslaGateSubmitCommand(caseId, options) {
|
|
|
486
988
|
process.exit(1);
|
|
487
989
|
}
|
|
488
990
|
}
|
|
991
|
+
/** Used by the pbrun verbs (commands/parabricks): sign, submit the job body, optionally wait. The body is built and checked by the caller. */
|
|
992
|
+
async function parabricksSubmit(buildBody, options) {
|
|
993
|
+
const a = await auth();
|
|
994
|
+
await submit('parabricks', buildBody(a.wallet, a.signature), a.headers, options);
|
|
995
|
+
}
|
|
489
996
|
async function neoantigenStatusCommand(kind, id, options) {
|
|
490
997
|
try {
|
|
491
998
|
const a = await auth();
|
|
@@ -502,4 +1009,15 @@ async function neoantigenStatusCommand(kind, id, options) {
|
|
|
502
1009
|
process.exit(1);
|
|
503
1010
|
}
|
|
504
1011
|
}
|
|
1012
|
+
/** Submit a job of any kind with the signer's credentials; the body builder gets the signer's wallet and signature. Used by verbs that live in their own module. */
|
|
1013
|
+
async function submitKindCommand(kind, build, options) {
|
|
1014
|
+
try {
|
|
1015
|
+
const a = await auth();
|
|
1016
|
+
await submit(kind, build(a.wallet, a.signature), a.headers, options);
|
|
1017
|
+
}
|
|
1018
|
+
catch (e) {
|
|
1019
|
+
logger_1.Logger.error(`${ROUTE[kind].verb} submit failed: ${e.message}`);
|
|
1020
|
+
process.exit(1);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
505
1023
|
//# sourceMappingURL=index.js.map
|