@jbrowse/cli 1.5.1 → 1.5.2
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/README.md +10 -10
- package/lib/commands/add-assembly.js +5 -5
- package/lib/commands/add-track.d.ts +79 -7
- package/lib/commands/add-track.js +45 -66
- package/oclif.manifest.json +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ id: cli
|
|
|
4
4
|
toplevel: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
This document covers the CLI tools.
|
|
7
|
+
This document covers the CLI tools. Note: for @jbrowse/img static export tool, see https://www.npmjs.com/package/@jbrowse/img
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -157,7 +157,7 @@ EXAMPLES
|
|
|
157
157
|
$ jbrowse add-assembly myfile.fa.gz --load copy
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
_See code: [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
160
|
+
_See code: [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/add-assembly.ts)_
|
|
161
161
|
|
|
162
162
|
## `jbrowse add-connection CONNECTIONURLORPATH`
|
|
163
163
|
|
|
@@ -211,7 +211,7 @@ EXAMPLES
|
|
|
211
211
|
/path/to/jb2/installation/config.json
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
_See code: [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
214
|
+
_See code: [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/add-connection.ts)_
|
|
215
215
|
|
|
216
216
|
## `jbrowse add-track TRACK`
|
|
217
217
|
|
|
@@ -285,7 +285,7 @@ EXAMPLES
|
|
|
285
285
|
$ jbrowse add-track /url/relative/path.bam --load inPlace
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
-
_See code: [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
288
|
+
_See code: [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/add-track.ts)_
|
|
289
289
|
|
|
290
290
|
## `jbrowse add-track-json TRACK`
|
|
291
291
|
|
|
@@ -310,7 +310,7 @@ EXAMPLES
|
|
|
310
310
|
$ jbrowse add-track-json track.json --update
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
-
_See code: [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
313
|
+
_See code: [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/add-track-json.ts)_
|
|
314
314
|
|
|
315
315
|
## `jbrowse admin-server`
|
|
316
316
|
|
|
@@ -336,7 +336,7 @@ EXAMPLES
|
|
|
336
336
|
$ jbrowse admin-server -p 8888
|
|
337
337
|
```
|
|
338
338
|
|
|
339
|
-
_See code: [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
339
|
+
_See code: [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/admin-server.ts)_
|
|
340
340
|
|
|
341
341
|
## `jbrowse create LOCALPATH`
|
|
342
342
|
|
|
@@ -380,7 +380,7 @@ EXAMPLES
|
|
|
380
380
|
$ jbrowse create --listVersions
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
-
_See code: [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
383
|
+
_See code: [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/create.ts)_
|
|
384
384
|
|
|
385
385
|
## `jbrowse help [COMMAND]`
|
|
386
386
|
|
|
@@ -434,7 +434,7 @@ EXAMPLES
|
|
|
434
434
|
$ jbrowse set-default-session --currentSession # Prints out current default session
|
|
435
435
|
```
|
|
436
436
|
|
|
437
|
-
_See code: [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
437
|
+
_See code: [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/set-default-session.ts)_
|
|
438
438
|
|
|
439
439
|
## `jbrowse text-index`
|
|
440
440
|
|
|
@@ -490,7 +490,7 @@ EXAMPLES
|
|
|
490
490
|
$ jbrowse text-index --file myfile.gff3.gz --file myfile.vcfgz --out indexes
|
|
491
491
|
```
|
|
492
492
|
|
|
493
|
-
_See code: [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
493
|
+
_See code: [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/text-index.ts)_
|
|
494
494
|
|
|
495
495
|
## `jbrowse upgrade [LOCALPATH]`
|
|
496
496
|
|
|
@@ -536,7 +536,7 @@ EXAMPLES
|
|
|
536
536
|
$ jbrowse upgrade --nightly
|
|
537
537
|
```
|
|
538
538
|
|
|
539
|
-
_See code: [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.
|
|
539
|
+
_See code: [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.2/products/jbrowse-cli/src/commands/upgrade.ts)_
|
|
540
540
|
|
|
541
541
|
<!-- commandsstop -->
|
|
542
542
|
|
|
@@ -5,7 +5,7 @@ const command_1 = require("@oclif/command");
|
|
|
5
5
|
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
6
6
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
7
7
|
const base_1 = (0, tslib_1.__importDefault)(require("../base"));
|
|
8
|
-
const
|
|
8
|
+
const { rename, copyFile, mkdir, symlink } = fs_1.default.promises;
|
|
9
9
|
function isValidJSON(string) {
|
|
10
10
|
try {
|
|
11
11
|
JSON.parse(string);
|
|
@@ -206,7 +206,7 @@ class AddAssembly extends base_1.default {
|
|
|
206
206
|
const { args: runArgs, flags: runFlags } = this.parse(AddAssembly);
|
|
207
207
|
const output = runFlags.target || runFlags.out || '.';
|
|
208
208
|
if (!(await exists(output))) {
|
|
209
|
-
await
|
|
209
|
+
await mkdir(output, { recursive: true });
|
|
210
210
|
}
|
|
211
211
|
const isDir = fs_1.default.statSync(output).isDirectory();
|
|
212
212
|
this.target = isDir ? `${output}/config.json` : output;
|
|
@@ -347,7 +347,7 @@ class AddAssembly extends base_1.default {
|
|
|
347
347
|
if (!filePath) {
|
|
348
348
|
return undefined;
|
|
349
349
|
}
|
|
350
|
-
return
|
|
350
|
+
return copyFile(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
|
|
351
351
|
}));
|
|
352
352
|
return true;
|
|
353
353
|
}
|
|
@@ -356,7 +356,7 @@ class AddAssembly extends base_1.default {
|
|
|
356
356
|
if (!filePath) {
|
|
357
357
|
return undefined;
|
|
358
358
|
}
|
|
359
|
-
return
|
|
359
|
+
return symlink(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
|
|
360
360
|
}));
|
|
361
361
|
return true;
|
|
362
362
|
}
|
|
@@ -365,7 +365,7 @@ class AddAssembly extends base_1.default {
|
|
|
365
365
|
if (!filePath) {
|
|
366
366
|
return undefined;
|
|
367
367
|
}
|
|
368
|
-
return
|
|
368
|
+
return rename(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
|
|
369
369
|
}));
|
|
370
370
|
return true;
|
|
371
371
|
}
|
|
@@ -42,21 +42,17 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
42
42
|
index: string;
|
|
43
43
|
index2?: undefined;
|
|
44
44
|
} | {
|
|
45
|
-
file
|
|
45
|
+
file: string;
|
|
46
46
|
index?: undefined;
|
|
47
47
|
index2?: undefined;
|
|
48
48
|
} | {
|
|
49
|
-
file
|
|
50
|
-
index
|
|
49
|
+
file?: undefined;
|
|
50
|
+
index?: undefined;
|
|
51
51
|
index2?: undefined;
|
|
52
52
|
} | {
|
|
53
53
|
file: string;
|
|
54
54
|
index: string;
|
|
55
55
|
index2: string;
|
|
56
|
-
} | {
|
|
57
|
-
file: string;
|
|
58
|
-
index?: undefined;
|
|
59
|
-
index2?: undefined;
|
|
60
56
|
};
|
|
61
57
|
guessAdapter(fileName: string, protocol: string, index?: string): {
|
|
62
58
|
type: string;
|
|
@@ -67,7 +63,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
67
63
|
};
|
|
68
64
|
cramLocation?: undefined;
|
|
69
65
|
craiLocation?: undefined;
|
|
66
|
+
gffLocation?: undefined;
|
|
70
67
|
gffGzLocation?: undefined;
|
|
68
|
+
gtfLocation?: undefined;
|
|
71
69
|
vcfLocation?: undefined;
|
|
72
70
|
vcfGzLocation?: undefined;
|
|
73
71
|
bedGzLocation?: undefined;
|
|
@@ -87,7 +85,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
87
85
|
craiLocation: UriLocation | LocalPathLocation;
|
|
88
86
|
bamLocation?: undefined;
|
|
89
87
|
index?: undefined;
|
|
88
|
+
gffLocation?: undefined;
|
|
90
89
|
gffGzLocation?: undefined;
|
|
90
|
+
gtfLocation?: undefined;
|
|
91
91
|
vcfLocation?: undefined;
|
|
92
92
|
vcfGzLocation?: undefined;
|
|
93
93
|
bedGzLocation?: undefined;
|
|
@@ -103,11 +103,13 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
103
103
|
pafLocation?: undefined;
|
|
104
104
|
} | {
|
|
105
105
|
type: string;
|
|
106
|
+
gffLocation: UriLocation | LocalPathLocation;
|
|
106
107
|
bamLocation?: undefined;
|
|
107
108
|
index?: undefined;
|
|
108
109
|
cramLocation?: undefined;
|
|
109
110
|
craiLocation?: undefined;
|
|
110
111
|
gffGzLocation?: undefined;
|
|
112
|
+
gtfLocation?: undefined;
|
|
111
113
|
vcfLocation?: undefined;
|
|
112
114
|
vcfGzLocation?: undefined;
|
|
113
115
|
bedGzLocation?: undefined;
|
|
@@ -131,6 +133,30 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
131
133
|
bamLocation?: undefined;
|
|
132
134
|
cramLocation?: undefined;
|
|
133
135
|
craiLocation?: undefined;
|
|
136
|
+
gffLocation?: undefined;
|
|
137
|
+
gtfLocation?: undefined;
|
|
138
|
+
vcfLocation?: undefined;
|
|
139
|
+
vcfGzLocation?: undefined;
|
|
140
|
+
bedGzLocation?: undefined;
|
|
141
|
+
bigBedLocation?: undefined;
|
|
142
|
+
bigWigLocation?: undefined;
|
|
143
|
+
fastaLocation?: undefined;
|
|
144
|
+
faiLocation?: undefined;
|
|
145
|
+
gziLocation?: undefined;
|
|
146
|
+
twoBitLocation?: undefined;
|
|
147
|
+
rootUrlTemplate?: undefined;
|
|
148
|
+
endpoint?: undefined;
|
|
149
|
+
hicLocation?: undefined;
|
|
150
|
+
pafLocation?: undefined;
|
|
151
|
+
} | {
|
|
152
|
+
type: string;
|
|
153
|
+
gtfLocation: UriLocation | LocalPathLocation;
|
|
154
|
+
bamLocation?: undefined;
|
|
155
|
+
index?: undefined;
|
|
156
|
+
cramLocation?: undefined;
|
|
157
|
+
craiLocation?: undefined;
|
|
158
|
+
gffLocation?: undefined;
|
|
159
|
+
gffGzLocation?: undefined;
|
|
134
160
|
vcfLocation?: undefined;
|
|
135
161
|
vcfGzLocation?: undefined;
|
|
136
162
|
bedGzLocation?: undefined;
|
|
@@ -151,7 +177,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
151
177
|
index?: undefined;
|
|
152
178
|
cramLocation?: undefined;
|
|
153
179
|
craiLocation?: undefined;
|
|
180
|
+
gffLocation?: undefined;
|
|
154
181
|
gffGzLocation?: undefined;
|
|
182
|
+
gtfLocation?: undefined;
|
|
155
183
|
vcfGzLocation?: undefined;
|
|
156
184
|
bedGzLocation?: undefined;
|
|
157
185
|
bigBedLocation?: undefined;
|
|
@@ -174,8 +202,32 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
174
202
|
bamLocation?: undefined;
|
|
175
203
|
cramLocation?: undefined;
|
|
176
204
|
craiLocation?: undefined;
|
|
205
|
+
gffLocation?: undefined;
|
|
206
|
+
gffGzLocation?: undefined;
|
|
207
|
+
gtfLocation?: undefined;
|
|
208
|
+
vcfLocation?: undefined;
|
|
209
|
+
bedGzLocation?: undefined;
|
|
210
|
+
bigBedLocation?: undefined;
|
|
211
|
+
bigWigLocation?: undefined;
|
|
212
|
+
fastaLocation?: undefined;
|
|
213
|
+
faiLocation?: undefined;
|
|
214
|
+
gziLocation?: undefined;
|
|
215
|
+
twoBitLocation?: undefined;
|
|
216
|
+
rootUrlTemplate?: undefined;
|
|
217
|
+
endpoint?: undefined;
|
|
218
|
+
hicLocation?: undefined;
|
|
219
|
+
pafLocation?: undefined;
|
|
220
|
+
} | {
|
|
221
|
+
type: string;
|
|
222
|
+
bamLocation?: undefined;
|
|
223
|
+
index?: undefined;
|
|
224
|
+
cramLocation?: undefined;
|
|
225
|
+
craiLocation?: undefined;
|
|
226
|
+
gffLocation?: undefined;
|
|
177
227
|
gffGzLocation?: undefined;
|
|
228
|
+
gtfLocation?: undefined;
|
|
178
229
|
vcfLocation?: undefined;
|
|
230
|
+
vcfGzLocation?: undefined;
|
|
179
231
|
bedGzLocation?: undefined;
|
|
180
232
|
bigBedLocation?: undefined;
|
|
181
233
|
bigWigLocation?: undefined;
|
|
@@ -197,7 +249,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
197
249
|
bamLocation?: undefined;
|
|
198
250
|
cramLocation?: undefined;
|
|
199
251
|
craiLocation?: undefined;
|
|
252
|
+
gffLocation?: undefined;
|
|
200
253
|
gffGzLocation?: undefined;
|
|
254
|
+
gtfLocation?: undefined;
|
|
201
255
|
vcfLocation?: undefined;
|
|
202
256
|
vcfGzLocation?: undefined;
|
|
203
257
|
bigBedLocation?: undefined;
|
|
@@ -217,7 +271,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
217
271
|
index?: undefined;
|
|
218
272
|
cramLocation?: undefined;
|
|
219
273
|
craiLocation?: undefined;
|
|
274
|
+
gffLocation?: undefined;
|
|
220
275
|
gffGzLocation?: undefined;
|
|
276
|
+
gtfLocation?: undefined;
|
|
221
277
|
vcfLocation?: undefined;
|
|
222
278
|
vcfGzLocation?: undefined;
|
|
223
279
|
bedGzLocation?: undefined;
|
|
@@ -237,7 +293,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
237
293
|
index?: undefined;
|
|
238
294
|
cramLocation?: undefined;
|
|
239
295
|
craiLocation?: undefined;
|
|
296
|
+
gffLocation?: undefined;
|
|
240
297
|
gffGzLocation?: undefined;
|
|
298
|
+
gtfLocation?: undefined;
|
|
241
299
|
vcfLocation?: undefined;
|
|
242
300
|
vcfGzLocation?: undefined;
|
|
243
301
|
bedGzLocation?: undefined;
|
|
@@ -258,7 +316,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
258
316
|
index?: undefined;
|
|
259
317
|
cramLocation?: undefined;
|
|
260
318
|
craiLocation?: undefined;
|
|
319
|
+
gffLocation?: undefined;
|
|
261
320
|
gffGzLocation?: undefined;
|
|
321
|
+
gtfLocation?: undefined;
|
|
262
322
|
vcfLocation?: undefined;
|
|
263
323
|
vcfGzLocation?: undefined;
|
|
264
324
|
bedGzLocation?: undefined;
|
|
@@ -279,7 +339,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
279
339
|
index?: undefined;
|
|
280
340
|
cramLocation?: undefined;
|
|
281
341
|
craiLocation?: undefined;
|
|
342
|
+
gffLocation?: undefined;
|
|
282
343
|
gffGzLocation?: undefined;
|
|
344
|
+
gtfLocation?: undefined;
|
|
283
345
|
vcfLocation?: undefined;
|
|
284
346
|
vcfGzLocation?: undefined;
|
|
285
347
|
bedGzLocation?: undefined;
|
|
@@ -297,7 +359,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
297
359
|
index?: undefined;
|
|
298
360
|
cramLocation?: undefined;
|
|
299
361
|
craiLocation?: undefined;
|
|
362
|
+
gffLocation?: undefined;
|
|
300
363
|
gffGzLocation?: undefined;
|
|
364
|
+
gtfLocation?: undefined;
|
|
301
365
|
vcfLocation?: undefined;
|
|
302
366
|
vcfGzLocation?: undefined;
|
|
303
367
|
bedGzLocation?: undefined;
|
|
@@ -317,7 +381,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
317
381
|
index?: undefined;
|
|
318
382
|
cramLocation?: undefined;
|
|
319
383
|
craiLocation?: undefined;
|
|
384
|
+
gffLocation?: undefined;
|
|
320
385
|
gffGzLocation?: undefined;
|
|
386
|
+
gtfLocation?: undefined;
|
|
321
387
|
vcfLocation?: undefined;
|
|
322
388
|
vcfGzLocation?: undefined;
|
|
323
389
|
bedGzLocation?: undefined;
|
|
@@ -337,7 +403,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
337
403
|
index?: undefined;
|
|
338
404
|
cramLocation?: undefined;
|
|
339
405
|
craiLocation?: undefined;
|
|
406
|
+
gffLocation?: undefined;
|
|
340
407
|
gffGzLocation?: undefined;
|
|
408
|
+
gtfLocation?: undefined;
|
|
341
409
|
vcfLocation?: undefined;
|
|
342
410
|
vcfGzLocation?: undefined;
|
|
343
411
|
bedGzLocation?: undefined;
|
|
@@ -357,7 +425,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
357
425
|
index?: undefined;
|
|
358
426
|
cramLocation?: undefined;
|
|
359
427
|
craiLocation?: undefined;
|
|
428
|
+
gffLocation?: undefined;
|
|
360
429
|
gffGzLocation?: undefined;
|
|
430
|
+
gtfLocation?: undefined;
|
|
361
431
|
vcfLocation?: undefined;
|
|
362
432
|
vcfGzLocation?: undefined;
|
|
363
433
|
bedGzLocation?: undefined;
|
|
@@ -377,7 +447,9 @@ export default class AddTrack extends JBrowseCommand {
|
|
|
377
447
|
index?: undefined;
|
|
378
448
|
cramLocation?: undefined;
|
|
379
449
|
craiLocation?: undefined;
|
|
450
|
+
gffLocation?: undefined;
|
|
380
451
|
gffGzLocation?: undefined;
|
|
452
|
+
gtfLocation?: undefined;
|
|
381
453
|
vcfLocation?: undefined;
|
|
382
454
|
vcfGzLocation?: undefined;
|
|
383
455
|
bedGzLocation?: undefined;
|
|
@@ -6,14 +6,16 @@ const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
|
6
6
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
7
7
|
const json_parse_better_errors_1 = (0, tslib_1.__importDefault)(require("json-parse-better-errors"));
|
|
8
8
|
const base_1 = (0, tslib_1.__importDefault)(require("../base"));
|
|
9
|
-
const
|
|
9
|
+
const { copyFile, rename, symlink, lstat, unlink } = fs_1.default.promises;
|
|
10
|
+
const { COPYFILE_EXCL } = fs_1.default.constants;
|
|
11
|
+
const isUrl = (loc) => loc === null || loc === void 0 ? void 0 : loc.match(/^https?:\/\//);
|
|
10
12
|
class AddTrack extends base_1.default {
|
|
11
13
|
async run() {
|
|
12
14
|
const { args: runArgs, flags: runFlags } = this.parse(AddTrack);
|
|
13
15
|
const { track: argsTrack } = runArgs;
|
|
14
16
|
const { config, skipCheck, force, overwrite, category, description, load, subDir, target, protocol, out, indexFile: index, } = runFlags;
|
|
15
17
|
const output = target || out || '.';
|
|
16
|
-
const isDir = (await
|
|
18
|
+
const isDir = (await lstat(output)).isDirectory();
|
|
17
19
|
this.target = isDir ? `${output}/config.json` : output;
|
|
18
20
|
let { trackType, trackId, name, assemblyNames } = runFlags;
|
|
19
21
|
const configDirectory = path_1.default.dirname(this.target);
|
|
@@ -27,7 +29,6 @@ class AddTrack extends base_1.default {
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
const location = argsTrack;
|
|
30
|
-
const isUrl = (loc) => loc === null || loc === void 0 ? void 0 : loc.match(/^https?:\/\//);
|
|
31
32
|
const inPlace = load === 'inPlace';
|
|
32
33
|
const useIndex = isUrl(index) || inPlace || index;
|
|
33
34
|
const effectiveLocation = isUrl(location) || inPlace
|
|
@@ -78,11 +79,9 @@ class AddTrack extends base_1.default {
|
|
|
78
79
|
this.debug(`Assembly name(s) is :${assemblyNames}`);
|
|
79
80
|
const configObj = config ? (0, json_parse_better_errors_1.default)(config) : {};
|
|
80
81
|
const trackConfig = Object.assign({ type: trackType, trackId,
|
|
81
|
-
name,
|
|
82
|
+
name,
|
|
83
|
+
adapter, category: category === null || category === void 0 ? void 0 : category.split(',').map(c => c.trim()), assemblyNames: assemblyNames.split(',').map(a => a.trim()), description }, configObj);
|
|
82
84
|
this.debug(`Track location: ${location}, index: ${adapter ? adapter.index : ''}`);
|
|
83
|
-
if (description) {
|
|
84
|
-
trackConfig.description = description;
|
|
85
|
-
}
|
|
86
85
|
// any special track modifications go here
|
|
87
86
|
switch (trackType) {
|
|
88
87
|
case 'AlignmentsTrack': {
|
|
@@ -113,56 +112,27 @@ class AddTrack extends base_1.default {
|
|
|
113
112
|
else {
|
|
114
113
|
configContents.tracks.push(trackConfig);
|
|
115
114
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
try {
|
|
124
|
-
if (force && fs_1.default.existsSync(dest)) {
|
|
125
|
-
await fsPromises.unlink(dest);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
catch (e) {
|
|
129
|
-
this.error(e instanceof Error ? e : `${e}`);
|
|
130
|
-
}
|
|
131
|
-
return fsPromises.copyFile(filePath, dest, fs_1.default.constants.COPYFILE_EXCL);
|
|
132
|
-
}));
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
case 'symlink': {
|
|
136
|
-
await Promise.all(filePaths.map(async (filePath) => {
|
|
137
|
-
const dest = destinationFn(configDirectory, filePath);
|
|
138
|
-
try {
|
|
139
|
-
if (force && fs_1.default.existsSync(dest)) {
|
|
140
|
-
await fsPromises.unlink(dest);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
catch (e) {
|
|
144
|
-
this.error(e instanceof Error ? e : `${e}`);
|
|
145
|
-
}
|
|
146
|
-
return fsPromises.symlink(filePath, dest);
|
|
147
|
-
}));
|
|
148
|
-
break;
|
|
115
|
+
const filePaths = Object.values(this.guessFileNames(location, index)).filter((f) => !!f);
|
|
116
|
+
// get path of destination, and remove file at that path if it exists and
|
|
117
|
+
// force is set
|
|
118
|
+
const destinationFn = async (dir, file) => {
|
|
119
|
+
const dest = path_1.default.join(dir, subDir, path_1.default.basename(file));
|
|
120
|
+
if (force && fs_1.default.existsSync(dest)) {
|
|
121
|
+
await unlink(dest);
|
|
149
122
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return fsPromises.rename(filePath, dest);
|
|
162
|
-
}));
|
|
163
|
-
break;
|
|
123
|
+
return dest;
|
|
124
|
+
};
|
|
125
|
+
const callbacks = {
|
|
126
|
+
copy: (src, dest) => copyFile(src, dest, COPYFILE_EXCL),
|
|
127
|
+
move: (src, dest) => rename(src, dest),
|
|
128
|
+
symlink: (src, dest) => symlink(src, dest),
|
|
129
|
+
};
|
|
130
|
+
await Promise.all(filePaths.map(async (src) => {
|
|
131
|
+
const dest = await destinationFn(configDirectory, src);
|
|
132
|
+
if (load === 'copy' || load === 'move' || load === 'symlink') {
|
|
133
|
+
return callbacks[load](src, dest);
|
|
164
134
|
}
|
|
165
|
-
}
|
|
135
|
+
}));
|
|
166
136
|
this.debug(`Writing configuration to file ${this.target}`);
|
|
167
137
|
await this.writeJsonFile(this.target, configContents);
|
|
168
138
|
this.log(`${idx !== -1 ? 'Overwrote' : 'Added'} track "${name}" ${idx !== -1 ? 'in' : 'to'} ${this.target}`);
|
|
@@ -177,28 +147,34 @@ class AddTrack extends base_1.default {
|
|
|
177
147
|
if (/\.cram$/i.test(fileName)) {
|
|
178
148
|
return {
|
|
179
149
|
file: fileName,
|
|
180
|
-
index: `${fileName}.crai`,
|
|
150
|
+
index: index || `${fileName}.crai`,
|
|
181
151
|
};
|
|
182
152
|
}
|
|
183
153
|
if (/\.gff3?$/i.test(fileName)) {
|
|
184
|
-
return {
|
|
154
|
+
return {
|
|
155
|
+
file: fileName,
|
|
156
|
+
};
|
|
185
157
|
}
|
|
186
158
|
if (/\.gff3?\.b?gz$/i.test(fileName)) {
|
|
187
159
|
return {
|
|
188
160
|
file: fileName,
|
|
189
|
-
index: `${fileName}.tbi`,
|
|
161
|
+
index: index || `${fileName}.tbi`,
|
|
190
162
|
};
|
|
191
163
|
}
|
|
192
164
|
if (/\.gtf?$/i.test(fileName)) {
|
|
193
|
-
return {
|
|
165
|
+
return {
|
|
166
|
+
file: fileName,
|
|
167
|
+
};
|
|
194
168
|
}
|
|
195
169
|
if (/\.vcf$/i.test(fileName)) {
|
|
196
|
-
return {
|
|
170
|
+
return {
|
|
171
|
+
file: fileName,
|
|
172
|
+
};
|
|
197
173
|
}
|
|
198
174
|
if (/\.vcf\.b?gz$/i.test(fileName)) {
|
|
199
175
|
return {
|
|
200
176
|
file: fileName,
|
|
201
|
-
index: `${fileName}.tbi`,
|
|
177
|
+
index: index || `${fileName}.tbi`,
|
|
202
178
|
};
|
|
203
179
|
}
|
|
204
180
|
if (/\.vcf\.idx$/i.test(fileName)) {
|
|
@@ -219,13 +195,11 @@ class AddTrack extends base_1.default {
|
|
|
219
195
|
if (/\.(bb|bigbed)$/i.test(fileName)) {
|
|
220
196
|
return {
|
|
221
197
|
file: fileName,
|
|
222
|
-
index: undefined,
|
|
223
198
|
};
|
|
224
199
|
}
|
|
225
200
|
if (/\.(bw|bigwig)$/i.test(fileName)) {
|
|
226
201
|
return {
|
|
227
202
|
file: fileName,
|
|
228
|
-
index: undefined,
|
|
229
203
|
};
|
|
230
204
|
}
|
|
231
205
|
if (/\.(fa|fasta|fas|fna|mfa)$/i.test(fileName)) {
|
|
@@ -278,7 +252,10 @@ class AddTrack extends base_1.default {
|
|
|
278
252
|
return { uri: location, locationType: 'UriLocation' };
|
|
279
253
|
}
|
|
280
254
|
if (protocol === 'localPath') {
|
|
281
|
-
return {
|
|
255
|
+
return {
|
|
256
|
+
localPath: location,
|
|
257
|
+
locationType: 'LocalPathLocation',
|
|
258
|
+
};
|
|
282
259
|
}
|
|
283
260
|
throw new Error(`invalid protocol ${protocol}`);
|
|
284
261
|
}
|
|
@@ -301,7 +278,8 @@ class AddTrack extends base_1.default {
|
|
|
301
278
|
}
|
|
302
279
|
if (/\.gff3?$/i.test(fileName)) {
|
|
303
280
|
return {
|
|
304
|
-
type: '
|
|
281
|
+
type: 'Gff3Adapter',
|
|
282
|
+
gffLocation: makeLocation(fileName),
|
|
305
283
|
};
|
|
306
284
|
}
|
|
307
285
|
if (/\.gff3?\.b?gz$/i.test(fileName)) {
|
|
@@ -316,7 +294,8 @@ class AddTrack extends base_1.default {
|
|
|
316
294
|
}
|
|
317
295
|
if (/\.gtf?$/i.test(fileName)) {
|
|
318
296
|
return {
|
|
319
|
-
type: '
|
|
297
|
+
type: 'GtfAdapter',
|
|
298
|
+
gtfLocation: makeLocation(fileName),
|
|
320
299
|
};
|
|
321
300
|
}
|
|
322
301
|
if (/\.vcf$/i.test(fileName)) {
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.5.1","commands":{"add-assembly":{"id":"add-assembly","description":"Add an assembly to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and GRCh38.fa.fai to current directory","$ jbrowse add-assembly GRCh38.fa --load copy","","# add assembly to a specific jb2 installation path using --out, and copies the .fa and .fa.fai file to /path/to/jb2","$ jbrowse add-assembly GRCh38.fa --out /path/to/jb2/ --load copy","","# force indexedFasta for add-assembly without relying on file extension","$ jbrowse add-assembly GRCh38.xyz --type indexedFasta --load copy","","# add displayName for an assembly","$ jbrowse add-assembly myFile.fa.gz --name hg38 --displayName \"Homo sapiens (hg38)\"","","# use chrom.sizes file for assembly instead of a fasta file","$ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace","","# add assembly from preconfigured json file, expert option","$ jbrowse add-assembly GRCh38.config.json --load copy","","# add assembly from a 2bit file, also note pointing direct to a URL so no --load flag needed","$ jbrowse add-assembly https://example.com/data/sample.2bit","","# add a bgzip indexed fasta inferred by fa.gz extension. assumes .fa.gz.gzi and .fa.gz.fai files also exists","$ jbrowse add-assembly myfile.fa.gz --load copy"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of sequence, by default inferred from sequence file\n\nindexedFasta An index FASTA (e.g. .fa or .fasta) file;\n can optionally specify --faiLocation\n\nbgzipFasta A block-gzipped and indexed FASTA (e.g. .fa.gz or .fasta.gz) file;\n can optionally specify --faiLocation and/or --gziLocation\n\ntwoBit A twoBit (e.g. .2bit) file\n\nchromSizes A chromosome sizes (e.g. .chrom.sizes) file\n\ncustom Either a JSON file location or inline JSON that defines a custom\n sequence adapter; must provide --name if using inline JSON","options":["indexedFasta","bgzipFasta","twoBit","chromSizes","custom"]},"name":{"name":"name","type":"option","char":"n","description":"Name of the assembly; if not specified, will be guessed using the sequence file name"},"alias":{"name":"alias","type":"option","char":"a","description":"An alias for the assembly name (e.g. \"hg38\" if the name of the assembly is \"GRCh38\");\ncan be specified multiple times"},"displayName":{"name":"displayName","type":"option","description":"The display name to specify for the assembly, e.g. \"Homo sapiens (hg38)\" while the name can be a shorter identifier like \"hg38\""},"faiLocation":{"name":"faiLocation","type":"option","description":"[default: <fastaLocation>.fai] FASTA index file or URL"},"gziLocation":{"name":"gziLocation","type":"option","description":"[default: <fastaLocation>.gzi] FASTA gzip index file or URL"},"refNameAliases":{"name":"refNameAliases","type":"option","description":"Reference sequence name aliases file or URL; assumed to be a tab-separated aliases\nfile unless --refNameAliasesType is specified"},"refNameAliasesType":{"name":"refNameAliasesType","type":"option","description":"Type of aliases defined by --refNameAliases; if \"custom\", --refNameAliases is either\na JSON file location or inline JSON that defines a custom sequence adapter","options":["aliases","custom"]},"refNameColors":{"name":"refNameColors","type":"option","description":"A comma-separated list of color strings for the reference sequence names; will cycle\nthrough colors if there are fewer colors than sequences"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the data directory. Copy, symlink, or move the data directory to the JBrowse directory. Or use inPlace to modify the config without doing any file operations","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the sequence file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrite existing assembly if one with the same name exists","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"sequence","description":"sequence file or URL\n\nIf TYPE is indexedFasta or bgzipFasta, the index file defaults to <location>.fai\nand can be optionally specified with --faiLocation\nIf TYPE is bgzipFasta, the gzip index file defaults to <location>.gzi and can be\noptionally specified with --gziLocation","required":true}]},"add-connection":{"id":"add-connection","description":"Add a connection to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-connection http://mysite.com/jbrowse/data/","$ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection","$ jbrowse add-connection http://mysite.com/path/to/hub.txt --assemblyName hg19","$ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection --assemblyName hg19","$ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config '{\"uri\":{\"url\":\"https://mysite.com/path/to/custom\"}, \"locationType\": \"UriLocation\"}' --assemblyName hg19","$ jbrowse add-connection https://mysite.com/path/to/hub.txt --connectionId newId --name newName --target /path/to/jb2/installation/config.json"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of connection, ex. JBrowse1Connection, UCSCTrackHubConnection, custom"},"assemblyName":{"name":"assemblyName","type":"option","char":"a","description":"Assembly name of the connection If none, will default to the assembly in your config file"},"config":{"name":"config","type":"option","char":"c","description":"Any extra config settings to add to connection in JSON object format, such as '{\"uri\":\"url\":\"https://sample.com\"}, \"locationType\": \"UriLocation\"}'"},"connectionId":{"name":"connectionId","type":"option","description":"Id for the connection that must be unique to JBrowse. Defaults to 'connectionType-assemblyName-currentTime'"},"name":{"name":"name","type":"option","char":"n","description":"Name of the connection. Defaults to connectionId if not provided"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to."},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the data directory URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrites any existing connections if same connection id","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"connectionUrlOrPath","description":"URL of data directory\nFor hub file, usually called hub.txt\nFor JBrowse 1, location of JB1 data directory similar to http://mysite.com/jbrowse/data/ ","required":true}]},"add-track-json":{"id":"add-track-json","description":"Add a track configuration directly from a JSON hunk to the JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-track-json track.json","$ jbrowse add-track-json track.json --update"],"flags":{"update":{"name":"update","type":"boolean","char":"u","description":"update the contents of an existing track, matched based on trackId","allowNo":false},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"}},"args":[{"name":"track","description":"track JSON file or command line arg blob","required":true}]},"add-track":{"id":"add-track","description":"Add a track to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# copy /path/to/my.bam and /path/to/my.bam.bai to current directory and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load copy","","# copy my.bam and my.bam.bai to /path/to/jb2/bam and adds track entry to /path/to/jb2/bam/config.json","$ jbrowse add-track my.bam --load copy --out /path/to/jb2 --subDir bam","","# same as above, but specify path to bai file. needed for if the bai file does not have the extension .bam.bai","$ jbrowse add-track my.bam --indexFile my.bai --load copy","","# creates symlink for /path/to/my.bam and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load symlink","","# add track from URL to config.json, no --load flag needed","$ jbrowse add-track https://mywebsite.com/my.bam","","# --load inPlace adds a track without doing file operations","$ jbrowse add-track /url/relative/path.bam --load inPlace"],"flags":{"trackType":{"name":"trackType","type":"option","char":"t","description":"Type of track, by default inferred from track file"},"name":{"name":"name","type":"option","char":"n","description":"Name of the track. Will be defaulted to the trackId if none specified"},"indexFile":{"name":"indexFile","type":"option","description":"Optional index file for the track"},"description":{"name":"description","type":"option","char":"d","description":"Optional description of the track"},"assemblyNames":{"name":"assemblyNames","type":"option","char":"a","description":"Assembly name or names for track as comma separated string. If none, will default to the assembly in your config file"},"category":{"name":"category","type":"option","description":"Optional Comma separated string of categories to group tracks"},"config":{"name":"config","type":"option","description":"Any extra config settings to add to a track. i.e '{\"defaultRendering\": \"density\"}'"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation to write out to."},"out":{"name":"out","type":"option","description":"synonym for target"},"subDir":{"name":"subDir","type":"option","description":"when using --load a file, output to a subdirectory of the target dir","default":""},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"trackId":{"name":"trackId","type":"option","description":"trackId for the track, by default inferred from filename, must be unique throughout config"},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the track. Copy, symlink, or move the track to the JBrowse directory. Or inPlace to leave track alone","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Skip check for whether or not the file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrites existing track if it shares the same trackId","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false},"protocol":{"name":"protocol","type":"option","description":"Force protocol to a specific value","default":"uri"}},"args":[{"name":"track","description":"Track file or URL","required":true}]},"admin-server":{"id":"admin-server","description":"Start up a small admin server for JBrowse configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse admin-server","$ jbrowse admin-server -p 8888"],"flags":{"port":{"name":"port","type":"option","char":"p","description":"Specifified port to start the server on;\nDefault is 9090."},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"create":{"id":"create","description":"Downloads and installs the latest JBrowse 2 release","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# Download latest release from github, and put in specific path","$ jbrowse create /path/to/new/installation","","# Download latest release from github and force overwrite existing contents at path","$ jbrowse create /path/to/new/installation --force","","# Download latest release from a specific URL","$ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip","","# Download a specific tag from github","$ jbrowse create /path/to/new/installation --tag v1.0.0","","# List available versions","$ jbrowse create --listVersions"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrites existing JBrowse 2 installation if present in path","allowNo":false},"listVersions":{"name":"listVersions","type":"boolean","char":"l","description":"Lists out all versions of JBrowse 2","allowNo":false},"branch":{"name":"branch","type":"option","description":"Download a development build from a named git branch"},"nightly":{"name":"nightly","type":"boolean","description":"Download the latest development build from the main branch","allowNo":false},"url":{"name":"url","type":"option","char":"u","description":"A direct URL to a JBrowse 2 release"},"tag":{"name":"tag","type":"option","char":"t","description":"Version of JBrowse 2 to install. Format is v1.0.0.\nDefaults to latest"}},"args":[{"name":"localPath","description":"Location where JBrowse 2 will be installed","required":true}]},"set-default-session":{"id":"set-default-session","description":"Set a default session with views and tracks","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse set-default-session --session /path/to/default/session.json","$ jbrowse set-default-session --target /path/to/jb2/installation/config.json --view LinearGenomeView --tracks track1, track2, track3","$ jbrowse set-default-session --view LinearGenomeView, --name newName --viewId view-no-tracks","$ jbrowse set-default-session --currentSession # Prints out current default session"],"flags":{"session":{"name":"session","type":"option","char":"s","description":"set path to a file containing session in json format"},"name":{"name":"name","type":"option","char":"n","description":"Give a name for the default session","default":"New Default Session"},"view":{"name":"view","type":"option","char":"v","description":"View type in config to be added as default session, i.e LinearGenomeView, CircularView, DotplotView.\nMust be provided if no default session file provided"},"viewId":{"name":"viewId","type":"option","description":"Identifier for the view. Will be generated on default"},"tracks":{"name":"tracks","type":"option","char":"t","description":"Track id or track ids as comma separated string to put into default session"},"currentSession":{"name":"currentSession","type":"boolean","char":"c","description":"List out the current default session","allowNo":false},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to"},"out":{"name":"out","type":"option","description":"synonym for target"},"delete":{"name":"delete","type":"boolean","description":"Delete any existing default session.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"text-index":{"id":"text-index","description":"Make a text-indexing file for any given track(s).","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# indexes all tracks that it can find in the current directory's config.json","$ jbrowse text-index","","# indexes specific trackIds that it can find in the current directory's config.json","$ jbrowse text-index --tracks=track1,track2,track3","","# indexes all tracks in a directory's config.json or in a specific config file","$ jbrowse text-index --out /path/to/jb2/","","# indexes only a specific assembly, and overwrite what was previously there using force (which is needed if a previous index already existed)","$ jbrowse text-index -a hg19 --force","","# create index for some files for use in @jbrowse/react-linear-genome-view or similar","$ jbrowse text-index --file myfile.gff3.gz --file myfile.vcfgz --out indexes"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"tracks":{"name":"tracks","type":"option","description":"Specific tracks to index, formatted as comma separated trackIds. If unspecified, indexes all available tracks"},"target":{"name":"target","type":"option","description":"Path to config file in JB2 installation directory to read from."},"out":{"name":"out","type":"option","description":"Synonym for target"},"attributes":{"name":"attributes","type":"option","description":"Comma separated list of attributes to index","default":"Name,ID"},"assemblies":{"name":"assemblies","type":"option","char":"a","description":"Specify the assembl(ies) to create an index for. If unspecified, creates an index for each assembly in the config"},"force":{"name":"force","type":"boolean","description":"Overwrite previously existing indexes","allowNo":false},"quiet":{"name":"quiet","type":"boolean","char":"q","description":"Hide the progress bars","allowNo":false},"perTrack":{"name":"perTrack","type":"boolean","description":"If set, creates an index per track","allowNo":false},"exclude":{"name":"exclude","type":"option","description":"Adds gene type to list of excluded types","default":"CDS,exon"},"file":{"name":"file","type":"option","description":"File or files to index (can be used to create trix indexes for embedded component use cases not using a config.json for example)"},"dryrun":{"name":"dryrun","type":"boolean","description":"Just print out tracks that will be indexed by the process, without doing any indexing","allowNo":false}},"args":[]},"upgrade":{"id":"upgrade","description":"Upgrades JBrowse 2 to latest version","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# Upgrades current directory to latest jbrowse release","$ jbrowse upgrade","","# Upgrade jbrowse instance at a specific filesystem path","$ jbrowse upgrade /path/to/jbrowse2/installation","","# Upgrade to a specific tag","$ jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0","","# List versions available on github","$ jbrowse upgrade --listVersions","","# Upgrade from a specific URL","$ jbrowse upgrade --url https://sample.com/jbrowse2.zip","","# Get nightly release from main branch","$ jbrowse upgrade --nightly"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"listVersions":{"name":"listVersions","type":"boolean","char":"l","description":"Lists out all versions of JBrowse 2","allowNo":false},"tag":{"name":"tag","type":"option","char":"t","description":"Version of JBrowse 2 to install. Format is v1.0.0.\nDefaults to latest"},"branch":{"name":"branch","type":"option","description":"Download a development build from a named git branch"},"nightly":{"name":"nightly","type":"boolean","description":"Download the latest development build from the main branch","allowNo":false},"url":{"name":"url","type":"option","char":"u","description":"A direct URL to a JBrowse 2 release"}},"args":[{"name":"localPath","description":"Location where JBrowse 2 is installed","required":false,"default":"."}]}}}
|
|
1
|
+
{"version":"1.5.2","commands":{"add-assembly":{"id":"add-assembly","description":"Add an assembly to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and GRCh38.fa.fai to current directory","$ jbrowse add-assembly GRCh38.fa --load copy","","# add assembly to a specific jb2 installation path using --out, and copies the .fa and .fa.fai file to /path/to/jb2","$ jbrowse add-assembly GRCh38.fa --out /path/to/jb2/ --load copy","","# force indexedFasta for add-assembly without relying on file extension","$ jbrowse add-assembly GRCh38.xyz --type indexedFasta --load copy","","# add displayName for an assembly","$ jbrowse add-assembly myFile.fa.gz --name hg38 --displayName \"Homo sapiens (hg38)\"","","# use chrom.sizes file for assembly instead of a fasta file","$ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace","","# add assembly from preconfigured json file, expert option","$ jbrowse add-assembly GRCh38.config.json --load copy","","# add assembly from a 2bit file, also note pointing direct to a URL so no --load flag needed","$ jbrowse add-assembly https://example.com/data/sample.2bit","","# add a bgzip indexed fasta inferred by fa.gz extension. assumes .fa.gz.gzi and .fa.gz.fai files also exists","$ jbrowse add-assembly myfile.fa.gz --load copy"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of sequence, by default inferred from sequence file\n\nindexedFasta An index FASTA (e.g. .fa or .fasta) file;\n can optionally specify --faiLocation\n\nbgzipFasta A block-gzipped and indexed FASTA (e.g. .fa.gz or .fasta.gz) file;\n can optionally specify --faiLocation and/or --gziLocation\n\ntwoBit A twoBit (e.g. .2bit) file\n\nchromSizes A chromosome sizes (e.g. .chrom.sizes) file\n\ncustom Either a JSON file location or inline JSON that defines a custom\n sequence adapter; must provide --name if using inline JSON","options":["indexedFasta","bgzipFasta","twoBit","chromSizes","custom"]},"name":{"name":"name","type":"option","char":"n","description":"Name of the assembly; if not specified, will be guessed using the sequence file name"},"alias":{"name":"alias","type":"option","char":"a","description":"An alias for the assembly name (e.g. \"hg38\" if the name of the assembly is \"GRCh38\");\ncan be specified multiple times"},"displayName":{"name":"displayName","type":"option","description":"The display name to specify for the assembly, e.g. \"Homo sapiens (hg38)\" while the name can be a shorter identifier like \"hg38\""},"faiLocation":{"name":"faiLocation","type":"option","description":"[default: <fastaLocation>.fai] FASTA index file or URL"},"gziLocation":{"name":"gziLocation","type":"option","description":"[default: <fastaLocation>.gzi] FASTA gzip index file or URL"},"refNameAliases":{"name":"refNameAliases","type":"option","description":"Reference sequence name aliases file or URL; assumed to be a tab-separated aliases\nfile unless --refNameAliasesType is specified"},"refNameAliasesType":{"name":"refNameAliasesType","type":"option","description":"Type of aliases defined by --refNameAliases; if \"custom\", --refNameAliases is either\na JSON file location or inline JSON that defines a custom sequence adapter","options":["aliases","custom"]},"refNameColors":{"name":"refNameColors","type":"option","description":"A comma-separated list of color strings for the reference sequence names; will cycle\nthrough colors if there are fewer colors than sequences"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the data directory. Copy, symlink, or move the data directory to the JBrowse directory. Or use inPlace to modify the config without doing any file operations","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the sequence file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrite existing assembly if one with the same name exists","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"sequence","description":"sequence file or URL\n\nIf TYPE is indexedFasta or bgzipFasta, the index file defaults to <location>.fai\nand can be optionally specified with --faiLocation\nIf TYPE is bgzipFasta, the gzip index file defaults to <location>.gzi and can be\noptionally specified with --gziLocation","required":true}]},"add-connection":{"id":"add-connection","description":"Add a connection to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-connection http://mysite.com/jbrowse/data/","$ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection","$ jbrowse add-connection http://mysite.com/path/to/hub.txt --assemblyName hg19","$ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection --assemblyName hg19","$ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config '{\"uri\":{\"url\":\"https://mysite.com/path/to/custom\"}, \"locationType\": \"UriLocation\"}' --assemblyName hg19","$ jbrowse add-connection https://mysite.com/path/to/hub.txt --connectionId newId --name newName --target /path/to/jb2/installation/config.json"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of connection, ex. JBrowse1Connection, UCSCTrackHubConnection, custom"},"assemblyName":{"name":"assemblyName","type":"option","char":"a","description":"Assembly name of the connection If none, will default to the assembly in your config file"},"config":{"name":"config","type":"option","char":"c","description":"Any extra config settings to add to connection in JSON object format, such as '{\"uri\":\"url\":\"https://sample.com\"}, \"locationType\": \"UriLocation\"}'"},"connectionId":{"name":"connectionId","type":"option","description":"Id for the connection that must be unique to JBrowse. Defaults to 'connectionType-assemblyName-currentTime'"},"name":{"name":"name","type":"option","char":"n","description":"Name of the connection. Defaults to connectionId if not provided"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to."},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the data directory URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrites any existing connections if same connection id","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"connectionUrlOrPath","description":"URL of data directory\nFor hub file, usually called hub.txt\nFor JBrowse 1, location of JB1 data directory similar to http://mysite.com/jbrowse/data/ ","required":true}]},"add-track-json":{"id":"add-track-json","description":"Add a track configuration directly from a JSON hunk to the JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-track-json track.json","$ jbrowse add-track-json track.json --update"],"flags":{"update":{"name":"update","type":"boolean","char":"u","description":"update the contents of an existing track, matched based on trackId","allowNo":false},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"}},"args":[{"name":"track","description":"track JSON file or command line arg blob","required":true}]},"add-track":{"id":"add-track","description":"Add a track to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# copy /path/to/my.bam and /path/to/my.bam.bai to current directory and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load copy","","# copy my.bam and my.bam.bai to /path/to/jb2/bam and adds track entry to /path/to/jb2/bam/config.json","$ jbrowse add-track my.bam --load copy --out /path/to/jb2 --subDir bam","","# same as above, but specify path to bai file. needed for if the bai file does not have the extension .bam.bai","$ jbrowse add-track my.bam --indexFile my.bai --load copy","","# creates symlink for /path/to/my.bam and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load symlink","","# add track from URL to config.json, no --load flag needed","$ jbrowse add-track https://mywebsite.com/my.bam","","# --load inPlace adds a track without doing file operations","$ jbrowse add-track /url/relative/path.bam --load inPlace"],"flags":{"trackType":{"name":"trackType","type":"option","char":"t","description":"Type of track, by default inferred from track file"},"name":{"name":"name","type":"option","char":"n","description":"Name of the track. Will be defaulted to the trackId if none specified"},"indexFile":{"name":"indexFile","type":"option","description":"Optional index file for the track"},"description":{"name":"description","type":"option","char":"d","description":"Optional description of the track"},"assemblyNames":{"name":"assemblyNames","type":"option","char":"a","description":"Assembly name or names for track as comma separated string. If none, will default to the assembly in your config file"},"category":{"name":"category","type":"option","description":"Optional Comma separated string of categories to group tracks"},"config":{"name":"config","type":"option","description":"Any extra config settings to add to a track. i.e '{\"defaultRendering\": \"density\"}'"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation to write out to."},"out":{"name":"out","type":"option","description":"synonym for target"},"subDir":{"name":"subDir","type":"option","description":"when using --load a file, output to a subdirectory of the target dir","default":""},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"trackId":{"name":"trackId","type":"option","description":"trackId for the track, by default inferred from filename, must be unique throughout config"},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the track. Copy, symlink, or move the track to the JBrowse directory. Or inPlace to leave track alone","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Skip check for whether or not the file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrites existing track if it shares the same trackId","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false},"protocol":{"name":"protocol","type":"option","description":"Force protocol to a specific value","default":"uri"}},"args":[{"name":"track","description":"Track file or URL","required":true}]},"admin-server":{"id":"admin-server","description":"Start up a small admin server for JBrowse configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse admin-server","$ jbrowse admin-server -p 8888"],"flags":{"port":{"name":"port","type":"option","char":"p","description":"Specifified port to start the server on;\nDefault is 9090."},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"create":{"id":"create","description":"Downloads and installs the latest JBrowse 2 release","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# Download latest release from github, and put in specific path","$ jbrowse create /path/to/new/installation","","# Download latest release from github and force overwrite existing contents at path","$ jbrowse create /path/to/new/installation --force","","# Download latest release from a specific URL","$ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip","","# Download a specific tag from github","$ jbrowse create /path/to/new/installation --tag v1.0.0","","# List available versions","$ jbrowse create --listVersions"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrites existing JBrowse 2 installation if present in path","allowNo":false},"listVersions":{"name":"listVersions","type":"boolean","char":"l","description":"Lists out all versions of JBrowse 2","allowNo":false},"branch":{"name":"branch","type":"option","description":"Download a development build from a named git branch"},"nightly":{"name":"nightly","type":"boolean","description":"Download the latest development build from the main branch","allowNo":false},"url":{"name":"url","type":"option","char":"u","description":"A direct URL to a JBrowse 2 release"},"tag":{"name":"tag","type":"option","char":"t","description":"Version of JBrowse 2 to install. Format is v1.0.0.\nDefaults to latest"}},"args":[{"name":"localPath","description":"Location where JBrowse 2 will be installed","required":true}]},"set-default-session":{"id":"set-default-session","description":"Set a default session with views and tracks","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse set-default-session --session /path/to/default/session.json","$ jbrowse set-default-session --target /path/to/jb2/installation/config.json --view LinearGenomeView --tracks track1, track2, track3","$ jbrowse set-default-session --view LinearGenomeView, --name newName --viewId view-no-tracks","$ jbrowse set-default-session --currentSession # Prints out current default session"],"flags":{"session":{"name":"session","type":"option","char":"s","description":"set path to a file containing session in json format"},"name":{"name":"name","type":"option","char":"n","description":"Give a name for the default session","default":"New Default Session"},"view":{"name":"view","type":"option","char":"v","description":"View type in config to be added as default session, i.e LinearGenomeView, CircularView, DotplotView.\nMust be provided if no default session file provided"},"viewId":{"name":"viewId","type":"option","description":"Identifier for the view. Will be generated on default"},"tracks":{"name":"tracks","type":"option","char":"t","description":"Track id or track ids as comma separated string to put into default session"},"currentSession":{"name":"currentSession","type":"boolean","char":"c","description":"List out the current default session","allowNo":false},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to"},"out":{"name":"out","type":"option","description":"synonym for target"},"delete":{"name":"delete","type":"boolean","description":"Delete any existing default session.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"text-index":{"id":"text-index","description":"Make a text-indexing file for any given track(s).","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# indexes all tracks that it can find in the current directory's config.json","$ jbrowse text-index","","# indexes specific trackIds that it can find in the current directory's config.json","$ jbrowse text-index --tracks=track1,track2,track3","","# indexes all tracks in a directory's config.json or in a specific config file","$ jbrowse text-index --out /path/to/jb2/","","# indexes only a specific assembly, and overwrite what was previously there using force (which is needed if a previous index already existed)","$ jbrowse text-index -a hg19 --force","","# create index for some files for use in @jbrowse/react-linear-genome-view or similar","$ jbrowse text-index --file myfile.gff3.gz --file myfile.vcfgz --out indexes"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"tracks":{"name":"tracks","type":"option","description":"Specific tracks to index, formatted as comma separated trackIds. If unspecified, indexes all available tracks"},"target":{"name":"target","type":"option","description":"Path to config file in JB2 installation directory to read from."},"out":{"name":"out","type":"option","description":"Synonym for target"},"attributes":{"name":"attributes","type":"option","description":"Comma separated list of attributes to index","default":"Name,ID"},"assemblies":{"name":"assemblies","type":"option","char":"a","description":"Specify the assembl(ies) to create an index for. If unspecified, creates an index for each assembly in the config"},"force":{"name":"force","type":"boolean","description":"Overwrite previously existing indexes","allowNo":false},"quiet":{"name":"quiet","type":"boolean","char":"q","description":"Hide the progress bars","allowNo":false},"perTrack":{"name":"perTrack","type":"boolean","description":"If set, creates an index per track","allowNo":false},"exclude":{"name":"exclude","type":"option","description":"Adds gene type to list of excluded types","default":"CDS,exon"},"file":{"name":"file","type":"option","description":"File or files to index (can be used to create trix indexes for embedded component use cases not using a config.json for example)"},"dryrun":{"name":"dryrun","type":"boolean","description":"Just print out tracks that will be indexed by the process, without doing any indexing","allowNo":false}},"args":[]},"upgrade":{"id":"upgrade","description":"Upgrades JBrowse 2 to latest version","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# Upgrades current directory to latest jbrowse release","$ jbrowse upgrade","","# Upgrade jbrowse instance at a specific filesystem path","$ jbrowse upgrade /path/to/jbrowse2/installation","","# Upgrade to a specific tag","$ jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0","","# List versions available on github","$ jbrowse upgrade --listVersions","","# Upgrade from a specific URL","$ jbrowse upgrade --url https://sample.com/jbrowse2.zip","","# Get nightly release from main branch","$ jbrowse upgrade --nightly"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"listVersions":{"name":"listVersions","type":"boolean","char":"l","description":"Lists out all versions of JBrowse 2","allowNo":false},"tag":{"name":"tag","type":"option","char":"t","description":"Version of JBrowse 2 to install. Format is v1.0.0.\nDefaults to latest"},"branch":{"name":"branch","type":"option","description":"Download a development build from a named git branch"},"nightly":{"name":"nightly","type":"boolean","description":"Download the latest development build from the main branch","allowNo":false},"url":{"name":"url","type":"option","char":"u","description":"A direct URL to a JBrowse 2 release"}},"args":[{"name":"localPath","description":"Location where JBrowse 2 is installed","required":false,"default":"."}]}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "A command line tool for working with JBrowse 2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@gmod/gff": "^1.1.2",
|
|
48
48
|
"@oclif/command": "^1",
|
|
49
49
|
"@oclif/config": "^1",
|
|
50
|
+
"@oclif/errors": "^1",
|
|
50
51
|
"@oclif/plugin-help": "^3",
|
|
51
52
|
"boxen": "^4.2.0",
|
|
52
53
|
"chalk": "^4.1.0",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"cors": "^2.8.5",
|
|
55
56
|
"express": "^4.17.1",
|
|
56
57
|
"follow-redirects": "^1.14.1",
|
|
57
|
-
"ixixx": "^1.0.
|
|
58
|
+
"ixixx": "^1.0.19",
|
|
58
59
|
"json-parse-better-errors": "^1.0.2",
|
|
59
60
|
"node-fetch": "^2.6.0",
|
|
60
61
|
"object.fromentries": "^2.0.5",
|
|
@@ -76,5 +77,5 @@
|
|
|
76
77
|
"publishConfig": {
|
|
77
78
|
"access": "public"
|
|
78
79
|
},
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "94fdfbc34787ab8f12a87e00038da74b247b42fa"
|
|
80
81
|
}
|