@genobank/biofs 2.6.2 → 3.0.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 +57 -0
- package/dist/commands/alias.d.ts +9 -0
- package/dist/commands/alias.d.ts.map +1 -0
- package/dist/commands/alias.js +56 -0
- package/dist/commands/alias.js.map +1 -0
- package/dist/commands/ancestry/compare.d.ts +9 -0
- package/dist/commands/ancestry/compare.d.ts.map +1 -0
- package/dist/commands/ancestry/compare.js +139 -0
- package/dist/commands/ancestry/compare.js.map +1 -0
- package/dist/commands/ancestry/results.d.ts +13 -0
- package/dist/commands/ancestry/results.d.ts.map +1 -0
- package/dist/commands/ancestry/results.js +123 -0
- package/dist/commands/ancestry/results.js.map +1 -0
- package/dist/commands/ancestry/run.d.ts +18 -0
- package/dist/commands/ancestry/run.d.ts.map +1 -0
- package/dist/commands/ancestry/run.js +171 -0
- package/dist/commands/ancestry/run.js.map +1 -0
- package/dist/commands/ancestry/status.d.ts +8 -0
- package/dist/commands/ancestry/status.d.ts.map +1 -0
- package/dist/commands/ancestry/status.js +59 -0
- package/dist/commands/ancestry/status.js.map +1 -0
- package/dist/commands/htsget.d.ts +8 -0
- package/dist/commands/htsget.d.ts.map +1 -0
- package/dist/commands/htsget.js +43 -0
- package/dist/commands/htsget.js.map +1 -0
- package/dist/commands/pipe.d.ts +8 -0
- package/dist/commands/pipe.d.ts.map +1 -0
- package/dist/commands/pipe.js +76 -0
- package/dist/commands/pipe.js.map +1 -0
- package/dist/commands/stream.d.ts +9 -0
- package/dist/commands/stream.d.ts.map +1 -0
- package/dist/commands/stream.js +58 -0
- package/dist/commands/stream.js.map +1 -0
- package/dist/index.js +170 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/aliases/store.d.ts +7 -0
- package/dist/lib/aliases/store.d.ts.map +1 -0
- package/dist/lib/aliases/store.js +83 -0
- package/dist/lib/aliases/store.js.map +1 -0
- package/dist/lib/ancestry/somos-client.d.ts +64 -0
- package/dist/lib/ancestry/somos-client.d.ts.map +1 -0
- package/dist/lib/ancestry/somos-client.js +121 -0
- package/dist/lib/ancestry/somos-client.js.map +1 -0
- package/dist/lib/htsget/client.d.ts +54 -0
- package/dist/lib/htsget/client.d.ts.map +1 -0
- package/dist/lib/htsget/client.js +76 -0
- package/dist/lib/htsget/client.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/ancestry/run.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBH,gDAiGC;AApHD,kDAA0B;AAC1B,8CAAsB;AACtB,6CAA+B;AAC/B,4DAAgE;AAChE,mDAAgD;AAChD,kEAIyC;AAUlC,KAAK,UAAU,kBAAkB,CACtC,OAAe,EACf,UAA8B,EAAE;IAEhC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACpC,eAAM,CAAC,KAAK,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,gCAAkB,CAAC,WAAW,EAAE,CAAC,eAAe,EAAE,CAAC;IACvE,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAC9B,eAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,KAAM,CAAC,cAAc,CAAC;IAEvD,MAAM,MAAM,GAAG,IAAI,0BAAW,EAAE,CAAC;IACjC,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,8BAA8B,CAAC,CAAC,KAAK,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,CAAC;IAC5C,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/ancestry/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* biofs ancestry status <task_id>
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ancestryStatusCommand = ancestryStatusCommand;
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const logger_1 = require("../../lib/utils/logger");
|
|
12
|
+
const somos_client_1 = require("../../lib/ancestry/somos-client");
|
|
13
|
+
async function ancestryStatusCommand(taskId, options = {}) {
|
|
14
|
+
try {
|
|
15
|
+
const s = await new somos_client_1.SomosClient().status(taskId);
|
|
16
|
+
if (options.json) {
|
|
17
|
+
console.log(JSON.stringify(s, null, 2));
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (!s.success) {
|
|
21
|
+
logger_1.Logger.error(`Error: ${s.error}`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
console.log('');
|
|
25
|
+
console.log(chalk_1.default.bold(`Somos Ancestry v${s.version} — ${taskId}`));
|
|
26
|
+
console.log(` status: ${statusColor(s.status)}`);
|
|
27
|
+
if (s.created_at)
|
|
28
|
+
console.log(` created: ${s.created_at}`);
|
|
29
|
+
if (s.started_at)
|
|
30
|
+
console.log(` started: ${s.started_at}`);
|
|
31
|
+
if (s.stopped_at)
|
|
32
|
+
console.log(` stopped: ${s.stopped_at}`);
|
|
33
|
+
if (s.exit_code !== undefined)
|
|
34
|
+
console.log(` exit_code: ${s.exit_code}`);
|
|
35
|
+
if (s.error)
|
|
36
|
+
console.log(` error: ${chalk_1.default.red(s.error)}`);
|
|
37
|
+
if (s.results) {
|
|
38
|
+
console.log('');
|
|
39
|
+
console.log(chalk_1.default.bold('Results (gs:// URIs)'));
|
|
40
|
+
for (const [k, v] of Object.entries(s.results)) {
|
|
41
|
+
console.log(` ${k.padEnd(8)} ${chalk_1.default.gray(v)}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
logger_1.Logger.error(`status failed: ${e.response?.data?.error || e.message}`);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function statusColor(s) {
|
|
51
|
+
if (s === 'STOPPED')
|
|
52
|
+
return chalk_1.default.green(s);
|
|
53
|
+
if (s === 'RUNNING')
|
|
54
|
+
return chalk_1.default.yellow(s);
|
|
55
|
+
if (s === 'PENDING')
|
|
56
|
+
return chalk_1.default.cyan(s);
|
|
57
|
+
return chalk_1.default.gray(s);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=status.js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C,CAAC,CAAC;IAC1C,OAAO,eAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HtsgetKind } from '../lib/htsget/client';
|
|
2
|
+
export declare function htsgetServiceInfoCommand(opts?: {
|
|
3
|
+
json?: boolean;
|
|
4
|
+
}): Promise<void>;
|
|
5
|
+
export declare function htsgetTicketCommand(kind: HtsgetKind, rawId: string, opts?: {
|
|
6
|
+
json?: boolean;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=htsget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htsget.d.ts","sourceRoot":"","sources":["../../src/commands/htsget.ts"],"names":[],"mappings":"AAYA,OAAO,EAA6B,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE7E,wBAAsB,wBAAwB,CAAC,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAc3F;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5B,OAAO,CAAC,IAAI,CAAC,CASf"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.htsgetServiceInfoCommand = htsgetServiceInfoCommand;
|
|
4
|
+
exports.htsgetTicketCommand = htsgetTicketCommand;
|
|
5
|
+
/**
|
|
6
|
+
* `biofs htsget` — low-level GA4GH htsget operations.
|
|
7
|
+
*
|
|
8
|
+
* biofs htsget service-info # show endpoint metadata
|
|
9
|
+
* biofs htsget ticket variants|reads <id> # fetch raw ticket JSON
|
|
10
|
+
*
|
|
11
|
+
* For day-to-day use, prefer `biofs stream` or `biofs view` which hide the
|
|
12
|
+
* ticket dance. This command is here for debugging + scripting.
|
|
13
|
+
*/
|
|
14
|
+
const credentials_1 = require("../lib/auth/credentials");
|
|
15
|
+
const logger_1 = require("../lib/utils/logger");
|
|
16
|
+
const store_1 = require("../lib/aliases/store");
|
|
17
|
+
const client_1 = require("../lib/htsget/client");
|
|
18
|
+
async function htsgetServiceInfoCommand(opts = {}) {
|
|
19
|
+
const info = await (0, client_1.getServiceInfo)();
|
|
20
|
+
if (opts.json) {
|
|
21
|
+
process.stdout.write(JSON.stringify(info, null, 2) + '\n');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
console.log(`htsget service: ${info.name} (${info.version})`);
|
|
25
|
+
console.log(` id: ${info.id}`);
|
|
26
|
+
console.log(` org: ${info.organization?.name ?? ''} ${info.organization?.url ?? ''}`);
|
|
27
|
+
console.log(` description: ${info.description ?? ''}`);
|
|
28
|
+
if (info.htsget) {
|
|
29
|
+
console.log(` datatypes: ${(info.htsget.datatype ?? []).join(', ')}`);
|
|
30
|
+
console.log(` formats: ${(info.htsget.formats ?? []).join(', ')}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function htsgetTicketCommand(kind, rawId, opts = {}) {
|
|
34
|
+
const id = (0, store_1.resolveAlias)(rawId);
|
|
35
|
+
const creds = await credentials_1.CredentialsManager.getInstance().loadCredentials();
|
|
36
|
+
if (!creds) {
|
|
37
|
+
logger_1.Logger.error('Not authenticated. Run: biofs login');
|
|
38
|
+
process.exit(3);
|
|
39
|
+
}
|
|
40
|
+
const ticket = await (0, client_1.getTicket)(kind, id, creds.user_signature);
|
|
41
|
+
process.stdout.write(JSON.stringify({ htsget: ticket }, null, 2) + '\n');
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=htsget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htsget.js","sourceRoot":"","sources":["../../src/commands/htsget.ts"],"names":[],"mappings":";;AAcA,4DAcC;AAED,kDAaC;AA3CD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AY,EAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAM,gCAAkB,CAAC,WAAW,EAAE,CAAC,eAAe,EAAE,CAAC;IACvE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,eAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC/D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe.d.ts","sourceRoot":"","sources":["../../src/commands/pipe.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6DzF"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pipeCommand = pipeCommand;
|
|
4
|
+
/**
|
|
5
|
+
* `biofs pipe <id> -- [tool args]` — pipe a BioIP stream into bcftools/samtools view.
|
|
6
|
+
*
|
|
7
|
+
* Auto-detects the right tool from the registered filename:
|
|
8
|
+
* .vcf/.vcf.gz/.bcf → bcftools view
|
|
9
|
+
* .bam/.cram/.sam → samtools view
|
|
10
|
+
*
|
|
11
|
+
* Any args after `--` pass through to the tool:
|
|
12
|
+
* biofs view my-wes -- -H -r chr17:1000000-2000000
|
|
13
|
+
*/
|
|
14
|
+
const child_process_1 = require("child_process");
|
|
15
|
+
const credentials_1 = require("../lib/auth/credentials");
|
|
16
|
+
const client_1 = require("../lib/api/client");
|
|
17
|
+
const logger_1 = require("../lib/utils/logger");
|
|
18
|
+
const store_1 = require("../lib/aliases/store");
|
|
19
|
+
const client_2 = require("../lib/htsget/client");
|
|
20
|
+
function detectTool(filename) {
|
|
21
|
+
const f = filename.toLowerCase();
|
|
22
|
+
if (f.endsWith('.vcf') || f.endsWith('.vcf.gz') || f.endsWith('.bcf'))
|
|
23
|
+
return 'bcftools';
|
|
24
|
+
if (f.endsWith('.bam') || f.endsWith('.cram') || f.endsWith('.sam'))
|
|
25
|
+
return 'samtools';
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
async function pipeCommand(rawId, options = {}) {
|
|
29
|
+
const id = (0, store_1.resolveAlias)(rawId);
|
|
30
|
+
const creds = await credentials_1.CredentialsManager.getInstance().loadCredentials();
|
|
31
|
+
if (!creds) {
|
|
32
|
+
logger_1.Logger.error('Not authenticated. Run: biofs login');
|
|
33
|
+
process.exit(3);
|
|
34
|
+
}
|
|
35
|
+
// Look up filename to pick the right tool
|
|
36
|
+
const api = client_1.GenoBankAPIClient.getInstance();
|
|
37
|
+
let filename;
|
|
38
|
+
try {
|
|
39
|
+
const bioips = await api.getMyGrantedBioIPs();
|
|
40
|
+
const match = bioips.find((b) => (b.ip_id || '').toLowerCase() === id.toLowerCase());
|
|
41
|
+
filename = match?.filename;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// proceed with user override only
|
|
45
|
+
}
|
|
46
|
+
const tool = options.tool ?? (filename ? detectTool(filename) : null);
|
|
47
|
+
if (!tool) {
|
|
48
|
+
logger_1.Logger.error(`no bioinformatics tool detected for ${filename ?? id} — pass --tool bcftools|samtools`);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
const kind = filename ? (0, client_2.guessKindFromFilename)(filename) : 'variants';
|
|
52
|
+
const ticket = await (0, client_2.getTicket)(kind, id, creds.user_signature, {
|
|
53
|
+
baseUrl: options.htsgetUrl,
|
|
54
|
+
});
|
|
55
|
+
if (ticket.urls.length !== 1) {
|
|
56
|
+
logger_1.Logger.warn(`ticket has ${ticket.urls.length} URLs; view only pipes the first (multi-URL concat is streamCommand's job)`);
|
|
57
|
+
}
|
|
58
|
+
const url = ticket.urls[0].url;
|
|
59
|
+
if (!options.quiet) {
|
|
60
|
+
logger_1.Logger.info(`piping htsget (${ticket.format}) into ${tool} view …`);
|
|
61
|
+
}
|
|
62
|
+
// curl | tool view <extraArgs> -
|
|
63
|
+
const curl = (0, child_process_1.spawn)('curl', ['-sSL', '--fail-with-body', '-A', 'biofs/2.7.0 (+https://genobank.io)', url], { stdio: ['ignore', 'pipe', 'inherit'] });
|
|
64
|
+
const toolArgs = ['view', ...(options.extra ?? []), '-'];
|
|
65
|
+
const toolProc = (0, child_process_1.spawn)(tool, toolArgs, { stdio: [curl.stdout, 'inherit', 'inherit'] });
|
|
66
|
+
toolProc.on('exit', (code) => {
|
|
67
|
+
process.exit(code ?? 0);
|
|
68
|
+
});
|
|
69
|
+
curl.on('exit', (code) => {
|
|
70
|
+
if (code !== 0 && toolProc.exitCode === null) {
|
|
71
|
+
logger_1.Logger.error(`curl failed: exit ${code}`);
|
|
72
|
+
toolProc.kill();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=pipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe.js","sourceRoot":"","sources":["../../src/commands/pipe.ts"],"names":[],"mappings":";;AA+BA,kCA6DC;AA5FD;;;;;;;;;GASG;AACH,iDAAsC;AACtC,yDAA6D;AAC7D,8CAAsD;AACtD,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CACzC,CAAC;IACF,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,IAAA,qBAAK,EAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,MAAO,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAExF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACvB,IAAI,IAAI,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC7C,eAAM,CAAC,KAAK,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;YAC1C,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HtsgetKind } from '../lib/htsget/client';
|
|
2
|
+
export interface StreamOptions {
|
|
3
|
+
kind?: HtsgetKind;
|
|
4
|
+
quiet?: boolean;
|
|
5
|
+
apiUrl?: string;
|
|
6
|
+
htsgetUrl?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function streamCommand(rawId: string, options?: StreamOptions): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/commands/stream.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAoC,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpF,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4C7F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.streamCommand = streamCommand;
|
|
4
|
+
/**
|
|
5
|
+
* `biofs stream <id>` — stream a BioNFT-gated VCF/BAM to stdout via htsget.
|
|
6
|
+
*
|
|
7
|
+
* Pipes cleanly into bcftools/samtools/pysam:
|
|
8
|
+
*
|
|
9
|
+
* biofs stream 0xCCe… | bcftools stats -
|
|
10
|
+
* biofs stream my-wes | bcftools view -H -
|
|
11
|
+
*
|
|
12
|
+
* Auto-detects 'variants' vs 'reads' from the registered filename; override
|
|
13
|
+
* with --kind.
|
|
14
|
+
*/
|
|
15
|
+
const child_process_1 = require("child_process");
|
|
16
|
+
const credentials_1 = require("../lib/auth/credentials");
|
|
17
|
+
const client_1 = require("../lib/api/client");
|
|
18
|
+
const logger_1 = require("../lib/utils/logger");
|
|
19
|
+
const store_1 = require("../lib/aliases/store");
|
|
20
|
+
const client_2 = require("../lib/htsget/client");
|
|
21
|
+
async function streamCommand(rawId, options = {}) {
|
|
22
|
+
const id = (0, store_1.resolveAlias)(rawId);
|
|
23
|
+
const creds = await credentials_1.CredentialsManager.getInstance().loadCredentials();
|
|
24
|
+
if (!creds) {
|
|
25
|
+
logger_1.Logger.error('Not authenticated. Run: biofs login');
|
|
26
|
+
process.exit(3);
|
|
27
|
+
}
|
|
28
|
+
// Figure out the kind: user override > filename extension
|
|
29
|
+
let kind = options.kind ?? 'variants';
|
|
30
|
+
if (!options.kind) {
|
|
31
|
+
try {
|
|
32
|
+
const api = client_1.GenoBankAPIClient.getInstance();
|
|
33
|
+
const bioips = await api.getMyGrantedBioIPs();
|
|
34
|
+
const match = bioips.find((b) => (b.ip_id || '').toLowerCase() === id.toLowerCase());
|
|
35
|
+
if (match?.filename) {
|
|
36
|
+
kind = (0, client_2.guessKindFromFilename)(match.filename);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// fall through with default
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const ticket = await (0, client_2.getTicket)(kind, id, creds.user_signature, {
|
|
44
|
+
baseUrl: options.htsgetUrl,
|
|
45
|
+
});
|
|
46
|
+
if (!options.quiet) {
|
|
47
|
+
logger_1.Logger.info(`htsget ticket: format=${ticket.format} urls=${ticket.urls.length}`);
|
|
48
|
+
}
|
|
49
|
+
// Stream each URL into stdout in order (curl is on every bio platform).
|
|
50
|
+
for (const u of ticket.urls) {
|
|
51
|
+
const result = (0, child_process_1.spawnSync)('curl', ['-sSL', '--fail-with-body', '-A', 'biofs/2.7.0 (+https://genobank.io)', u.url], { stdio: ['ignore', 'inherit', 'inherit'] });
|
|
52
|
+
if (result.status !== 0) {
|
|
53
|
+
logger_1.Logger.error(`stream failed: curl exit ${result.status}`);
|
|
54
|
+
process.exit(result.status ?? 6);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/commands/stream.ts"],"names":[],"mappings":";;AAyBA,sCA4CC;AArED;;;;;;;;;;GAUG;AACH,iDAA0C;AAC1C,yDAA6D;AAC7D,8CAAsD;AACtD,gDAA6C;AAC7C,gDAAoD;AACpD,iDAAoF;AAS7E,KAAK,UAAU,aAAa,CAAC,KAAa,EAAE,UAAyB,EAAE;IAC5E,MAAM,EAAE,GAAG,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC;IAE/B,MAAM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AAI,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,IAAA,yBAAS,EACtB,MAAM,EACN,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,oCAAoC,EAAE,CAAC,CAAC,GAAG,CAAC,EAC/E,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAC5C,CAAC;QACF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,eAAM,CAAC,KAAK,CAAC,4BAA4B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YAC1D,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -31,15 +31,24 @@ const status_1 = require("./commands/job/status");
|
|
|
31
31
|
const results_1 = require("./commands/job/results");
|
|
32
32
|
const list_2 = require("./commands/job/list");
|
|
33
33
|
const pipelines_1 = require("./commands/job/pipelines");
|
|
34
|
+
// v2.7.0: htsget + smart streaming + aliases
|
|
35
|
+
const stream_1 = require("./commands/stream");
|
|
36
|
+
const pipe_1 = require("./commands/pipe");
|
|
37
|
+
const alias_1 = require("./commands/alias");
|
|
38
|
+
const htsget_1 = require("./commands/htsget");
|
|
34
39
|
const submit_clara_1 = require("./commands/job/submit-clara");
|
|
35
40
|
const create_2 = require("./commands/context/create");
|
|
36
41
|
const publish_1 = require("./commands/context/publish");
|
|
37
42
|
const verify_1 = require("./commands/context/verify");
|
|
38
43
|
const revoke_2 = require("./commands/context/revoke");
|
|
44
|
+
const run_1 = require("./commands/ancestry/run");
|
|
45
|
+
const status_2 = require("./commands/ancestry/status");
|
|
46
|
+
const results_2 = require("./commands/ancestry/results");
|
|
47
|
+
const compare_1 = require("./commands/ancestry/compare");
|
|
39
48
|
const health_1 = require("./commands/agent/health");
|
|
40
49
|
const register_1 = require("./commands/agent/register");
|
|
41
50
|
const list_3 = require("./commands/agent/list");
|
|
42
|
-
const
|
|
51
|
+
const status_3 = require("./commands/agent/status");
|
|
43
52
|
const list_4 = require("./commands/labs/list");
|
|
44
53
|
const share_1 = require("./commands/share");
|
|
45
54
|
const shares_1 = require("./commands/shares");
|
|
@@ -51,7 +60,7 @@ const report_1 = require("./commands/report");
|
|
|
51
60
|
const admin_1 = require("./commands/admin");
|
|
52
61
|
const fuse_1 = require("./commands/fuse");
|
|
53
62
|
const submit_1 = require("./commands/annotate/submit");
|
|
54
|
-
const
|
|
63
|
+
const status_4 = require("./commands/annotate/status");
|
|
55
64
|
const balance_1 = require("./commands/payment/balance");
|
|
56
65
|
const pricing_1 = require("./commands/payment/pricing");
|
|
57
66
|
const setup_1 = require("./commands/payment/setup");
|
|
@@ -62,8 +71,8 @@ const program = new commander_1.Command();
|
|
|
62
71
|
// Set up the CLI
|
|
63
72
|
program
|
|
64
73
|
.name('biofs')
|
|
65
|
-
.description('BioFS by GenoBank.io - BioNFT-Gated
|
|
66
|
-
.version('
|
|
74
|
+
.description('BioFS by GenoBank.io - BioNFT-Gated GCS CLI for genomic data + ancestry + BioContext manifests')
|
|
75
|
+
.version('3.0.0')
|
|
67
76
|
.option('--debug', 'Enable debug output')
|
|
68
77
|
.hook('preAction', (thisCommand) => {
|
|
69
78
|
// Set global debug flag if --debug is passed
|
|
@@ -319,6 +328,100 @@ program
|
|
|
319
328
|
process.exit(1);
|
|
320
329
|
}
|
|
321
330
|
});
|
|
331
|
+
// ========================================================================
|
|
332
|
+
// v2.7.0 — htsget + smart streaming + aliases (Sprint 6)
|
|
333
|
+
// ========================================================================
|
|
334
|
+
// Mac researchers stream BioNFT-gated VCFs/BAMs through the tools they
|
|
335
|
+
// already use (bcftools, samtools, pysam, IGV) with zero FUSE, zero kext.
|
|
336
|
+
// `stream` / `view` are the day-to-day commands; `htsget` is for debugging.
|
|
337
|
+
// stream - htsget stream to stdout (pipes into any bioinformatics tool)
|
|
338
|
+
program
|
|
339
|
+
.command('stream <id>')
|
|
340
|
+
.description('Stream a BioNFT-gated VCF/BAM to stdout via htsget (pipe into bcftools/samtools/pysam)')
|
|
341
|
+
.option('--kind <variants|reads>', 'force datatype (default: auto-detect from filename)')
|
|
342
|
+
.option('--htsget-url <url>', 'override htsget endpoint (default: https://htsget.genobank.app)')
|
|
343
|
+
.option('-q, --quiet', 'suppress info messages')
|
|
344
|
+
.action(async (id, options) => {
|
|
345
|
+
try {
|
|
346
|
+
await (0, stream_1.streamCommand)(id, options);
|
|
347
|
+
}
|
|
348
|
+
catch (error) {
|
|
349
|
+
logger_1.Logger.error(`stream failed: ${error?.message || error}`);
|
|
350
|
+
process.exit(6);
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
// pipe - auto-pipe htsget stream into bcftools/samtools view
|
|
354
|
+
// (distinct from the existing `view` command, which prints file content)
|
|
355
|
+
program
|
|
356
|
+
.command('pipe <id>')
|
|
357
|
+
.description('Pipe a BioIP stream into bcftools view (VCF) or samtools view (BAM) automatically')
|
|
358
|
+
.option('--tool <bcftools|samtools>', 'force tool (default: auto-detect from filename)')
|
|
359
|
+
.option('--htsget-url <url>', 'override htsget endpoint')
|
|
360
|
+
.option('-q, --quiet', 'suppress info messages')
|
|
361
|
+
.allowUnknownOption(true)
|
|
362
|
+
.action(async (id, options, cmd) => {
|
|
363
|
+
try {
|
|
364
|
+
// Everything after `--` is passed through to bcftools/samtools view
|
|
365
|
+
const extra = cmd.args.slice(cmd.args.indexOf(id) + 1);
|
|
366
|
+
await (0, pipe_1.pipeCommand)(id, { ...options, extra });
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
logger_1.Logger.error(`pipe failed: ${error?.message || error}`);
|
|
370
|
+
process.exit(6);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
// alias - manage local shortcuts for ip_ids / BioCIDs
|
|
374
|
+
program
|
|
375
|
+
.command('alias [name] [target]')
|
|
376
|
+
.description('Manage local aliases for ip_ids (e.g. `biofs alias my-wes 0xCCe14315…`)')
|
|
377
|
+
.option('--list', 'list all aliases (default when no args)')
|
|
378
|
+
.option('--remove <name>', 'remove alias by name')
|
|
379
|
+
.option('--json', 'emit JSON')
|
|
380
|
+
.action(async (name, target, options) => {
|
|
381
|
+
try {
|
|
382
|
+
await (0, alias_1.aliasCommand)({ ...options, name, target });
|
|
383
|
+
}
|
|
384
|
+
catch (error) {
|
|
385
|
+
logger_1.Logger.error(`alias failed: ${error?.message || error}`);
|
|
386
|
+
process.exit(1);
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
// htsget - low-level GA4GH htsget operations (service-info, ticket)
|
|
390
|
+
const htsgetCmd = program
|
|
391
|
+
.command('htsget')
|
|
392
|
+
.description('Low-level GA4GH htsget operations (see `biofs stream`/`view` for day-to-day use)');
|
|
393
|
+
htsgetCmd
|
|
394
|
+
.command('service-info')
|
|
395
|
+
.description('Show htsget endpoint metadata (GA4GH service-info)')
|
|
396
|
+
.option('--json', 'emit JSON')
|
|
397
|
+
.action(async (options) => {
|
|
398
|
+
try {
|
|
399
|
+
await (0, htsget_1.htsgetServiceInfoCommand)(options);
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
logger_1.Logger.error(`service-info failed: ${error?.message || error}`);
|
|
403
|
+
process.exit(6);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
htsgetCmd
|
|
407
|
+
.command('ticket <kind> <id>')
|
|
408
|
+
.description('Fetch a raw htsget ticket for debugging (kind = variants | reads)')
|
|
409
|
+
.action(async (kind, id) => {
|
|
410
|
+
try {
|
|
411
|
+
if (kind !== 'variants' && kind !== 'reads') {
|
|
412
|
+
logger_1.Logger.error(`kind must be 'variants' or 'reads' (got '${kind}')`);
|
|
413
|
+
process.exit(2);
|
|
414
|
+
}
|
|
415
|
+
await (0, htsget_1.htsgetTicketCommand)(kind, id);
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
logger_1.Logger.error(`ticket failed: ${error?.message || error}`);
|
|
419
|
+
process.exit(6);
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
// ========================================================================
|
|
423
|
+
// (end v2.7.0 block)
|
|
424
|
+
// ========================================================================
|
|
322
425
|
// Tokenize command group - BioNFT minting on Sequentia
|
|
323
426
|
const tokenizeCmd = program
|
|
324
427
|
.command('tokenize')
|
|
@@ -449,7 +552,7 @@ annotateCmd
|
|
|
449
552
|
.option('--json', 'Output as JSON')
|
|
450
553
|
.action(async (jobId, options) => {
|
|
451
554
|
try {
|
|
452
|
-
await (0,
|
|
555
|
+
await (0, status_4.annotateStatusCommand)(jobId, options);
|
|
453
556
|
}
|
|
454
557
|
catch (error) {
|
|
455
558
|
logger_1.Logger.error(`Status check failed: ${error}`);
|
|
@@ -593,7 +696,7 @@ agentCmd
|
|
|
593
696
|
.option('--json', 'Output as JSON')
|
|
594
697
|
.action(async (options) => {
|
|
595
698
|
try {
|
|
596
|
-
await (0,
|
|
699
|
+
await (0, status_3.agentStatusCommand)(options);
|
|
597
700
|
}
|
|
598
701
|
catch (error) {
|
|
599
702
|
logger_1.Logger.error(`Agent status check failed: ${error}`);
|
|
@@ -758,6 +861,67 @@ contextCmd
|
|
|
758
861
|
process.exit(1);
|
|
759
862
|
}
|
|
760
863
|
});
|
|
864
|
+
// Somos Ancestry commands (v3.0.0 — K=24 ADMIXTURE supervised on Sequentia GCS)
|
|
865
|
+
const ancestryCmd = program
|
|
866
|
+
.command('ancestry')
|
|
867
|
+
.description('Run Somos K=24 ancestry pipeline (PLINK + ADMIXTURE supervised, 781 refs, 24 pops)');
|
|
868
|
+
ancestryCmd
|
|
869
|
+
.command('run <dtc_file>')
|
|
870
|
+
.description('Upload a DTC genotype file and trigger ancestry analysis')
|
|
871
|
+
.option('--user-id <id>', 'User identifier (defaults to wallet from biofs login)')
|
|
872
|
+
.option('--wait', 'Poll until done, then print results')
|
|
873
|
+
.option('--poll-seconds <n>', 'Polling interval (default 30)', '30')
|
|
874
|
+
.option('--callback-url <url>', 'Webhook to POST results to when complete')
|
|
875
|
+
.option('--json', 'Emit JSON when --wait finishes')
|
|
876
|
+
.action(async (dtcFile, opts) => {
|
|
877
|
+
try {
|
|
878
|
+
await (0, run_1.ancestryRunCommand)(dtcFile, opts);
|
|
879
|
+
}
|
|
880
|
+
catch (e) {
|
|
881
|
+
logger_1.Logger.error(`ancestry run failed: ${e}`);
|
|
882
|
+
process.exit(1);
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
ancestryCmd
|
|
886
|
+
.command('status <task_id>')
|
|
887
|
+
.description('Check pipeline status for a task')
|
|
888
|
+
.option('--json', 'Output as JSON')
|
|
889
|
+
.action(async (taskId, opts) => {
|
|
890
|
+
try {
|
|
891
|
+
await (0, status_2.ancestryStatusCommand)(taskId, opts);
|
|
892
|
+
}
|
|
893
|
+
catch (e) {
|
|
894
|
+
logger_1.Logger.error(`ancestry status failed: ${e}`);
|
|
895
|
+
process.exit(1);
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
ancestryCmd
|
|
899
|
+
.command('results <task_id>')
|
|
900
|
+
.description('Fetch and pretty-print ancestry results (24 populations + 5-region rollup)')
|
|
901
|
+
.option('--download <dir>', 'Download all artifacts (CSV, JSON, summary) to <dir>')
|
|
902
|
+
.option('--summary', 'Only print the 5-region rollup')
|
|
903
|
+
.option('--json', 'Output as JSON')
|
|
904
|
+
.action(async (taskId, opts) => {
|
|
905
|
+
try {
|
|
906
|
+
await (0, results_2.ancestryResultsCommand)(taskId, opts);
|
|
907
|
+
}
|
|
908
|
+
catch (e) {
|
|
909
|
+
logger_1.Logger.error(`ancestry results failed: ${e}`);
|
|
910
|
+
process.exit(1);
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
ancestryCmd
|
|
914
|
+
.command('compare <task_id> <reference_csv>')
|
|
915
|
+
.description('Compare this task\'s result against a baseline CSV (e.g. LANGEBIO K=36 regrouped)')
|
|
916
|
+
.action(async (taskId, referenceCsv) => {
|
|
917
|
+
try {
|
|
918
|
+
await (0, compare_1.ancestryCompareCommand)(taskId, referenceCsv);
|
|
919
|
+
}
|
|
920
|
+
catch (e) {
|
|
921
|
+
logger_1.Logger.error(`ancestry compare failed: ${e}`);
|
|
922
|
+
process.exit(1);
|
|
923
|
+
}
|
|
924
|
+
});
|
|
761
925
|
// Job management commands (BioOS)
|
|
762
926
|
const jobCmd = program
|
|
763
927
|
.command('job')
|