@genobank/biofs 3.1.0 → 3.18.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 +663 -462
- package/dist/abi/USDC.json +33 -0
- package/dist/abi/sequentia/BioAgentRegistry.json +20 -0
- package/dist/abi/sequentia/BioCIDRegistry.json +139 -0
- package/dist/abi/sequentia/BioPIL.json +130 -0
- package/dist/abi/sequentia/ConsentManager.json +620 -0
- package/dist/abi/sequentia/OpenCravatJobs.json +988 -0
- package/dist/abi/sequentia/PaymentRouter.json +638 -0
- package/dist/commands/agent/list-sequentia.d.ts +17 -0
- package/dist/commands/agent/list-sequentia.d.ts.map +1 -0
- package/dist/commands/agent/list-sequentia.js +87 -0
- package/dist/commands/agent/list-sequentia.js.map +1 -0
- package/dist/commands/agent/register-sequentia.d.ts +33 -0
- package/dist/commands/agent/register-sequentia.d.ts.map +1 -0
- package/dist/commands/agent/register-sequentia.js +145 -0
- package/dist/commands/agent/register-sequentia.js.map +1 -0
- package/dist/commands/align-shard/exec.d.ts +45 -0
- package/dist/commands/align-shard/exec.d.ts.map +1 -0
- package/dist/commands/align-shard/exec.js +549 -0
- package/dist/commands/align-shard/exec.js.map +1 -0
- package/dist/commands/align-shard/submit.d.ts +37 -0
- package/dist/commands/align-shard/submit.d.ts.map +1 -0
- package/dist/commands/align-shard/submit.js +117 -0
- package/dist/commands/align-shard/submit.js.map +1 -0
- package/dist/commands/ancestry/ingest.d.ts +34 -0
- package/dist/commands/ancestry/ingest.d.ts.map +1 -0
- package/dist/commands/ancestry/ingest.js +175 -0
- package/dist/commands/ancestry/ingest.js.map +1 -0
- package/dist/commands/ancestry/share.d.ts +33 -0
- package/dist/commands/ancestry/share.d.ts.map +1 -0
- package/dist/commands/ancestry/share.js +154 -0
- package/dist/commands/ancestry/share.js.map +1 -0
- package/dist/commands/ancestry/somos.d.ts +34 -0
- package/dist/commands/ancestry/somos.d.ts.map +1 -0
- package/dist/commands/ancestry/somos.js +151 -0
- package/dist/commands/ancestry/somos.js.map +1 -0
- package/dist/commands/ancestry/status.d.ts +14 -0
- package/dist/commands/ancestry/status.d.ts.map +1 -0
- package/dist/commands/ancestry/status.js +74 -0
- package/dist/commands/ancestry/status.js.map +1 -0
- package/dist/commands/annotate/status.d.ts +11 -4
- package/dist/commands/annotate/status.d.ts.map +1 -1
- package/dist/commands/annotate/status.js +66 -99
- package/dist/commands/annotate/status.js.map +1 -1
- package/dist/commands/annotate/submit.d.ts +15 -5
- package/dist/commands/annotate/submit.d.ts.map +1 -1
- package/dist/commands/annotate/submit.js +86 -266
- package/dist/commands/annotate/submit.js.map +1 -1
- package/dist/commands/benchmark.d.ts +50 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +608 -0
- package/dist/commands/benchmark.js.map +1 -0
- package/dist/commands/biofiles.d.ts +1 -0
- package/dist/commands/biofiles.d.ts.map +1 -1
- package/dist/commands/biofiles.js +19 -6
- package/dist/commands/biofiles.js.map +1 -1
- package/dist/commands/biowallet/bind.d.ts +12 -0
- package/dist/commands/biowallet/bind.d.ts.map +1 -0
- package/dist/commands/biowallet/bind.js +85 -0
- package/dist/commands/biowallet/bind.js.map +1 -0
- package/dist/commands/biowallet/create.d.ts +40 -0
- package/dist/commands/biowallet/create.d.ts.map +1 -0
- package/dist/commands/biowallet/create.js +191 -0
- package/dist/commands/biowallet/create.js.map +1 -0
- package/dist/commands/biowallet/family.d.ts +48 -0
- package/dist/commands/biowallet/family.d.ts.map +1 -0
- package/dist/commands/biowallet/family.js +310 -0
- package/dist/commands/biowallet/family.js.map +1 -0
- package/dist/commands/biowallet/list.d.ts +15 -0
- package/dist/commands/biowallet/list.d.ts.map +1 -0
- package/dist/commands/biowallet/list.js +81 -0
- package/dist/commands/biowallet/list.js.map +1 -0
- package/dist/commands/bode.d.ts +34 -0
- package/dist/commands/bode.d.ts.map +1 -0
- package/dist/commands/bode.js +257 -0
- package/dist/commands/bode.js.map +1 -0
- package/dist/commands/claim.d.ts +32 -0
- package/dist/commands/claim.d.ts.map +1 -0
- package/dist/commands/claim.js +138 -0
- package/dist/commands/claim.js.map +1 -0
- package/dist/commands/clinical.d.ts +49 -0
- package/dist/commands/clinical.d.ts.map +1 -0
- package/dist/commands/clinical.js +273 -0
- package/dist/commands/clinical.js.map +1 -0
- package/dist/commands/cohort-acmg.d.ts +42 -0
- package/dist/commands/cohort-acmg.d.ts.map +1 -0
- package/dist/commands/cohort-acmg.js +319 -0
- package/dist/commands/cohort-acmg.js.map +1 -0
- package/dist/commands/cohort-fourier-score.d.ts +57 -0
- package/dist/commands/cohort-fourier-score.d.ts.map +1 -0
- package/dist/commands/cohort-fourier-score.js +390 -0
- package/dist/commands/cohort-fourier-score.js.map +1 -0
- package/dist/commands/cohort-pipeline.d.ts +49 -0
- package/dist/commands/cohort-pipeline.d.ts.map +1 -0
- package/dist/commands/cohort-pipeline.js +308 -0
- package/dist/commands/cohort-pipeline.js.map +1 -0
- package/dist/commands/cohort-train.d.ts +45 -0
- package/dist/commands/cohort-train.d.ts.map +1 -0
- package/dist/commands/cohort-train.js +308 -0
- package/dist/commands/cohort-train.js.map +1 -0
- package/dist/commands/comethyl/exec.d.ts +40 -0
- package/dist/commands/comethyl/exec.d.ts.map +1 -0
- package/dist/commands/comethyl/exec.js +493 -0
- package/dist/commands/comethyl/exec.js.map +1 -0
- package/dist/commands/comethyl/submit.d.ts +35 -0
- package/dist/commands/comethyl/submit.d.ts.map +1 -0
- package/dist/commands/comethyl/submit.js +98 -0
- package/dist/commands/comethyl/submit.js.map +1 -0
- package/dist/commands/consent.d.ts +10 -0
- package/dist/commands/consent.d.ts.map +1 -0
- package/dist/commands/consent.js +114 -0
- package/dist/commands/consent.js.map +1 -0
- package/dist/commands/dipcall/exec.d.ts +25 -0
- package/dist/commands/dipcall/exec.d.ts.map +1 -0
- package/dist/commands/dipcall/exec.js +207 -0
- package/dist/commands/dipcall/exec.js.map +1 -0
- package/dist/commands/dipcall/submit.d.ts +22 -0
- package/dist/commands/dipcall/submit.d.ts.map +1 -0
- package/dist/commands/dipcall/submit.js +81 -0
- package/dist/commands/dipcall/submit.js.map +1 -0
- package/dist/commands/download-with-consent.d.ts +1 -0
- package/dist/commands/download-with-consent.d.ts.map +1 -1
- package/dist/commands/download-with-consent.js +32 -0
- package/dist/commands/download-with-consent.js.map +1 -1
- package/dist/commands/download.d.ts +2 -0
- package/dist/commands/download.d.ts.map +1 -1
- package/dist/commands/download.js +31 -0
- package/dist/commands/download.js.map +1 -1
- package/dist/commands/duet.d.ts +39 -0
- package/dist/commands/duet.d.ts.map +1 -0
- package/dist/commands/duet.js +323 -0
- package/dist/commands/duet.js.map +1 -0
- package/dist/commands/erase.d.ts +29 -0
- package/dist/commands/erase.d.ts.map +1 -0
- package/dist/commands/erase.js +136 -0
- package/dist/commands/erase.js.map +1 -0
- package/dist/commands/family-status.d.ts +3 -0
- package/dist/commands/family-status.d.ts.map +1 -1
- package/dist/commands/family-status.js +279 -166
- package/dist/commands/family-status.js.map +1 -1
- package/dist/commands/fingerprint.d.ts +2 -0
- package/dist/commands/fingerprint.d.ts.map +1 -1
- package/dist/commands/fingerprint.js +4 -0
- package/dist/commands/fingerprint.js.map +1 -1
- package/dist/commands/fluency/index.d.ts +7 -0
- package/dist/commands/fluency/index.d.ts.map +1 -0
- package/dist/commands/fluency/index.js +122 -0
- package/dist/commands/fluency/index.js.map +1 -0
- package/dist/commands/fourier-score.d.ts +36 -0
- package/dist/commands/fourier-score.d.ts.map +1 -0
- package/dist/commands/fourier-score.js +713 -0
- package/dist/commands/fourier-score.js.map +1 -0
- package/dist/commands/fuse.d.ts.map +1 -1
- package/dist/commands/fuse.js +29 -7
- package/dist/commands/fuse.js.map +1 -1
- package/dist/commands/hifi-align/exec.d.ts +23 -0
- package/dist/commands/hifi-align/exec.d.ts.map +1 -0
- package/dist/commands/hifi-align/exec.js +224 -0
- package/dist/commands/hifi-align/exec.js.map +1 -0
- package/dist/commands/hifi-align/submit.d.ts +22 -0
- package/dist/commands/hifi-align/submit.d.ts.map +1 -0
- package/dist/commands/hifi-align/submit.js +82 -0
- package/dist/commands/hifi-align/submit.js.map +1 -0
- package/dist/commands/hifi-deepvariant/exec.d.ts +29 -0
- package/dist/commands/hifi-deepvariant/exec.d.ts.map +1 -0
- package/dist/commands/hifi-deepvariant/exec.js +280 -0
- package/dist/commands/hifi-deepvariant/exec.js.map +1 -0
- package/dist/commands/hifi-deepvariant/submit.d.ts +23 -0
- package/dist/commands/hifi-deepvariant/submit.d.ts.map +1 -0
- package/dist/commands/hifi-deepvariant/submit.js +80 -0
- package/dist/commands/hifi-deepvariant/submit.js.map +1 -0
- package/dist/commands/hifi-methyl/exec.d.ts +25 -0
- package/dist/commands/hifi-methyl/exec.d.ts.map +1 -0
- package/dist/commands/hifi-methyl/exec.js +243 -0
- package/dist/commands/hifi-methyl/exec.js.map +1 -0
- package/dist/commands/hifi-methyl/submit.d.ts +22 -0
- package/dist/commands/hifi-methyl/submit.d.ts.map +1 -0
- package/dist/commands/hifi-methyl/submit.js +78 -0
- package/dist/commands/hifi-methyl/submit.js.map +1 -0
- package/dist/commands/htsget.d.ts +6 -0
- package/dist/commands/htsget.d.ts.map +1 -1
- package/dist/commands/htsget.js +31 -6
- package/dist/commands/htsget.js.map +1 -1
- package/dist/commands/imaging/attribute.d.ts +19 -0
- package/dist/commands/imaging/attribute.d.ts.map +1 -0
- package/dist/commands/imaging/attribute.js +102 -0
- package/dist/commands/imaging/attribute.js.map +1 -0
- package/dist/commands/imaging/characterize.d.ts +20 -0
- package/dist/commands/imaging/characterize.d.ts.map +1 -0
- package/dist/commands/imaging/characterize.js +105 -0
- package/dist/commands/imaging/characterize.js.map +1 -0
- package/dist/commands/imaging/compare.d.ts +33 -0
- package/dist/commands/imaging/compare.d.ts.map +1 -0
- package/dist/commands/imaging/compare.js +129 -0
- package/dist/commands/imaging/compare.js.map +1 -0
- package/dist/commands/imaging/enrich.d.ts +28 -0
- package/dist/commands/imaging/enrich.d.ts.map +1 -0
- package/dist/commands/imaging/enrich.js +130 -0
- package/dist/commands/imaging/enrich.js.map +1 -0
- package/dist/commands/imaging/findings.d.ts +21 -0
- package/dist/commands/imaging/findings.d.ts.map +1 -0
- package/dist/commands/imaging/findings.js +134 -0
- package/dist/commands/imaging/findings.js.map +1 -0
- package/dist/commands/imaging/lesions.d.ts +21 -0
- package/dist/commands/imaging/lesions.d.ts.map +1 -0
- package/dist/commands/imaging/lesions.js +131 -0
- package/dist/commands/imaging/lesions.js.map +1 -0
- package/dist/commands/imaging/submit.d.ts +32 -0
- package/dist/commands/imaging/submit.d.ts.map +1 -0
- package/dist/commands/imaging/submit.js +118 -0
- package/dist/commands/imaging/submit.js.map +1 -0
- package/dist/commands/imaging/trajectory.d.ts +23 -0
- package/dist/commands/imaging/trajectory.d.ts.map +1 -0
- package/dist/commands/imaging/trajectory.js +134 -0
- package/dist/commands/imaging/trajectory.js.map +1 -0
- package/dist/commands/imaging/twin.d.ts +32 -0
- package/dist/commands/imaging/twin.d.ts.map +1 -0
- package/dist/commands/imaging/twin.js +168 -0
- package/dist/commands/imaging/twin.js.map +1 -0
- package/dist/commands/ingest-rna-tpm.d.ts +33 -0
- package/dist/commands/ingest-rna-tpm.d.ts.map +1 -0
- package/dist/commands/ingest-rna-tpm.js +104 -0
- package/dist/commands/ingest-rna-tpm.js.map +1 -0
- package/dist/commands/interpret/status.d.ts +14 -0
- package/dist/commands/interpret/status.d.ts.map +1 -0
- package/dist/commands/interpret/status.js +83 -0
- package/dist/commands/interpret/status.js.map +1 -0
- package/dist/commands/interpret/submit.d.ts +22 -0
- package/dist/commands/interpret/submit.d.ts.map +1 -0
- package/dist/commands/interpret/submit.js +103 -0
- package/dist/commands/interpret/submit.js.map +1 -0
- package/dist/commands/inventory/cohort.d.ts +29 -0
- package/dist/commands/inventory/cohort.d.ts.map +1 -0
- package/dist/commands/inventory/cohort.js +136 -0
- package/dist/commands/inventory/cohort.js.map +1 -0
- package/dist/commands/inventory-register-sqlite.d.ts +36 -0
- package/dist/commands/inventory-register-sqlite.d.ts.map +1 -0
- package/dist/commands/inventory-register-sqlite.js +178 -0
- package/dist/commands/inventory-register-sqlite.js.map +1 -0
- package/dist/commands/job/recall.d.ts +6 -0
- package/dist/commands/job/recall.d.ts.map +1 -0
- package/dist/commands/job/recall.js +59 -0
- package/dist/commands/job/recall.js.map +1 -0
- package/dist/commands/job/reconcile.d.ts +19 -0
- package/dist/commands/job/reconcile.d.ts.map +1 -0
- package/dist/commands/job/reconcile.js +67 -0
- package/dist/commands/job/reconcile.js.map +1 -0
- package/dist/commands/lab/refreshCoverage.d.ts +53 -0
- package/dist/commands/lab/refreshCoverage.d.ts.map +1 -0
- package/dist/commands/lab/refreshCoverage.js +244 -0
- package/dist/commands/lab/refreshCoverage.js.map +1 -0
- package/dist/commands/liftover/exec.d.ts +27 -0
- package/dist/commands/liftover/exec.d.ts.map +1 -0
- package/dist/commands/liftover/exec.js +258 -0
- package/dist/commands/liftover/exec.js.map +1 -0
- package/dist/commands/liftover/submit.d.ts +22 -0
- package/dist/commands/liftover/submit.d.ts.map +1 -0
- package/dist/commands/liftover/submit.js +79 -0
- package/dist/commands/liftover/submit.js.map +1 -0
- package/dist/commands/lineage.d.ts +6 -0
- package/dist/commands/lineage.d.ts.map +1 -0
- package/dist/commands/lineage.js +126 -0
- package/dist/commands/lineage.js.map +1 -0
- package/dist/commands/methyl/exec.d.ts +47 -0
- package/dist/commands/methyl/exec.d.ts.map +1 -0
- package/dist/commands/methyl/exec.js +565 -0
- package/dist/commands/methyl/exec.js.map +1 -0
- package/dist/commands/methyl/submit.d.ts +25 -0
- package/dist/commands/methyl/submit.d.ts.map +1 -0
- package/dist/commands/methyl/submit.js +98 -0
- package/dist/commands/methyl/submit.js.map +1 -0
- package/dist/commands/mount.d.ts +17 -2
- package/dist/commands/mount.d.ts.map +1 -1
- package/dist/commands/mount.js +158 -6
- package/dist/commands/mount.js.map +1 -1
- package/dist/commands/myvariant.d.ts +60 -0
- package/dist/commands/myvariant.d.ts.map +1 -0
- package/dist/commands/myvariant.js +433 -0
- package/dist/commands/myvariant.js.map +1 -0
- package/dist/commands/ont-variants/exec.d.ts +24 -0
- package/dist/commands/ont-variants/exec.d.ts.map +1 -0
- package/dist/commands/ont-variants/exec.js +230 -0
- package/dist/commands/ont-variants/exec.js.map +1 -0
- package/dist/commands/ont-variants/submit.d.ts +22 -0
- package/dist/commands/ont-variants/submit.d.ts.map +1 -0
- package/dist/commands/ont-variants/submit.js +78 -0
- package/dist/commands/ont-variants/submit.js.map +1 -0
- package/dist/commands/pbsv/exec.d.ts +24 -0
- package/dist/commands/pbsv/exec.d.ts.map +1 -0
- package/dist/commands/pbsv/exec.js +231 -0
- package/dist/commands/pbsv/exec.js.map +1 -0
- package/dist/commands/pbsv/submit.d.ts +22 -0
- package/dist/commands/pbsv/submit.d.ts.map +1 -0
- package/dist/commands/pbsv/submit.js +78 -0
- package/dist/commands/pbsv/submit.js.map +1 -0
- package/dist/commands/phase/exec.d.ts +26 -0
- package/dist/commands/phase/exec.d.ts.map +1 -0
- package/dist/commands/phase/exec.js +246 -0
- package/dist/commands/phase/exec.js.map +1 -0
- package/dist/commands/phase/submit.d.ts +24 -0
- package/dist/commands/phase/submit.d.ts.map +1 -0
- package/dist/commands/phase/submit.js +83 -0
- package/dist/commands/phase/submit.js.map +1 -0
- package/dist/commands/pipe.d.ts +4 -2
- package/dist/commands/pipe.d.ts.map +1 -1
- package/dist/commands/pipe.js +55 -50
- package/dist/commands/pipe.js.map +1 -1
- package/dist/commands/pipeline/runWes.d.ts +28 -0
- package/dist/commands/pipeline/runWes.d.ts.map +1 -0
- package/dist/commands/pipeline/runWes.js +276 -0
- package/dist/commands/pipeline/runWes.js.map +1 -0
- package/dist/commands/profile.d.ts +8 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +193 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/psm-consensus.d.ts +72 -0
- package/dist/commands/psm-consensus.d.ts.map +1 -0
- package/dist/commands/psm-consensus.js +338 -0
- package/dist/commands/psm-consensus.js.map +1 -0
- package/dist/commands/qc/exec.d.ts +32 -0
- package/dist/commands/qc/exec.d.ts.map +1 -0
- package/dist/commands/qc/exec.js +350 -0
- package/dist/commands/qc/exec.js.map +1 -0
- package/dist/commands/qc/submit.d.ts +23 -0
- package/dist/commands/qc/submit.d.ts.map +1 -0
- package/dist/commands/qc/submit.js +88 -0
- package/dist/commands/qc/submit.js.map +1 -0
- package/dist/commands/query.d.ts +37 -0
- package/dist/commands/query.d.ts.map +1 -0
- package/dist/commands/query.js +170 -0
- package/dist/commands/query.js.map +1 -0
- package/dist/commands/repeat-genotype/exec.d.ts +26 -0
- package/dist/commands/repeat-genotype/exec.d.ts.map +1 -0
- package/dist/commands/repeat-genotype/exec.js +245 -0
- package/dist/commands/repeat-genotype/exec.js.map +1 -0
- package/dist/commands/repeat-genotype/submit.d.ts +23 -0
- package/dist/commands/repeat-genotype/submit.d.ts.map +1 -0
- package/dist/commands/repeat-genotype/submit.js +82 -0
- package/dist/commands/repeat-genotype/submit.js.map +1 -0
- package/dist/commands/researcher/passport.d.ts +15 -0
- package/dist/commands/researcher/passport.d.ts.map +1 -0
- package/dist/commands/researcher/passport.js +98 -0
- package/dist/commands/researcher/passport.js.map +1 -0
- package/dist/commands/researcher/register.d.ts +18 -0
- package/dist/commands/researcher/register.d.ts.map +1 -0
- package/dist/commands/researcher/register.js +277 -0
- package/dist/commands/researcher/register.js.map +1 -0
- package/dist/commands/researcher/status.d.ts +6 -0
- package/dist/commands/researcher/status.d.ts.map +1 -0
- package/dist/commands/researcher/status.js +111 -0
- package/dist/commands/researcher/status.js.map +1 -0
- package/dist/commands/room.d.ts +31 -0
- package/dist/commands/room.d.ts.map +1 -0
- package/dist/commands/room.js +486 -0
- package/dist/commands/room.js.map +1 -0
- package/dist/commands/route/anchor.d.ts +42 -0
- package/dist/commands/route/anchor.d.ts.map +1 -0
- package/dist/commands/route/anchor.js +213 -0
- package/dist/commands/route/anchor.js.map +1 -0
- package/dist/commands/route/index.d.ts +27 -0
- package/dist/commands/route/index.d.ts.map +1 -0
- package/dist/commands/route/index.js +82 -0
- package/dist/commands/route/index.js.map +1 -0
- package/dist/commands/rrm-consensus.d.ts +74 -0
- package/dist/commands/rrm-consensus.d.ts.map +1 -0
- package/dist/commands/rrm-consensus.js +334 -0
- package/dist/commands/rrm-consensus.js.map +1 -0
- package/dist/commands/rrm-distribution.d.ts +34 -0
- package/dist/commands/rrm-distribution.d.ts.map +1 -0
- package/dist/commands/rrm-distribution.js +743 -0
- package/dist/commands/rrm-distribution.js.map +1 -0
- package/dist/commands/rrm-train.d.ts +33 -0
- package/dist/commands/rrm-train.d.ts.map +1 -0
- package/dist/commands/rrm-train.js +549 -0
- package/dist/commands/rrm-train.js.map +1 -0
- package/dist/commands/samples.d.ts +25 -0
- package/dist/commands/samples.d.ts.map +1 -0
- package/dist/commands/samples.js +184 -0
- package/dist/commands/samples.js.map +1 -0
- package/dist/commands/score-protein.d.ts +13 -0
- package/dist/commands/score-protein.d.ts.map +1 -0
- package/dist/commands/score-protein.js +360 -0
- package/dist/commands/score-protein.js.map +1 -0
- package/dist/commands/stream.d.ts +7 -0
- package/dist/commands/stream.d.ts.map +1 -1
- package/dist/commands/stream.js +26 -41
- package/dist/commands/stream.js.map +1 -1
- package/dist/commands/sv-call/exec.d.ts +23 -0
- package/dist/commands/sv-call/exec.d.ts.map +1 -0
- package/dist/commands/sv-call/exec.js +233 -0
- package/dist/commands/sv-call/exec.js.map +1 -0
- package/dist/commands/sv-call/submit.d.ts +21 -0
- package/dist/commands/sv-call/submit.d.ts.map +1 -0
- package/dist/commands/sv-call/submit.js +77 -0
- package/dist/commands/sv-call/submit.js.map +1 -0
- package/dist/commands/tele.d.ts +42 -0
- package/dist/commands/tele.d.ts.map +1 -0
- package/dist/commands/tele.js +559 -0
- package/dist/commands/tele.js.map +1 -0
- package/dist/commands/tokenize-spectrum.d.ts +58 -0
- package/dist/commands/tokenize-spectrum.d.ts.map +1 -0
- package/dist/commands/tokenize-spectrum.js +297 -0
- package/dist/commands/tokenize-spectrum.js.map +1 -0
- package/dist/commands/umount.d.ts.map +1 -1
- package/dist/commands/umount.js +42 -1
- package/dist/commands/umount.js.map +1 -1
- package/dist/commands/variants.d.ts +42 -0
- package/dist/commands/variants.d.ts.map +1 -0
- package/dist/commands/variants.js +237 -0
- package/dist/commands/variants.js.map +1 -0
- package/dist/commands/verkko/exec.d.ts +27 -0
- package/dist/commands/verkko/exec.d.ts.map +1 -0
- package/dist/commands/verkko/exec.js +223 -0
- package/dist/commands/verkko/exec.js.map +1 -0
- package/dist/commands/verkko/submit.d.ts +24 -0
- package/dist/commands/verkko/submit.d.ts.map +1 -0
- package/dist/commands/verkko/submit.js +96 -0
- package/dist/commands/verkko/submit.js.map +1 -0
- package/dist/commands/wavelet-consensus.d.ts +69 -0
- package/dist/commands/wavelet-consensus.d.ts.map +1 -0
- package/dist/commands/wavelet-consensus.js +338 -0
- package/dist/commands/wavelet-consensus.js.map +1 -0
- package/dist/commands/workspace.d.ts +59 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +419 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/commands/x402/index.d.ts +8 -0
- package/dist/commands/x402/index.d.ts.map +1 -1
- package/dist/commands/x402/index.js +100 -2
- package/dist/commands/x402/index.js.map +1 -1
- package/dist/commands/x402/pipeline-cancer-twin.d.ts +119 -0
- package/dist/commands/x402/pipeline-cancer-twin.d.ts.map +1 -0
- package/dist/commands/x402/pipeline-cancer-twin.js +326 -0
- package/dist/commands/x402/pipeline-cancer-twin.js.map +1 -0
- package/dist/commands/x402/submit.d.ts +72 -0
- package/dist/commands/x402/submit.d.ts.map +1 -0
- package/dist/commands/x402/submit.js +227 -0
- package/dist/commands/x402/submit.js.map +1 -0
- package/dist/commands/x402/verify-payment.d.ts +24 -0
- package/dist/commands/x402/verify-payment.d.ts.map +1 -0
- package/dist/commands/x402/verify-payment.js +113 -0
- package/dist/commands/x402/verify-payment.js.map +1 -0
- package/dist/index.js +2804 -196
- package/dist/index.js.map +1 -1
- package/dist/lib/api/client.d.ts +1 -0
- package/dist/lib/api/client.d.ts.map +1 -1
- package/dist/lib/api/client.js +22 -0
- package/dist/lib/api/client.js.map +1 -1
- package/dist/lib/api/fuse-client.d.ts +281 -0
- package/dist/lib/api/fuse-client.d.ts.map +1 -1
- package/dist/lib/api/fuse-client.js +428 -0
- package/dist/lib/api/fuse-client.js.map +1 -1
- package/dist/lib/biofiles/resolver.d.ts +1 -1
- package/dist/lib/biofiles/resolver.d.ts.map +1 -1
- package/dist/lib/biofiles/resolver.js +173 -138
- package/dist/lib/biofiles/resolver.js.map +1 -1
- package/dist/lib/config/constants.d.ts +1 -0
- package/dist/lib/config/constants.d.ts.map +1 -1
- package/dist/lib/config/constants.js +1 -0
- package/dist/lib/config/constants.js.map +1 -1
- package/dist/lib/config/paths.d.ts +6 -6
- package/dist/lib/config/paths.d.ts.map +1 -1
- package/dist/lib/config/paths.js +56 -17
- package/dist/lib/config/paths.js.map +1 -1
- package/dist/lib/gene-map.d.ts +24 -0
- package/dist/lib/gene-map.d.ts.map +1 -0
- package/dist/lib/gene-map.js +114 -0
- package/dist/lib/gene-map.js.map +1 -0
- package/dist/lib/htsget/client.d.ts +28 -5
- package/dist/lib/htsget/client.d.ts.map +1 -1
- package/dist/lib/htsget/client.js +96 -18
- package/dist/lib/htsget/client.js.map +1 -1
- package/dist/lib/sequentia/BioAgentRegistry.d.ts +98 -0
- package/dist/lib/sequentia/BioAgentRegistry.d.ts.map +1 -0
- package/dist/lib/sequentia/BioAgentRegistry.js +209 -0
- package/dist/lib/sequentia/BioAgentRegistry.js.map +1 -0
- package/dist/lib/tele/core.d.ts +71 -0
- package/dist/lib/tele/core.d.ts.map +1 -0
- package/dist/lib/tele/core.js +387 -0
- package/dist/lib/tele/core.js.map +1 -0
- package/dist/lib/x402/cancer-twin-agents.d.ts +65 -0
- package/dist/lib/x402/cancer-twin-agents.d.ts.map +1 -0
- package/dist/lib/x402/cancer-twin-agents.js +114 -0
- package/dist/lib/x402/cancer-twin-agents.js.map +1 -0
- package/dist/lib/x402/sequentia-pay.d.ts +51 -0
- package/dist/lib/x402/sequentia-pay.d.ts.map +1 -0
- package/dist/lib/x402/sequentia-pay.js +186 -0
- package/dist/lib/x402/sequentia-pay.js.map +1 -0
- package/dist/types/biofiles.d.ts +1 -1
- package/dist/types/biofiles.d.ts.map +1 -1
- package/dist/utils/errorReporter.d.ts +1 -0
- package/dist/utils/errorReporter.d.ts.map +1 -1
- package/dist/utils/errorReporter.js +39 -1
- package/dist/utils/errorReporter.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +20 -0
- package/dist/version.js.map +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* BioAgentRegistry — ERC-8004 AI Agent Identity + Reputation Registry (Sequentia)
|
|
4
|
+
*
|
|
5
|
+
* Thin ethers v6 wrapper over the deployed BioAgentRegistry contract
|
|
6
|
+
* (0x24e634E570Ca8aE366aF4ae8861492a1e9B06B6B on Sequentia chain 15132025).
|
|
7
|
+
*
|
|
8
|
+
* The contract implements the ERC-8004 Identity Registry + Reputation Registry
|
|
9
|
+
* and the x402 payment-proof flow:
|
|
10
|
+
* - register(agentURI, supportedFormats, x402Enabled) → one agent per wallet
|
|
11
|
+
* - requestBioAssetAccess(bioipId, paymentMethod) → initiates x402 access
|
|
12
|
+
* - submitPaymentProof(bioipId, txHash, chainId, usdc) → records a payment
|
|
13
|
+
* - getAgent(agentId) / walletToAgent(wallet) → discovery (read-only)
|
|
14
|
+
*
|
|
15
|
+
* Two modes:
|
|
16
|
+
* - read-only: new BioAgentRegistry() (provider only — getAgent/walletToAgent)
|
|
17
|
+
* - signing: new BioAgentRegistry(privateKey) (register / submitPaymentProof)
|
|
18
|
+
*
|
|
19
|
+
* The deployer/operator is the contract owner (verifyPayment is onlyOwner). Each
|
|
20
|
+
* agent registers ITSELF (register() is msg.sender-bound), so register() must be
|
|
21
|
+
* called from the agent's own wallet key.
|
|
22
|
+
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.BioAgentRegistry = exports.BIOAGENT_REGISTRY_ADDRESS = void 0;
|
|
58
|
+
const ethers_1 = require("ethers");
|
|
59
|
+
const path = __importStar(require("path"));
|
|
60
|
+
const constants_1 = require("../config/constants");
|
|
61
|
+
const logger_1 = require("../utils/logger");
|
|
62
|
+
// Deployed on Sequentia (biorouter-contracts/deployed-addresses.json, chain 15132025).
|
|
63
|
+
exports.BIOAGENT_REGISTRY_ADDRESS = process.env.BIOAGENT_REGISTRY_ADDRESS || '0x24e634E570Ca8aE366aF4ae8861492a1e9B06B6B';
|
|
64
|
+
// Minimal ABI (human-readable). Loaded from src/abi/sequentia so the build step
|
|
65
|
+
// copies it into dist alongside the other Sequentia ABIs.
|
|
66
|
+
const REGISTRY_ABI = require(path.join(__dirname, '../../abi/sequentia/BioAgentRegistry.json'));
|
|
67
|
+
class BioAgentRegistry {
|
|
68
|
+
constructor(privateKey) {
|
|
69
|
+
const rpc = process.env.SEQUENTIA_RPC_URL || constants_1.SEQUENTIA_NETWORK.rpc;
|
|
70
|
+
this.provider = new ethers_1.ethers.JsonRpcProvider(rpc);
|
|
71
|
+
this.address = exports.BIOAGENT_REGISTRY_ADDRESS;
|
|
72
|
+
if (privateKey) {
|
|
73
|
+
const pk = privateKey.startsWith('0x') ? privateKey : `0x${privateKey}`;
|
|
74
|
+
this.signer = new ethers_1.ethers.Wallet(pk, this.provider);
|
|
75
|
+
this.contract = new ethers_1.ethers.Contract(this.address, REGISTRY_ABI, this.signer);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.signer = null;
|
|
79
|
+
this.contract = new ethers_1.ethers.Contract(this.address, REGISTRY_ABI, this.provider);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
get walletAddress() {
|
|
83
|
+
return this.signer ? this.signer.address : null;
|
|
84
|
+
}
|
|
85
|
+
/** agentId for a wallet (0 = not registered). Read-only. */
|
|
86
|
+
async agentIdOf(wallet) {
|
|
87
|
+
const id = await this.contract.walletToAgent(ethers_1.ethers.getAddress(wallet));
|
|
88
|
+
return Number(id);
|
|
89
|
+
}
|
|
90
|
+
/** Full agent record by id, or null if id is 0 / unregistered. Read-only. */
|
|
91
|
+
async getAgent(agentId) {
|
|
92
|
+
if (!agentId)
|
|
93
|
+
return null;
|
|
94
|
+
const a = await this.contract.getAgent(agentId);
|
|
95
|
+
return {
|
|
96
|
+
agentId,
|
|
97
|
+
agentURI: a.agentURI,
|
|
98
|
+
agentWallet: a.agentWallet,
|
|
99
|
+
x402Enabled: a.x402Enabled,
|
|
100
|
+
totalSpent: ethers_1.ethers.formatUnits(a.totalSpent, 18),
|
|
101
|
+
reputationScore: Number(a.reputationScore),
|
|
102
|
+
active: a.active,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/** Convenience: resolve an agent record straight from its wallet. */
|
|
106
|
+
async getAgentByWallet(wallet) {
|
|
107
|
+
const id = await this.agentIdOf(wallet);
|
|
108
|
+
return id ? this.getAgent(id) : null;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Register the signing wallet as an ERC-8004 agent. Idempotent: returns the
|
|
112
|
+
* existing agentId if already registered (the contract reverts on re-register,
|
|
113
|
+
* so we pre-check walletToAgent).
|
|
114
|
+
*/
|
|
115
|
+
async register(agentURI, supportedFormats, x402Enabled = true) {
|
|
116
|
+
if (!this.signer)
|
|
117
|
+
throw new Error('BioAgentRegistry.register requires a private key (signing mode)');
|
|
118
|
+
const existing = await this.agentIdOf(this.signer.address);
|
|
119
|
+
if (existing > 0) {
|
|
120
|
+
logger_1.Logger.debug(`agent ${this.signer.address} already registered as #${existing}`);
|
|
121
|
+
return { agentId: existing, txHash: null, alreadyRegistered: true };
|
|
122
|
+
}
|
|
123
|
+
const tx = await this.contract.register(agentURI, supportedFormats, x402Enabled);
|
|
124
|
+
const receipt = await tx.wait();
|
|
125
|
+
const agentId = await this.agentIdOf(this.signer.address);
|
|
126
|
+
return { agentId, txHash: receipt?.hash || tx.hash, alreadyRegistered: false };
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Record an x402 payment proof against a BioAsset. msg.sender must be a
|
|
130
|
+
* registered agent (the agent submits proof that it was paid usdcAmount over
|
|
131
|
+
* the dataset identified by bioipId; paymentTxHash is the seqUSDC settlement).
|
|
132
|
+
*
|
|
133
|
+
* bioipId here is the PUBLIC asset identifier keccak256(biocid) — distinct from
|
|
134
|
+
* the salted consent bioipId, which only the BioRouter server can derive.
|
|
135
|
+
*/
|
|
136
|
+
async submitPaymentProof(bioipId, paymentTxHash, chainId, usdcAmount6dec) {
|
|
137
|
+
if (!this.signer)
|
|
138
|
+
throw new Error('submitPaymentProof requires a private key (signing mode)');
|
|
139
|
+
const tx = await this.contract.submitPaymentProof(bioipId, paymentTxHash, chainId, usdcAmount6dec);
|
|
140
|
+
const receipt = await tx.wait();
|
|
141
|
+
let paymentId = null;
|
|
142
|
+
try {
|
|
143
|
+
for (const lg of receipt?.logs || []) {
|
|
144
|
+
const parsed = this.contract.interface.parseLog({ topics: lg.topics, data: lg.data });
|
|
145
|
+
if (parsed?.name === 'PaymentProofSubmitted') {
|
|
146
|
+
paymentId = Number(parsed.args.paymentId);
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch { /* best-effort event parse */ }
|
|
152
|
+
return {
|
|
153
|
+
paymentId,
|
|
154
|
+
bioipId,
|
|
155
|
+
paymentTxHash,
|
|
156
|
+
chainId,
|
|
157
|
+
usdcAmount: ethers_1.ethers.formatUnits(usdcAmount6dec, 6),
|
|
158
|
+
proofTxHash: receipt?.hash || tx.hash,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/** ERC-8004 access request (emits AccessRequested; checks BioRouter consent). */
|
|
162
|
+
async requestBioAssetAccess(bioipId, paymentMethod = 'x402') {
|
|
163
|
+
if (!this.signer)
|
|
164
|
+
throw new Error('requestBioAssetAccess requires a private key (signing mode)');
|
|
165
|
+
const tx = await this.contract.requestBioAssetAccess(bioipId, paymentMethod);
|
|
166
|
+
const receipt = await tx.wait();
|
|
167
|
+
return receipt?.hash || tx.hash;
|
|
168
|
+
}
|
|
169
|
+
/** Highest assigned paymentId (nextPaymentId - 1 = count of proofs submitted). */
|
|
170
|
+
async paymentCount() {
|
|
171
|
+
const next = await this.contract.nextPaymentId();
|
|
172
|
+
return Math.max(0, Number(next) - 1);
|
|
173
|
+
}
|
|
174
|
+
/** Read a payment proof record by id. Read-only. */
|
|
175
|
+
async getPayment(paymentId) {
|
|
176
|
+
const p = await this.contract.payments(paymentId);
|
|
177
|
+
if (Number(p.agentId) === 0 && Number(p.timestamp) === 0)
|
|
178
|
+
return null;
|
|
179
|
+
return {
|
|
180
|
+
agentId: Number(p.agentId),
|
|
181
|
+
bioipId: p.bioipId,
|
|
182
|
+
paymentTxHash: p.paymentTxHash,
|
|
183
|
+
chainId: Number(p.chainId),
|
|
184
|
+
usdcAmount: ethers_1.ethers.formatUnits(p.usdcAmount, 6),
|
|
185
|
+
bioipEquivalent: ethers_1.ethers.formatUnits(p.bioipEquivalent, 18),
|
|
186
|
+
timestamp: Number(p.timestamp),
|
|
187
|
+
verified: p.verified,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Verify a payment proof (onlyOwner): marks it verified and credits the
|
|
192
|
+
* agent's totalSpent with the BIOIP-equivalent. Requires the registry OWNER
|
|
193
|
+
* key (the contract deployer/oracle).
|
|
194
|
+
*/
|
|
195
|
+
async verifyPayment(paymentId) {
|
|
196
|
+
if (!this.signer)
|
|
197
|
+
throw new Error('verifyPayment requires the registry owner private key');
|
|
198
|
+
const tx = await this.contract.verifyPayment(paymentId);
|
|
199
|
+
const receipt = await tx.wait();
|
|
200
|
+
return receipt?.hash || tx.hash;
|
|
201
|
+
}
|
|
202
|
+
/** Public asset identifier for a BioCID (NOT the salted consent bioipId). */
|
|
203
|
+
static assetIdForBiocid(biocid) {
|
|
204
|
+
return ethers_1.ethers.keccak256(ethers_1.ethers.toUtf8Bytes(biocid));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.BioAgentRegistry = BioAgentRegistry;
|
|
208
|
+
exports.default = BioAgentRegistry;
|
|
209
|
+
//# sourceMappingURL=BioAgentRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BioAgentRegistry.js","sourceRoot":"","sources":["../../../src/lib/sequentia/BioAgentRegistry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mCAAgC;AAChC,2CAA6B;AAC7B,mDAAwD;AACxD,4CAAyC;AAEzC,uFAAuF;AAC1E,QAAA,yBAAyB,GACpC,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,4CAA4C,CAAC;AAExF,gFAAgF;AAChF,0DAA0D;AAC1D,MAAM,YAAY,GAAa,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,2CAA2C,CAAC,CAAC,CAAC;AAqB1G,MAAa,gBAAgB;IAM3B,YAAY,UAAmB;QAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,6BAAiB,CAAC,GAAG,CAAC;QACnE,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,iCAAyB,CAAC;QACzC,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,EAAE,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC;YACxE,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC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AC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;QAC3F,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;QAChC,OAAO,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC;IAClC,CAAC;IAED,6EAA6E;IAC7E,MAAM,CAAC,gBAAgB,CAAC,MAAc;QACpC,OAAO,eAAM,CAAC,SAAS,CAAC,eAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IACtD,CAAC;CACF;AA/JD,4CA+JC;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TeleBioinformatics core — shared helpers for biofs stream / pipe / tele.
|
|
3
|
+
*
|
|
4
|
+
* Consent-gated bytes (htsget ticket → HTTP) pipe into local tools without
|
|
5
|
+
* writing vault objects to disk. Heavy compute stays Tier C (biofs annotate /
|
|
6
|
+
* skills); this module is Tier A (analyst laptop).
|
|
7
|
+
*/
|
|
8
|
+
import { ChildProcess } from 'child_process';
|
|
9
|
+
import { parseGenomicRegion, HtsgetKind, HtsgetTicket, DEFAULT_HTSGET_URL, USER_AGENT, streamableExtension } from '../htsget/client';
|
|
10
|
+
export type Layer = 'variants' | 'reads' | 'sequences' | 'unknown';
|
|
11
|
+
export interface TeleCommonOpts {
|
|
12
|
+
kind?: HtsgetKind;
|
|
13
|
+
quiet?: boolean;
|
|
14
|
+
htsgetUrl?: string;
|
|
15
|
+
annotated?: boolean;
|
|
16
|
+
/** Genomic region chr:start-end (forwarded to htsget + client filter when possible) */
|
|
17
|
+
region?: string;
|
|
18
|
+
referenceName?: string;
|
|
19
|
+
start?: number;
|
|
20
|
+
end?: number;
|
|
21
|
+
/** Force raw/byte stream (still via htsget inventory path) */
|
|
22
|
+
raw?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ResolvedTele {
|
|
25
|
+
id: string;
|
|
26
|
+
cleanId: string;
|
|
27
|
+
kind: HtsgetKind;
|
|
28
|
+
layer: Layer;
|
|
29
|
+
signature: string;
|
|
30
|
+
ticket: HtsgetTicket;
|
|
31
|
+
regionQuery: Record<string, string | number | undefined>;
|
|
32
|
+
filenameHint: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function isQuiet(opts: {
|
|
35
|
+
quiet?: boolean;
|
|
36
|
+
}): boolean;
|
|
37
|
+
export declare function which(cmd: string): string | null;
|
|
38
|
+
export declare function requireTool(cmd: string, installHint: string): string;
|
|
39
|
+
export declare function layerFromId(id: string, kind: HtsgetKind): Layer;
|
|
40
|
+
export declare function buildRegionQuery(opts: TeleCommonOpts): Record<string, string | number | undefined>;
|
|
41
|
+
export declare function resolveTele(rawId: string, opts?: TeleCommonOpts): Promise<ResolvedTele>;
|
|
42
|
+
export declare function primaryUrl(ticket: HtsgetTicket): string;
|
|
43
|
+
/** Stream all ticket URLs to stdout (binary-safe). */
|
|
44
|
+
export declare function streamTicketToStdout(ticket: HtsgetTicket, opts?: {
|
|
45
|
+
quiet?: boolean;
|
|
46
|
+
}): void;
|
|
47
|
+
export declare function spawnCurl(url: string): ChildProcess;
|
|
48
|
+
/**
|
|
49
|
+
* curl | tool argv… with stdin from the stream.
|
|
50
|
+
* Resolves with the tool exit code.
|
|
51
|
+
*/
|
|
52
|
+
export declare function pipeUrlToCommand(url: string, command: string, args: string[], opts?: {
|
|
53
|
+
quiet?: boolean;
|
|
54
|
+
label?: string;
|
|
55
|
+
}): Promise<number>;
|
|
56
|
+
/** High-level: resolve id → ticket → pipe into local tool. */
|
|
57
|
+
export declare function telePipe(rawId: string, command: string, args: string[], opts?: TeleCommonOpts & {
|
|
58
|
+
label?: string;
|
|
59
|
+
}): Promise<number>;
|
|
60
|
+
export declare function teleStreamStdout(rawId: string, opts?: TeleCommonOpts): Promise<void>;
|
|
61
|
+
export declare const TOOL_CATALOG: Array<{
|
|
62
|
+
id: string;
|
|
63
|
+
tools: string[];
|
|
64
|
+
layer: Layer | 'any';
|
|
65
|
+
tier: 'A' | 'B' | 'C';
|
|
66
|
+
tele?: string;
|
|
67
|
+
note: string;
|
|
68
|
+
}>;
|
|
69
|
+
export declare function installHint(tool: string): string;
|
|
70
|
+
export { streamableExtension, parseGenomicRegion, DEFAULT_HTSGET_URL, USER_AGENT };
|
|
71
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/lib/tele/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAoB,YAAY,EAAE,MAAM,eAAe,CAAC;AAI/D,OAAO,EAGL,kBAAkB,EAClB,UAAU,EACV,YAAY,EAEZ,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,M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CAAC,CA2BjB;AAED,8DAA8D;AAC9D,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,GAAE,cAAc,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;IACrB,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAyJA,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWhD;AAED,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_AGENT = exports.DEFAULT_HTSGET_URL = exports.parseGenomicRegion = exports.streamableExtension = exports.TOOL_CATALOG = void 0;
|
|
4
|
+
exports.isQuiet = isQuiet;
|
|
5
|
+
exports.which = which;
|
|
6
|
+
exports.requireTool = requireTool;
|
|
7
|
+
exports.layerFromId = layerFromId;
|
|
8
|
+
exports.buildRegionQuery = buildRegionQuery;
|
|
9
|
+
exports.resolveTele = resolveTele;
|
|
10
|
+
exports.primaryUrl = primaryUrl;
|
|
11
|
+
exports.streamTicketToStdout = streamTicketToStdout;
|
|
12
|
+
exports.spawnCurl = spawnCurl;
|
|
13
|
+
exports.pipeUrlToCommand = pipeUrlToCommand;
|
|
14
|
+
exports.telePipe = telePipe;
|
|
15
|
+
exports.teleStreamStdout = teleStreamStdout;
|
|
16
|
+
exports.installHint = installHint;
|
|
17
|
+
/**
|
|
18
|
+
* TeleBioinformatics core — shared helpers for biofs stream / pipe / tele.
|
|
19
|
+
*
|
|
20
|
+
* Consent-gated bytes (htsget ticket → HTTP) pipe into local tools without
|
|
21
|
+
* writing vault objects to disk. Heavy compute stays Tier C (biofs annotate /
|
|
22
|
+
* skills); this module is Tier A (analyst laptop).
|
|
23
|
+
*/
|
|
24
|
+
const child_process_1 = require("child_process");
|
|
25
|
+
const credentials_1 = require("../auth/credentials");
|
|
26
|
+
const client_1 = require("../api/client");
|
|
27
|
+
const store_1 = require("../aliases/store");
|
|
28
|
+
const client_2 = require("../htsget/client");
|
|
29
|
+
Object.defineProperty(exports, "parseGenomicRegion", { enumerable: true, get: function () { return client_2.parseGenomicRegion; } });
|
|
30
|
+
Object.defineProperty(exports, "DEFAULT_HTSGET_URL", { enumerable: true, get: function () { return client_2.DEFAULT_HTSGET_URL; } });
|
|
31
|
+
Object.defineProperty(exports, "USER_AGENT", { enumerable: true, get: function () { return client_2.USER_AGENT; } });
|
|
32
|
+
Object.defineProperty(exports, "streamableExtension", { enumerable: true, get: function () { return client_2.streamableExtension; } });
|
|
33
|
+
function isQuiet(opts) {
|
|
34
|
+
return opts.quiet === true || (opts.quiet !== false && !process.stdout.isTTY);
|
|
35
|
+
}
|
|
36
|
+
function which(cmd) {
|
|
37
|
+
const r = (0, child_process_1.spawnSync)('which', [cmd], { encoding: 'utf8' });
|
|
38
|
+
if (r.status !== 0)
|
|
39
|
+
return null;
|
|
40
|
+
return (r.stdout || '').trim() || null;
|
|
41
|
+
}
|
|
42
|
+
function requireTool(cmd, installHint) {
|
|
43
|
+
const p = which(cmd);
|
|
44
|
+
if (!p) {
|
|
45
|
+
throw new Error(`${cmd} not found on PATH. ${installHint}`);
|
|
46
|
+
}
|
|
47
|
+
return p;
|
|
48
|
+
}
|
|
49
|
+
function layerFromId(id, kind) {
|
|
50
|
+
const lower = id.toLowerCase();
|
|
51
|
+
if (lower.endsWith('.fastq') ||
|
|
52
|
+
lower.endsWith('.fastq.gz') ||
|
|
53
|
+
lower.endsWith('.fq') ||
|
|
54
|
+
lower.endsWith('.fq.gz') ||
|
|
55
|
+
lower.includes('/fastq/')) {
|
|
56
|
+
return 'sequences';
|
|
57
|
+
}
|
|
58
|
+
if (kind === 'reads')
|
|
59
|
+
return 'reads';
|
|
60
|
+
if (lower.endsWith('.vcf') ||
|
|
61
|
+
lower.endsWith('.vcf.gz') ||
|
|
62
|
+
lower.endsWith('.bcf') ||
|
|
63
|
+
lower.endsWith('.g.vcf') ||
|
|
64
|
+
lower.endsWith('.g.vcf.gz') ||
|
|
65
|
+
lower.includes('/vcf/') ||
|
|
66
|
+
lower.includes('/gvcf/')) {
|
|
67
|
+
return 'variants';
|
|
68
|
+
}
|
|
69
|
+
return kind === 'variants' ? 'variants' : 'reads';
|
|
70
|
+
}
|
|
71
|
+
function buildRegionQuery(opts) {
|
|
72
|
+
const q = {};
|
|
73
|
+
if (opts.annotated)
|
|
74
|
+
q.annotated = 'true';
|
|
75
|
+
if (opts.region) {
|
|
76
|
+
const parsed = (0, client_2.parseGenomicRegion)(opts.region);
|
|
77
|
+
if (parsed) {
|
|
78
|
+
q.referenceName = parsed.referenceName;
|
|
79
|
+
if (parsed.start !== undefined)
|
|
80
|
+
q.start = parsed.start;
|
|
81
|
+
if (parsed.end !== undefined)
|
|
82
|
+
q.end = parsed.end;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (opts.referenceName)
|
|
86
|
+
q.referenceName = opts.referenceName;
|
|
87
|
+
if (opts.start !== undefined)
|
|
88
|
+
q.start = opts.start;
|
|
89
|
+
if (opts.end !== undefined)
|
|
90
|
+
q.end = opts.end;
|
|
91
|
+
return q;
|
|
92
|
+
}
|
|
93
|
+
async function resolveTele(rawId, opts = {}) {
|
|
94
|
+
const id = (0, store_1.resolveAlias)(rawId);
|
|
95
|
+
const creds = await credentials_1.CredentialsManager.getInstance().loadCredentials();
|
|
96
|
+
if (!creds?.user_signature) {
|
|
97
|
+
throw new Error('Not authenticated. Run: biofs login');
|
|
98
|
+
}
|
|
99
|
+
let kind = opts.kind ?? 'variants';
|
|
100
|
+
let filenameHint = id;
|
|
101
|
+
if (!opts.kind) {
|
|
102
|
+
try {
|
|
103
|
+
const api = client_1.GenoBankAPIClient.getInstance();
|
|
104
|
+
const bioips = await api.getMyGrantedBioIPs();
|
|
105
|
+
const match = bioips.find((b) => (b.ip_id || '').toLowerCase() === id.toLowerCase());
|
|
106
|
+
if (match?.filename) {
|
|
107
|
+
filenameHint = match.filename;
|
|
108
|
+
kind = (0, client_2.guessKindFromFilename)(match.filename);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
/* inventory-only ids are fine */
|
|
113
|
+
}
|
|
114
|
+
const guessed = (0, client_2.guessKindFromFilename)(id);
|
|
115
|
+
if (guessed)
|
|
116
|
+
kind = guessed;
|
|
117
|
+
// sequences default to reads for htsget path (bytes still stream)
|
|
118
|
+
if (layerFromId(id, kind) === 'sequences')
|
|
119
|
+
kind = 'reads';
|
|
120
|
+
}
|
|
121
|
+
const regionQuery = buildRegionQuery(opts);
|
|
122
|
+
const ticketOpts = {
|
|
123
|
+
baseUrl: opts.htsgetUrl || client_2.DEFAULT_HTSGET_URL,
|
|
124
|
+
query: regionQuery,
|
|
125
|
+
};
|
|
126
|
+
let ticket;
|
|
127
|
+
try {
|
|
128
|
+
ticket = await (0, client_2.getTicket)(kind, id, creds.user_signature, ticketOpts);
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
// Fallback: try the other kind once (filename ambiguity)
|
|
132
|
+
if (!opts.kind) {
|
|
133
|
+
const alt = kind === 'reads' ? 'variants' : 'reads';
|
|
134
|
+
ticket = await (0, client_2.getTicket)(alt, id, creds.user_signature, ticketOpts);
|
|
135
|
+
kind = alt;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
throw e;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const cleanId = id.startsWith('biocid://')
|
|
142
|
+
? id.replace(/\/+$/, '').split('/').pop() || id
|
|
143
|
+
: id;
|
|
144
|
+
return {
|
|
145
|
+
id,
|
|
146
|
+
cleanId,
|
|
147
|
+
kind,
|
|
148
|
+
layer: layerFromId(filenameHint, kind),
|
|
149
|
+
signature: creds.user_signature,
|
|
150
|
+
ticket,
|
|
151
|
+
regionQuery,
|
|
152
|
+
filenameHint,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function primaryUrl(ticket) {
|
|
156
|
+
if (!ticket.urls?.length)
|
|
157
|
+
throw new Error('htsget ticket has no URLs');
|
|
158
|
+
return ticket.urls[0].url;
|
|
159
|
+
}
|
|
160
|
+
/** Stream all ticket URLs to stdout (binary-safe). */
|
|
161
|
+
function streamTicketToStdout(ticket, opts = {}) {
|
|
162
|
+
const quiet = isQuiet(opts);
|
|
163
|
+
if (!quiet) {
|
|
164
|
+
process.stderr.write(`tele stream: format=${ticket.format ?? '?'} urls=${ticket.urls.length}\n`);
|
|
165
|
+
}
|
|
166
|
+
for (const u of ticket.urls) {
|
|
167
|
+
const result = (0, child_process_1.spawnSync)('curl', ['-sSL', '--fail-with-body', '-A', client_2.USER_AGENT, u.url], { stdio: ['ignore', 'inherit', 'inherit'] });
|
|
168
|
+
if (result.status !== 0) {
|
|
169
|
+
throw new Error(`stream failed: curl exit ${result.status}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function spawnCurl(url) {
|
|
174
|
+
return (0, child_process_1.spawn)('curl', ['-sSL', '--fail-with-body', '-A', client_2.USER_AGENT, url], { stdio: ['ignore', 'pipe', 'inherit'] });
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* curl | tool argv… with stdin from the stream.
|
|
178
|
+
* Resolves with the tool exit code.
|
|
179
|
+
*/
|
|
180
|
+
function pipeUrlToCommand(url, command, args, opts = {}) {
|
|
181
|
+
return new Promise((resolve, reject) => {
|
|
182
|
+
if (!isQuiet(opts) && opts.label) {
|
|
183
|
+
process.stderr.write(`${opts.label}\n`);
|
|
184
|
+
}
|
|
185
|
+
const curl = spawnCurl(url);
|
|
186
|
+
const tool = (0, child_process_1.spawn)(command, args, {
|
|
187
|
+
stdio: [curl.stdout, 'inherit', 'inherit'],
|
|
188
|
+
});
|
|
189
|
+
curl.on('error', reject);
|
|
190
|
+
tool.on('error', reject);
|
|
191
|
+
let curlCode = null;
|
|
192
|
+
curl.on('exit', (code) => {
|
|
193
|
+
curlCode = code;
|
|
194
|
+
if (code !== 0 && tool.exitCode === null) {
|
|
195
|
+
tool.kill();
|
|
196
|
+
reject(new Error(`curl failed: exit ${code}`));
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
tool.on('exit', (code) => {
|
|
200
|
+
if (curlCode && curlCode !== 0) {
|
|
201
|
+
resolve(curlCode);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
resolve(code ?? 0);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/** High-level: resolve id → ticket → pipe into local tool. */
|
|
210
|
+
async function telePipe(rawId, command, args, opts = {}) {
|
|
211
|
+
const resolved = await resolveTele(rawId, opts);
|
|
212
|
+
const url = primaryUrl(resolved.ticket);
|
|
213
|
+
const label = opts.label ||
|
|
214
|
+
`tele: ${command} ${args.slice(0, 3).join(' ')}… ← htsget ${resolved.kind}/${resolved.cleanId} (${resolved.ticket.format})`;
|
|
215
|
+
return pipeUrlToCommand(url, command, args, { quiet: opts.quiet, label });
|
|
216
|
+
}
|
|
217
|
+
async function teleStreamStdout(rawId, opts = {}) {
|
|
218
|
+
const resolved = await resolveTele(rawId, opts);
|
|
219
|
+
streamTicketToStdout(resolved.ticket, opts);
|
|
220
|
+
}
|
|
221
|
+
exports.TOOL_CATALOG = [
|
|
222
|
+
{
|
|
223
|
+
id: 'bcftools-stats',
|
|
224
|
+
tools: ['bcftools'],
|
|
225
|
+
layer: 'variants',
|
|
226
|
+
tier: 'A',
|
|
227
|
+
tele: 'tele stats',
|
|
228
|
+
note: 'VCF/BCF summary stats from stream',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: 'bcftools-header',
|
|
232
|
+
tools: ['bcftools'],
|
|
233
|
+
layer: 'variants',
|
|
234
|
+
tier: 'A',
|
|
235
|
+
tele: 'tele header',
|
|
236
|
+
note: 'VCF header only',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: 'bcftools-query',
|
|
240
|
+
tools: ['bcftools'],
|
|
241
|
+
layer: 'variants',
|
|
242
|
+
tier: 'A',
|
|
243
|
+
tele: 'tele query',
|
|
244
|
+
note: 'Custom field extract (-f)',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: 'bcftools-filter',
|
|
248
|
+
tools: ['bcftools'],
|
|
249
|
+
layer: 'variants',
|
|
250
|
+
tier: 'A',
|
|
251
|
+
tele: 'tele filter',
|
|
252
|
+
note: 'Expression filter (-i/-e)',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: 'bcftools-view',
|
|
256
|
+
tools: ['bcftools'],
|
|
257
|
+
layer: 'variants',
|
|
258
|
+
tier: 'A',
|
|
259
|
+
tele: 'tele view / pipe',
|
|
260
|
+
note: 'Generic view; region with -r',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: 'samtools-flagstat',
|
|
264
|
+
tools: ['samtools'],
|
|
265
|
+
layer: 'reads',
|
|
266
|
+
tier: 'A',
|
|
267
|
+
tele: 'tele flagstat',
|
|
268
|
+
note: 'BAM/CRAM flagstat QC',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: 'samtools-stats',
|
|
272
|
+
tools: ['samtools'],
|
|
273
|
+
layer: 'reads',
|
|
274
|
+
tier: 'A',
|
|
275
|
+
tele: 'tele stats',
|
|
276
|
+
note: 'Full samtools stats',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: 'samtools-view',
|
|
280
|
+
tools: ['samtools'],
|
|
281
|
+
layer: 'reads',
|
|
282
|
+
tier: 'A',
|
|
283
|
+
tele: 'tele view / pipe',
|
|
284
|
+
note: 'View/filter SAM lines from stream',
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: 'samtools-count',
|
|
288
|
+
tools: ['samtools'],
|
|
289
|
+
layer: 'reads',
|
|
290
|
+
tier: 'A',
|
|
291
|
+
tele: 'tele count',
|
|
292
|
+
note: 'Count alignments (view -c)',
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: 'seqkit-stats',
|
|
296
|
+
tools: ['seqkit'],
|
|
297
|
+
layer: 'sequences',
|
|
298
|
+
tier: 'A',
|
|
299
|
+
tele: 'tele seqkit',
|
|
300
|
+
note: 'FASTQ/FASTA QC stats',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
id: 'seqtk',
|
|
304
|
+
tools: ['seqtk'],
|
|
305
|
+
layer: 'sequences',
|
|
306
|
+
tier: 'A',
|
|
307
|
+
tele: 'tele seqtk',
|
|
308
|
+
note: 'FASTQ subsample / convert',
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: 'bedtools',
|
|
312
|
+
tools: ['bedtools'],
|
|
313
|
+
layer: 'any',
|
|
314
|
+
tier: 'A',
|
|
315
|
+
tele: 'tele bedtools',
|
|
316
|
+
note: 'Intersect stream with local BED',
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
id: 'igv-desktop',
|
|
320
|
+
tools: ['igv'],
|
|
321
|
+
layer: 'any',
|
|
322
|
+
tier: 'B',
|
|
323
|
+
tele: 'tele igv',
|
|
324
|
+
note: 'Emit ticket URL + IGV batch / web session',
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: 'igvjs',
|
|
328
|
+
tools: [],
|
|
329
|
+
layer: 'any',
|
|
330
|
+
tier: 'B',
|
|
331
|
+
tele: 'tele igv --web',
|
|
332
|
+
note: 'Write local IGV.js HTML session (open in browser)',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: 'jupyter-pysam',
|
|
336
|
+
tools: ['python3'],
|
|
337
|
+
layer: 'any',
|
|
338
|
+
tier: 'A',
|
|
339
|
+
tele: 'tele jupyter',
|
|
340
|
+
note: 'Emit notebook / pysam cell using biofs stream',
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
id: 'vt-normalize',
|
|
344
|
+
tools: ['vt'],
|
|
345
|
+
layer: 'variants',
|
|
346
|
+
tier: 'A',
|
|
347
|
+
tele: 'tele vt',
|
|
348
|
+
note: 'Normalize/decompose VCF stream',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: 'mosdepth',
|
|
352
|
+
tools: ['mosdepth'],
|
|
353
|
+
layer: 'reads',
|
|
354
|
+
tier: 'B',
|
|
355
|
+
tele: 'tele mosdepth',
|
|
356
|
+
note: 'Coverage (prefers indexed BAM; may need fuse)',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
id: 'opencravat',
|
|
360
|
+
tools: [],
|
|
361
|
+
layer: 'variants',
|
|
362
|
+
tier: 'C',
|
|
363
|
+
tele: 'annotate submit',
|
|
364
|
+
note: 'Server-side annotation (not stream-to-laptop)',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
id: 'deepvariant-parabricks',
|
|
368
|
+
tools: [],
|
|
369
|
+
layer: 'reads',
|
|
370
|
+
tier: 'C',
|
|
371
|
+
tele: 'job / pipeline',
|
|
372
|
+
note: 'GPU calling next to data',
|
|
373
|
+
},
|
|
374
|
+
];
|
|
375
|
+
function installHint(tool) {
|
|
376
|
+
const hints = {
|
|
377
|
+
bcftools: 'Install: brew install bcftools or apt install bcftools',
|
|
378
|
+
samtools: 'Install: brew install samtools or apt install samtools',
|
|
379
|
+
seqkit: 'Install: brew install seqkit or conda install -c bioconda seqkit',
|
|
380
|
+
seqtk: 'Install: brew install seqtk or conda install -c bioconda seqtk',
|
|
381
|
+
bedtools: 'Install: brew install bedtools or apt install bedtools',
|
|
382
|
+
vt: 'Install: brew install vt or conda install -c bioconda vt',
|
|
383
|
+
mosdepth: 'Install: conda install -c bioconda mosdepth',
|
|
384
|
+
};
|
|
385
|
+
return hints[tool] || `Install ${tool} and ensure it is on PATH`;
|
|
386
|
+
}
|
|
387
|
+
//# sourceMappingURL=core.js.map
|