@jbrowse/cli 2.7.2 → 2.8.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/README.md +39 -10
- package/lib/commands/add-track.js +12 -4
- package/lib/commands/sort-gff.js +42 -0
- package/oclif.manifest.json +31 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -56,6 +56,7 @@ It is likely preferable in most cases to install the tools globally with
|
|
|
56
56
|
- [`jbrowse help [COMMANDS]`](#jbrowse-help-commands)
|
|
57
57
|
- [`jbrowse remove-track TRACK`](#jbrowse-remove-track-track)
|
|
58
58
|
- [`jbrowse set-default-session`](#jbrowse-set-default-session)
|
|
59
|
+
- [`jbrowse sort-gff FILE`](#jbrowse-sort-gff-file)
|
|
59
60
|
- [`jbrowse text-index`](#jbrowse-text-index)
|
|
60
61
|
- [`jbrowse upgrade [LOCALPATH]`](#jbrowse-upgrade-localpath)
|
|
61
62
|
|
|
@@ -203,7 +204,7 @@ EXAMPLES
|
|
|
203
204
|
```
|
|
204
205
|
|
|
205
206
|
_See code:
|
|
206
|
-
[src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
207
|
+
[src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/add-assembly.ts)_
|
|
207
208
|
|
|
208
209
|
## `jbrowse add-connection CONNECTIONURLORPATH`
|
|
209
210
|
|
|
@@ -254,7 +255,7 @@ EXAMPLES
|
|
|
254
255
|
```
|
|
255
256
|
|
|
256
257
|
_See code:
|
|
257
|
-
[src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
258
|
+
[src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/add-connection.ts)_
|
|
258
259
|
|
|
259
260
|
## `jbrowse add-track TRACK`
|
|
260
261
|
|
|
@@ -335,7 +336,7 @@ EXAMPLES
|
|
|
335
336
|
```
|
|
336
337
|
|
|
337
338
|
_See code:
|
|
338
|
-
[src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
339
|
+
[src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/add-track.ts)_
|
|
339
340
|
|
|
340
341
|
## `jbrowse add-track-json TRACK`
|
|
341
342
|
|
|
@@ -365,7 +366,7 @@ EXAMPLES
|
|
|
365
366
|
```
|
|
366
367
|
|
|
367
368
|
_See code:
|
|
368
|
-
[src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
369
|
+
[src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/add-track-json.ts)_
|
|
369
370
|
|
|
370
371
|
## `jbrowse admin-server`
|
|
371
372
|
|
|
@@ -396,7 +397,7 @@ EXAMPLES
|
|
|
396
397
|
```
|
|
397
398
|
|
|
398
399
|
_See code:
|
|
399
|
-
[src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
400
|
+
[src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/admin-server.ts)_
|
|
400
401
|
|
|
401
402
|
## `jbrowse create LOCALPATH`
|
|
402
403
|
|
|
@@ -453,7 +454,7 @@ EXAMPLES
|
|
|
453
454
|
```
|
|
454
455
|
|
|
455
456
|
_See code:
|
|
456
|
-
[src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
457
|
+
[src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/create.ts)_
|
|
457
458
|
|
|
458
459
|
## `jbrowse help [COMMANDS]`
|
|
459
460
|
|
|
@@ -502,7 +503,7 @@ EXAMPLES
|
|
|
502
503
|
```
|
|
503
504
|
|
|
504
505
|
_See code:
|
|
505
|
-
[src/commands/remove-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
506
|
+
[src/commands/remove-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/remove-track.ts)_
|
|
506
507
|
|
|
507
508
|
## `jbrowse set-default-session`
|
|
508
509
|
|
|
@@ -541,7 +542,35 @@ EXAMPLES
|
|
|
541
542
|
```
|
|
542
543
|
|
|
543
544
|
_See code:
|
|
544
|
-
[src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
545
|
+
[src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/set-default-session.ts)_
|
|
546
|
+
|
|
547
|
+
## `jbrowse sort-gff FILE`
|
|
548
|
+
|
|
549
|
+
Helper utility to sort GFF files for tabix. Moves all lines starting with # to
|
|
550
|
+
the top of the file, and sort by refname and start position using unix utilities
|
|
551
|
+
sort and grep
|
|
552
|
+
|
|
553
|
+
```
|
|
554
|
+
USAGE
|
|
555
|
+
$ jbrowse sort-gff FILE
|
|
556
|
+
|
|
557
|
+
ARGUMENTS
|
|
558
|
+
FILE GFF file
|
|
559
|
+
|
|
560
|
+
DESCRIPTION
|
|
561
|
+
Helper utility to sort GFF files for tabix. Moves all lines starting with # to the top of the file, and sort by
|
|
562
|
+
refname and start position using unix utilities sort and grep
|
|
563
|
+
|
|
564
|
+
EXAMPLES
|
|
565
|
+
# sort gff and pipe to bgzip
|
|
566
|
+
|
|
567
|
+
$ jbrowse sort-gff input.gff | bgzip > sorted.gff.gz
|
|
568
|
+
|
|
569
|
+
$ tabix sorted.gff.gz
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
_See code:
|
|
573
|
+
[src/commands/sort-gff.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/sort-gff.ts)_
|
|
545
574
|
|
|
546
575
|
## `jbrowse text-index`
|
|
547
576
|
|
|
@@ -608,7 +637,7 @@ EXAMPLES
|
|
|
608
637
|
```
|
|
609
638
|
|
|
610
639
|
_See code:
|
|
611
|
-
[src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
640
|
+
[src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/text-index.ts)_
|
|
612
641
|
|
|
613
642
|
## `jbrowse upgrade [LOCALPATH]`
|
|
614
643
|
|
|
@@ -671,7 +700,7 @@ EXAMPLES
|
|
|
671
700
|
```
|
|
672
701
|
|
|
673
702
|
_See code:
|
|
674
|
-
[src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v2.
|
|
703
|
+
[src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v2.8.0/products/jbrowse-cli/src/commands/upgrade.ts)_
|
|
675
704
|
|
|
676
705
|
<!-- commandsstop -->
|
|
677
706
|
|
|
@@ -212,18 +212,19 @@ class AddTrack extends base_1.default {
|
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
else if (/\.2bit$/i.test(location) ||
|
|
215
|
+
/\.bedpe(\.gz)?$/i.test(location) ||
|
|
215
216
|
/\/trackData.jsonz?$/i.test(location) ||
|
|
216
217
|
/\/sparql$/i.test(location) ||
|
|
217
|
-
/\.out(
|
|
218
|
-
/\.paf(
|
|
219
|
-
/\.delta(
|
|
218
|
+
/\.out(\.gz)?$/i.test(location) ||
|
|
219
|
+
/\.paf(\.gz)?$/i.test(location) ||
|
|
220
|
+
/\.delta(\.gz)?$/i.test(location) ||
|
|
220
221
|
/\.bed?$/i.test(location) ||
|
|
221
222
|
/\.(bw|bigwig)$/i.test(location) ||
|
|
222
223
|
/\.(bb|bigbed)$/i.test(location) ||
|
|
223
224
|
/\.vcf$/i.test(location) ||
|
|
224
225
|
/\.gtf?$/i.test(location) ||
|
|
225
226
|
/\.gff3?$/i.test(location) ||
|
|
226
|
-
/\.chain(
|
|
227
|
+
/\.chain(\.gz)?$/i.test(location)) {
|
|
227
228
|
return {
|
|
228
229
|
file: location,
|
|
229
230
|
};
|
|
@@ -293,6 +294,12 @@ class AddTrack extends base_1.default {
|
|
|
293
294
|
type: 'UNSUPPORTED',
|
|
294
295
|
};
|
|
295
296
|
}
|
|
297
|
+
else if (/\.bedpe(.gz)?$/i.test(location)) {
|
|
298
|
+
return {
|
|
299
|
+
type: 'BedpeAdapter',
|
|
300
|
+
bedpeLocation: makeLocation(location),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
296
303
|
else if (/\.bed$/i.test(location)) {
|
|
297
304
|
return {
|
|
298
305
|
type: 'BedAdapter',
|
|
@@ -419,6 +426,7 @@ class AddTrack extends base_1.default {
|
|
|
419
426
|
TwoBitAdapter: 'ReferenceSequenceTrack',
|
|
420
427
|
VcfTabixAdapter: 'VariantTrack',
|
|
421
428
|
VcfAdapter: 'VariantTrack',
|
|
429
|
+
BedpeAdapter: 'VariantTrack',
|
|
422
430
|
BedAdapter: 'FeatureTrack',
|
|
423
431
|
HicAdapter: 'HicTrack',
|
|
424
432
|
PAFAdapter: 'SyntenyTrack',
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const command_exists_1 = require("command-exists");
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const base_1 = __importDefault(require("../base"));
|
|
10
|
+
class SortGff extends base_1.default {
|
|
11
|
+
async run() {
|
|
12
|
+
const { args: { file }, } = await this.parse(SortGff);
|
|
13
|
+
if ((0, command_exists_1.sync)('sh') &&
|
|
14
|
+
(0, command_exists_1.sync)('sort') &&
|
|
15
|
+
(0, command_exists_1.sync)('grep')) {
|
|
16
|
+
// this command comes from the tabix docs http://www.htslib.org/doc/tabix.html
|
|
17
|
+
(0, child_process_1.spawn)('sh', [
|
|
18
|
+
'-c',
|
|
19
|
+
`(grep "^#" "${file}"; grep -v "^#" "${file}" | sort -t"\`printf '\t'\`" -k1,1 -k4,4n)`,
|
|
20
|
+
], {
|
|
21
|
+
env: { ...process.env, LC_ALL: 'C' },
|
|
22
|
+
stdio: 'inherit',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
throw new Error('Unable to sort, requires unix type environment with sort, grep');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
SortGff.description = 'Helper utility to sort GFF files for tabix. Moves all lines starting with # to the top of the file, and sort by refname and start position using unix utilities sort and grep';
|
|
31
|
+
SortGff.examples = [
|
|
32
|
+
'# sort gff and pipe to bgzip',
|
|
33
|
+
'$ jbrowse sort-gff input.gff | bgzip > sorted.gff.gz',
|
|
34
|
+
'$ tabix sorted.gff.gz',
|
|
35
|
+
];
|
|
36
|
+
SortGff.args = {
|
|
37
|
+
file: core_1.Args.string({
|
|
38
|
+
required: true,
|
|
39
|
+
description: `GFF file`,
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
exports.default = SortGff;
|
package/oclif.manifest.json
CHANGED
|
@@ -827,6 +827,36 @@
|
|
|
827
827
|
"set-default-session.js"
|
|
828
828
|
]
|
|
829
829
|
},
|
|
830
|
+
"sort-gff": {
|
|
831
|
+
"aliases": [],
|
|
832
|
+
"args": {
|
|
833
|
+
"file": {
|
|
834
|
+
"description": "GFF file",
|
|
835
|
+
"name": "file",
|
|
836
|
+
"required": true
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
"description": "Helper utility to sort GFF files for tabix. Moves all lines starting with # to the top of the file, and sort by refname and start position using unix utilities sort and grep",
|
|
840
|
+
"examples": [
|
|
841
|
+
"# sort gff and pipe to bgzip",
|
|
842
|
+
"$ jbrowse sort-gff input.gff | bgzip > sorted.gff.gz",
|
|
843
|
+
"$ tabix sorted.gff.gz"
|
|
844
|
+
],
|
|
845
|
+
"flags": {},
|
|
846
|
+
"hasDynamicHelp": false,
|
|
847
|
+
"hiddenAliases": [],
|
|
848
|
+
"id": "sort-gff",
|
|
849
|
+
"pluginAlias": "@jbrowse/cli",
|
|
850
|
+
"pluginName": "@jbrowse/cli",
|
|
851
|
+
"pluginType": "core",
|
|
852
|
+
"strict": true,
|
|
853
|
+
"isESM": false,
|
|
854
|
+
"relativePath": [
|
|
855
|
+
"lib",
|
|
856
|
+
"commands",
|
|
857
|
+
"sort-gff.js"
|
|
858
|
+
]
|
|
859
|
+
},
|
|
830
860
|
"text-index": {
|
|
831
861
|
"aliases": [],
|
|
832
862
|
"args": {},
|
|
@@ -1057,5 +1087,5 @@
|
|
|
1057
1087
|
]
|
|
1058
1088
|
}
|
|
1059
1089
|
},
|
|
1060
|
-
"version": "2.
|
|
1090
|
+
"version": "2.8.0"
|
|
1061
1091
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "A command line tool for working with JBrowse 2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"boxen": "^4.2.0",
|
|
51
51
|
"chalk": "^4.1.0",
|
|
52
52
|
"cli-progress": "^3.9.0",
|
|
53
|
+
"command-exists": "^1.2.9",
|
|
53
54
|
"cors": "^2.8.5",
|
|
54
55
|
"decompress": "^4.0.0",
|
|
55
56
|
"express": "^4.17.1",
|
|
@@ -74,5 +75,5 @@
|
|
|
74
75
|
"publishConfig": {
|
|
75
76
|
"access": "public"
|
|
76
77
|
},
|
|
77
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "ee8c2bdc8bd4f1a70b1eefda984f04a2830d9ca0"
|
|
78
79
|
}
|