@jbrowse/cli 1.6.3 → 1.6.6
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 +21 -15
- package/lib/base.js +11 -11
- package/lib/commands/add-assembly.js +3 -3
- package/lib/commands/add-connection.js +5 -5
- package/lib/commands/add-track-json.js +1 -1
- package/lib/commands/add-track.js +25 -18
- package/lib/commands/admin-server.d.ts +2 -2
- package/lib/commands/admin-server.js +19 -18
- package/lib/commands/create.js +4 -4
- package/lib/commands/set-default-session.js +3 -3
- package/lib/commands/text-index.js +7 -7
- package/lib/commands/upgrade.d.ts +1 -0
- package/lib/commands/upgrade.js +17 -7
- package/lib/types/common.d.ts +1 -4
- package/lib/types/common.js +8 -6
- package/lib/types/gff3Adapter.js +9 -23
- package/lib/types/gtfAdapter.js +9 -23
- package/lib/types/vcfAdapter.js +9 -23
- package/lib/util.d.ts +6 -0
- package/lib/util.js +23 -0
- package/oclif.manifest.json +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -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.6.
|
|
160
|
+
_See code: [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/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.6.
|
|
214
|
+
_See code: [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/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.6.
|
|
288
|
+
_See code: [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/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.6.
|
|
313
|
+
_See code: [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/products/jbrowse-cli/src/commands/add-track-json.ts)_
|
|
314
314
|
|
|
315
315
|
## `jbrowse admin-server`
|
|
316
316
|
|
|
@@ -321,22 +321,26 @@ USAGE
|
|
|
321
321
|
$ jbrowse admin-server
|
|
322
322
|
|
|
323
323
|
OPTIONS
|
|
324
|
-
-h, --help
|
|
324
|
+
-h, --help show CLI help
|
|
325
325
|
|
|
326
|
-
-p, --port=port
|
|
327
|
-
|
|
326
|
+
-p, --port=port Specifified port to start the server on;
|
|
327
|
+
Default is 9090.
|
|
328
328
|
|
|
329
|
-
--
|
|
329
|
+
--bodySizeLimit=bodySizeLimit [default: 25mb] Size limit of the update message; may need to increase if config is
|
|
330
|
+
large.
|
|
331
|
+
Argument is passed to bytes library for parsing: https://www.npmjs.com/package/bytes.
|
|
330
332
|
|
|
331
|
-
--
|
|
332
|
-
|
|
333
|
+
--root=root path to the root of the JB2 installation.
|
|
334
|
+
Creates ./config.json if nonexistent. note that you can navigate to
|
|
335
|
+
?config=path/to/subconfig.json in the web browser and it will write to
|
|
336
|
+
rootDir/path/to/subconfig.json
|
|
333
337
|
|
|
334
338
|
EXAMPLES
|
|
335
339
|
$ jbrowse admin-server
|
|
336
340
|
$ jbrowse admin-server -p 8888
|
|
337
341
|
```
|
|
338
342
|
|
|
339
|
-
_See code: [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.
|
|
343
|
+
_See code: [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/products/jbrowse-cli/src/commands/admin-server.ts)_
|
|
340
344
|
|
|
341
345
|
## `jbrowse create LOCALPATH`
|
|
342
346
|
|
|
@@ -380,7 +384,7 @@ EXAMPLES
|
|
|
380
384
|
$ jbrowse create --listVersions
|
|
381
385
|
```
|
|
382
386
|
|
|
383
|
-
_See code: [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.
|
|
387
|
+
_See code: [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/products/jbrowse-cli/src/commands/create.ts)_
|
|
384
388
|
|
|
385
389
|
## `jbrowse help [COMMAND]`
|
|
386
390
|
|
|
@@ -434,7 +438,7 @@ EXAMPLES
|
|
|
434
438
|
$ jbrowse set-default-session --currentSession # Prints out current default session
|
|
435
439
|
```
|
|
436
440
|
|
|
437
|
-
_See code: [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.
|
|
441
|
+
_See code: [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/products/jbrowse-cli/src/commands/set-default-session.ts)_
|
|
438
442
|
|
|
439
443
|
## `jbrowse text-index`
|
|
440
444
|
|
|
@@ -490,7 +494,7 @@ EXAMPLES
|
|
|
490
494
|
$ jbrowse text-index --file myfile.gff3.gz --file myfile.vcfgz --out indexes
|
|
491
495
|
```
|
|
492
496
|
|
|
493
|
-
_See code: [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.
|
|
497
|
+
_See code: [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/products/jbrowse-cli/src/commands/text-index.ts)_
|
|
494
498
|
|
|
495
499
|
## `jbrowse upgrade [LOCALPATH]`
|
|
496
500
|
|
|
@@ -514,6 +518,8 @@ OPTIONS
|
|
|
514
518
|
|
|
515
519
|
--branch=branch Download a development build from a named git branch
|
|
516
520
|
|
|
521
|
+
--clean Removes old js,map,and LICENSE files in the installation
|
|
522
|
+
|
|
517
523
|
--nightly Download the latest development build from the main branch
|
|
518
524
|
|
|
519
525
|
EXAMPLES
|
|
@@ -536,7 +542,7 @@ EXAMPLES
|
|
|
536
542
|
$ jbrowse upgrade --nightly
|
|
537
543
|
```
|
|
538
544
|
|
|
539
|
-
_See code: [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.
|
|
545
|
+
_See code: [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v1.6.6/products/jbrowse-cli/src/commands/upgrade.ts)_
|
|
540
546
|
|
|
541
547
|
<!-- commandsstop -->
|
|
542
548
|
|
package/lib/base.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
-
const command_1 =
|
|
7
|
+
const command_1 = tslib_1.__importDefault(require("@oclif/command"));
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
|
-
const path_1 =
|
|
10
|
-
const json_parse_better_errors_1 =
|
|
11
|
-
const node_fetch_1 =
|
|
9
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
|
+
const json_parse_better_errors_1 = tslib_1.__importDefault(require("json-parse-better-errors"));
|
|
11
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
12
12
|
class JBrowseCommand extends command_1.default {
|
|
13
13
|
async init() { }
|
|
14
14
|
async readFile(location) {
|
|
@@ -102,7 +102,7 @@ class JBrowseCommand extends command_1.default {
|
|
|
102
102
|
var e_1, _a;
|
|
103
103
|
let versions = [];
|
|
104
104
|
try {
|
|
105
|
-
for (var _b =
|
|
105
|
+
for (var _b = tslib_1.__asyncValues(this.fetchVersions()), _c; _c = await _b.next(), !_c.done;) {
|
|
106
106
|
const iter = _c.value;
|
|
107
107
|
versions = versions.concat(iter);
|
|
108
108
|
}
|
|
@@ -120,7 +120,7 @@ class JBrowseCommand extends command_1.default {
|
|
|
120
120
|
var e_2, _a;
|
|
121
121
|
var _b;
|
|
122
122
|
try {
|
|
123
|
-
for (var _c =
|
|
123
|
+
for (var _c = tslib_1.__asyncValues(this.fetchVersions()), _d; _d = await _c.next(), !_d.done;) {
|
|
124
124
|
const versions = _d.value;
|
|
125
125
|
// if a release was just uploaded, or an erroneous build was made
|
|
126
126
|
// then it might have no build asset
|
|
@@ -147,14 +147,14 @@ class JBrowseCommand extends command_1.default {
|
|
|
147
147
|
throw new Error('no version tags found');
|
|
148
148
|
}
|
|
149
149
|
fetchVersions() {
|
|
150
|
-
return
|
|
150
|
+
return tslib_1.__asyncGenerator(this, arguments, function* fetchVersions_1() {
|
|
151
151
|
let page = 1;
|
|
152
152
|
let result;
|
|
153
153
|
do {
|
|
154
|
-
const response = yield
|
|
154
|
+
const response = yield tslib_1.__await((0, node_fetch_1.default)(`https://api.github.com/repos/GMOD/jbrowse-components/releases?page=${page}`));
|
|
155
155
|
if (response.ok) {
|
|
156
|
-
result = (yield
|
|
157
|
-
yield yield
|
|
156
|
+
result = (yield tslib_1.__await(response.json()));
|
|
157
|
+
yield yield tslib_1.__await(result.filter(release => release.tag_name.startsWith('v')));
|
|
158
158
|
page++;
|
|
159
159
|
}
|
|
160
160
|
else {
|
|
@@ -174,7 +174,7 @@ class JBrowseCommand extends command_1.default {
|
|
|
174
174
|
}
|
|
175
175
|
return file;
|
|
176
176
|
}
|
|
177
|
-
return this.error(`
|
|
177
|
+
return this.error(`Could not find version: ${response.statusText}`, {
|
|
178
178
|
exit: 90,
|
|
179
179
|
});
|
|
180
180
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const path_1 =
|
|
7
|
-
const base_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
8
8
|
const { rename, copyFile, mkdir, symlink } = fs_1.default.promises;
|
|
9
9
|
function isValidJSON(string) {
|
|
10
10
|
try {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const node_fetch_1 =
|
|
6
|
-
const fs_1 =
|
|
7
|
-
const path_1 =
|
|
8
|
-
const json_parse_better_errors_1 =
|
|
9
|
-
const base_1 =
|
|
5
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
+
const json_parse_better_errors_1 = tslib_1.__importDefault(require("json-parse-better-errors"));
|
|
9
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
10
10
|
class AddConnection extends base_1.default {
|
|
11
11
|
async run() {
|
|
12
12
|
const { args: runArgs, flags: runFlags } = this.parse(AddConnection);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
const base_1 =
|
|
6
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
7
7
|
class AddTrackJson extends base_1.default {
|
|
8
8
|
async run() {
|
|
9
9
|
const { args, flags: runFlags } = this.parse(AddTrackJson);
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const path_1 =
|
|
7
|
-
const json_parse_better_errors_1 =
|
|
8
|
-
const base_1 =
|
|
9
|
-
const { copyFile, rename, symlink
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const json_parse_better_errors_1 = tslib_1.__importDefault(require("json-parse-better-errors"));
|
|
8
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
9
|
+
const { copyFile, rename, symlink } = fs_1.default.promises;
|
|
10
10
|
const { COPYFILE_EXCL } = fs_1.default.constants;
|
|
11
11
|
const isUrl = (loc) => loc === null || loc === void 0 ? void 0 : loc.match(/^https?:\/\//);
|
|
12
12
|
class AddTrack extends base_1.default {
|
|
@@ -15,7 +15,7 @@ class AddTrack extends base_1.default {
|
|
|
15
15
|
const { track: argsTrack } = runArgs;
|
|
16
16
|
const { config, skipCheck, force, overwrite, category, description, load, subDir, target, protocol, out, indexFile: index, } = runFlags;
|
|
17
17
|
const output = target || out || '.';
|
|
18
|
-
const isDir = (
|
|
18
|
+
const isDir = fs_1.default.lstatSync(output).isDirectory();
|
|
19
19
|
this.target = isDir ? `${output}/config.json` : output;
|
|
20
20
|
let { trackType, trackId, name, assemblyNames } = runFlags;
|
|
21
21
|
const configDirectory = path_1.default.dirname(this.target);
|
|
@@ -112,30 +112,37 @@ class AddTrack extends base_1.default {
|
|
|
112
112
|
else {
|
|
113
113
|
configContents.tracks.push(trackConfig);
|
|
114
114
|
}
|
|
115
|
-
const filePaths = Object.values(this.guessFileNames(location, index)).filter((f) => !!f);
|
|
116
115
|
// get path of destination, and remove file at that path if it exists and
|
|
117
116
|
// force is set
|
|
118
|
-
const destinationFn =
|
|
119
|
-
const dest = path_1.default.join(dir, subDir, path_1.default.basename(file));
|
|
120
|
-
if (force
|
|
121
|
-
|
|
117
|
+
const destinationFn = (dir, file) => {
|
|
118
|
+
const dest = path_1.default.resolve(path_1.default.join(dir, subDir, path_1.default.basename(file)));
|
|
119
|
+
if (force) {
|
|
120
|
+
try {
|
|
121
|
+
fs_1.default.unlinkSync(dest);
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
/* unconditionally unlinkSync, due to
|
|
125
|
+
* https://github.com/nodejs/node/issues/14025#issuecomment-754021370
|
|
126
|
+
* and https://github.com/GMOD/jbrowse-components/issues/2768 */
|
|
127
|
+
}
|
|
122
128
|
}
|
|
123
129
|
return dest;
|
|
124
130
|
};
|
|
131
|
+
const loadType = load || 'inPlace';
|
|
125
132
|
const callbacks = {
|
|
126
133
|
copy: (src, dest) => copyFile(src, dest, COPYFILE_EXCL),
|
|
127
134
|
move: (src, dest) => rename(src, dest),
|
|
128
135
|
symlink: (src, dest) => symlink(path_1.default.resolve(src), dest),
|
|
136
|
+
inPlace: () => {
|
|
137
|
+
/* do nothing */
|
|
138
|
+
},
|
|
129
139
|
};
|
|
130
|
-
await Promise.all(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return callbacks[load](src, dest);
|
|
134
|
-
}
|
|
135
|
-
}));
|
|
140
|
+
await Promise.all(Object.values(this.guessFileNames(location, index))
|
|
141
|
+
.filter(f => !!f)
|
|
142
|
+
.map(src => callbacks[loadType](src, destinationFn(configDirectory, src))));
|
|
136
143
|
this.debug(`Writing configuration to file ${this.target}`);
|
|
137
144
|
await this.writeJsonFile(this.target, configContents);
|
|
138
|
-
this.log(`${idx !== -1 ? 'Overwrote' : 'Added'} track "${name}" ${idx !== -1 ? 'in' : 'to'} ${this.target}`);
|
|
145
|
+
this.log(`${idx !== -1 ? 'Overwrote' : 'Added'} track with name "${name}" and trackId "${trackId}" ${idx !== -1 ? 'in' : 'to'} ${this.target}`);
|
|
139
146
|
}
|
|
140
147
|
guessFileNames(fileName, index) {
|
|
141
148
|
if (/\.bam$/i.test(fileName)) {
|
|
@@ -5,8 +5,8 @@ export default class AdminServer extends JBrowseCommand {
|
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
7
|
port: flags.IOptionFlag<string | undefined>;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
root: flags.IOptionFlag<string | undefined>;
|
|
9
|
+
bodySizeLimit: flags.IOptionFlag<string>;
|
|
10
10
|
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const path_1 =
|
|
6
|
-
const fs_1 =
|
|
7
|
-
const crypto_1 =
|
|
8
|
-
const boxen_1 =
|
|
9
|
-
const chalk_1 =
|
|
10
|
-
const os_1 =
|
|
11
|
-
const express_1 =
|
|
12
|
-
const cors_1 =
|
|
13
|
-
const base_1 =
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
8
|
+
const boxen_1 = tslib_1.__importDefault(require("boxen"));
|
|
9
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const os_1 = tslib_1.__importDefault(require("os"));
|
|
11
|
+
const express_1 = tslib_1.__importDefault(require("express"));
|
|
12
|
+
const cors_1 = tslib_1.__importDefault(require("cors"));
|
|
13
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
14
14
|
function isValidPort(port) {
|
|
15
15
|
return port > 0 && port < 65535;
|
|
16
16
|
}
|
|
@@ -21,8 +21,8 @@ function generateKey() {
|
|
|
21
21
|
class AdminServer extends base_1.default {
|
|
22
22
|
async run() {
|
|
23
23
|
const { flags: runFlags } = this.parse(AdminServer);
|
|
24
|
-
const {
|
|
25
|
-
const output =
|
|
24
|
+
const { root, bodySizeLimit } = runFlags;
|
|
25
|
+
const output = root || '.';
|
|
26
26
|
const isDir = fs_1.default.lstatSync(output).isDirectory();
|
|
27
27
|
const outFile = isDir ? `${output}/config.json` : output;
|
|
28
28
|
const baseDir = path_1.default.dirname(outFile);
|
|
@@ -31,7 +31,7 @@ class AdminServer extends base_1.default {
|
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
33
|
this.debug(`Creating config file ${outFile}`);
|
|
34
|
-
await this.writeJsonFile(
|
|
34
|
+
await this.writeJsonFile(outFile, {
|
|
35
35
|
assemblies: [],
|
|
36
36
|
configuration: {},
|
|
37
37
|
connections: [],
|
|
@@ -52,10 +52,10 @@ class AdminServer extends base_1.default {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
const app = (0, express_1.default)();
|
|
55
|
-
app.use(express_1.default.static(
|
|
55
|
+
app.use(express_1.default.static(baseDir));
|
|
56
56
|
app.use((0, cors_1.default)());
|
|
57
57
|
// POST route to save config
|
|
58
|
-
app.use(express_1.default.json());
|
|
58
|
+
app.use(express_1.default.json({ limit: bodySizeLimit }));
|
|
59
59
|
app.post('/updateConfig', async (req, res) => {
|
|
60
60
|
if (adminKey === req.body.adminKey) {
|
|
61
61
|
this.debug('Admin key matches');
|
|
@@ -129,11 +129,12 @@ AdminServer.flags = {
|
|
|
129
129
|
char: 'p',
|
|
130
130
|
description: 'Specifified port to start the server on;\nDefault is 9090.',
|
|
131
131
|
}),
|
|
132
|
-
|
|
133
|
-
description: 'path to
|
|
132
|
+
root: command_1.flags.string({
|
|
133
|
+
description: 'path to the root of the JB2 installation.\nCreates ./config.json if nonexistent. note that you can navigate to ?config=path/to/subconfig.json in the web browser and it will write to rootDir/path/to/subconfig.json',
|
|
134
134
|
}),
|
|
135
|
-
|
|
136
|
-
description: '
|
|
135
|
+
bodySizeLimit: command_1.flags.string({
|
|
136
|
+
description: 'Size limit of the update message; may need to increase if config is large.\nArgument is passed to bytes library for parsing: https://www.npmjs.com/package/bytes.',
|
|
137
|
+
default: '25mb',
|
|
137
138
|
}),
|
|
138
139
|
help: command_1.flags.help({ char: 'h' }),
|
|
139
140
|
};
|
package/lib/commands/create.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const node_fetch_1 =
|
|
7
|
-
const unzipper_1 =
|
|
8
|
-
const base_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
7
|
+
const unzipper_1 = tslib_1.__importDefault(require("unzipper"));
|
|
8
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
9
9
|
const fsPromises = fs_1.default.promises;
|
|
10
10
|
class Create extends base_1.default {
|
|
11
11
|
async run() {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const json_parse_better_errors_1 =
|
|
7
|
-
const base_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const json_parse_better_errors_1 = tslib_1.__importDefault(require("json-parse-better-errors"));
|
|
7
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
8
8
|
const fsPromises = fs_1.default.promises;
|
|
9
9
|
class SetDefaultSession extends base_1.default {
|
|
10
10
|
async run() {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 =
|
|
5
|
-
const path_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const stream_1 = require("stream");
|
|
7
7
|
const ixixx_1 = require("ixixx");
|
|
8
8
|
const command_1 = require("@oclif/command");
|
|
9
9
|
const gff3Adapter_1 = require("../types/gff3Adapter");
|
|
10
10
|
const vcfAdapter_1 = require("../types/vcfAdapter");
|
|
11
|
-
const base_1 =
|
|
11
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
12
12
|
const common_1 = require("../types/common");
|
|
13
|
-
const object_fromentries_1 =
|
|
13
|
+
const object_fromentries_1 = tslib_1.__importDefault(require("object.fromentries"));
|
|
14
14
|
if (!Object.fromEntries) {
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
object_fromentries_1.default.shim();
|
|
@@ -205,16 +205,16 @@ class TextIndex extends base_1.default {
|
|
|
205
205
|
return ixIxxStream;
|
|
206
206
|
}
|
|
207
207
|
indexFiles(trackConfigs, attributes, outLocation, quiet, typesToExclude) {
|
|
208
|
-
return
|
|
208
|
+
return tslib_1.__asyncGenerator(this, arguments, function* indexFiles_1() {
|
|
209
209
|
for (const config of trackConfigs) {
|
|
210
210
|
const { adapter, textSearching } = config;
|
|
211
211
|
const { type } = adapter;
|
|
212
212
|
const { indexingFeatureTypesToExclude: types = typesToExclude, indexingAttributes: attrs = attributes, } = textSearching || {};
|
|
213
213
|
if (type === 'Gff3TabixAdapter') {
|
|
214
|
-
yield
|
|
214
|
+
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues((0, gff3Adapter_1.indexGff3)(config, attrs, outLocation, types, quiet))));
|
|
215
215
|
}
|
|
216
216
|
else if (type === 'VcfTabixAdapter') {
|
|
217
|
-
yield
|
|
217
|
+
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues((0, vcfAdapter_1.indexVcf)(config, attrs, outLocation, types, quiet))));
|
|
218
218
|
}
|
|
219
219
|
// gtf unused currently
|
|
220
220
|
}
|
|
@@ -15,6 +15,7 @@ export default class Upgrade extends JBrowseCommand {
|
|
|
15
15
|
tag: flags.IOptionFlag<string | undefined>;
|
|
16
16
|
branch: flags.IOptionFlag<string | undefined>;
|
|
17
17
|
nightly: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
18
|
+
clean: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
18
19
|
url: flags.IOptionFlag<string | undefined>;
|
|
19
20
|
};
|
|
20
21
|
run(): Promise<void>;
|
package/lib/commands/upgrade.js
CHANGED
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
const rimraf_1 = tslib_1.__importDefault(require("rimraf"));
|
|
6
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
9
|
+
const unzipper_1 = tslib_1.__importDefault(require("unzipper"));
|
|
10
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
10
11
|
class Upgrade extends base_1.default {
|
|
11
12
|
async run() {
|
|
12
13
|
const { args: runArgs, flags: runFlags } = this.parse(Upgrade);
|
|
13
14
|
const { localPath: argsPath } = runArgs;
|
|
14
|
-
const { listVersions, tag, url, branch, nightly } = runFlags;
|
|
15
|
+
const { clean, listVersions, tag, url, branch, nightly } = runFlags;
|
|
15
16
|
if (listVersions) {
|
|
16
|
-
const versions = (await this.fetchGithubVersions()).map(
|
|
17
|
+
const versions = (await this.fetchGithubVersions()).map(v => v.tag_name);
|
|
17
18
|
this.log(`All JBrowse versions:\n${versions.join('\n')}`);
|
|
18
19
|
this.exit();
|
|
19
20
|
}
|
|
@@ -40,6 +41,12 @@ class Upgrade extends base_1.default {
|
|
|
40
41
|
type !== 'application/octet-stream') {
|
|
41
42
|
this.error('The URL provided does not seem to be a JBrowse installation URL');
|
|
42
43
|
}
|
|
44
|
+
if (clean) {
|
|
45
|
+
rimraf_1.default.sync(path_1.default.join(argsPath, 'static'));
|
|
46
|
+
fs_1.default.readdirSync(argsPath)
|
|
47
|
+
.filter(f => f.includes('worker.js'))
|
|
48
|
+
.forEach(f => fs_1.default.unlinkSync(path_1.default.join(argsPath, f)));
|
|
49
|
+
}
|
|
43
50
|
await response.body.pipe(unzipper_1.default.Extract({ path: argsPath })).promise();
|
|
44
51
|
this.log(`Unpacked ${locationUrl} at ${argsPath}`);
|
|
45
52
|
}
|
|
@@ -90,6 +97,9 @@ Upgrade.flags = {
|
|
|
90
97
|
nightly: command_1.flags.boolean({
|
|
91
98
|
description: 'Download the latest development build from the main branch',
|
|
92
99
|
}),
|
|
100
|
+
clean: command_1.flags.boolean({
|
|
101
|
+
description: 'Removes old js,map,and LICENSE files in the installation',
|
|
102
|
+
}),
|
|
93
103
|
url: command_1.flags.string({
|
|
94
104
|
char: 'u',
|
|
95
105
|
description: 'A direct URL to a JBrowse 2 release',
|
package/lib/types/common.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IncomingMessage } from 'http';
|
|
3
|
-
import { FollowResponse } from 'follow-redirects';
|
|
4
1
|
import { Track } from '../base';
|
|
5
|
-
export declare function createRemoteStream(urlIn: string): Promise<
|
|
2
|
+
export declare function createRemoteStream(urlIn: string): Promise<import("node-fetch").Response>;
|
|
6
3
|
export declare function isURL(FileName: string): boolean;
|
|
7
4
|
export declare function guessAdapterFromFileName(filePath: string): Track;
|
|
8
5
|
export declare function supported(type: string): boolean;
|
package/lib/types/common.js
CHANGED
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateMeta = exports.supported = exports.guessAdapterFromFileName = exports.isURL = exports.createRemoteStream = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const
|
|
7
|
-
const path_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
8
|
// Method for handing off the parsing of a gff3 file URL.
|
|
9
9
|
// Calls the proper parser depending on if it is gzipped or not.
|
|
10
10
|
// Returns a @gmod/gff stream.
|
|
11
11
|
async function createRemoteStream(urlIn) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const response = await (0, node_fetch_1.default)(urlIn);
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
throw new Error(`Failed to fetch ${urlIn} status ${response.status} ${response.statusText}`);
|
|
15
|
+
}
|
|
16
|
+
return response;
|
|
15
17
|
}
|
|
16
18
|
exports.createRemoteStream = createRemoteStream;
|
|
17
19
|
// Checks if the passed in string is a valid URL.
|
package/lib/types/gff3Adapter.js
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.indexGff3 = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const util_1 = require("../util");
|
|
6
6
|
const cli_progress_1 = require("cli-progress");
|
|
7
7
|
const zlib_1 = require("zlib");
|
|
8
|
-
const readline_1 =
|
|
9
|
-
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
10
|
-
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
8
|
+
const readline_1 = tslib_1.__importDefault(require("readline"));
|
|
11
9
|
function indexGff3(config, attributes, outLocation, typesToExclude, quiet) {
|
|
12
|
-
return
|
|
10
|
+
return tslib_1.__asyncGenerator(this, arguments, function* indexGff3_1() {
|
|
13
11
|
var e_1, _a;
|
|
14
12
|
const { adapter, trackId } = config;
|
|
15
13
|
const { gffGzLocation: { uri }, } = adapter;
|
|
@@ -19,32 +17,20 @@ function indexGff3(config, attributes, outLocation, typesToExclude, quiet) {
|
|
|
19
17
|
format: '{bar} ' + trackId + ' {percentage}% | ETA: {eta}s',
|
|
20
18
|
etaBuffer: 2000,
|
|
21
19
|
}, cli_progress_1.Presets.shades_classic);
|
|
22
|
-
let fileDataStream;
|
|
23
|
-
let totalBytes = 0;
|
|
24
20
|
let receivedBytes = 0;
|
|
25
|
-
|
|
26
|
-
fileDataStream = yield (0, tslib_1.__await)((0, common_1.createRemoteStream)(uri));
|
|
27
|
-
totalBytes = +(fileDataStream.headers['content-length'] || 0);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const filename = path_1.default.isAbsolute(uri) ? uri : path_1.default.join(outLocation, uri);
|
|
31
|
-
totalBytes = fs_1.default.statSync(filename).size;
|
|
32
|
-
fileDataStream = fs_1.default.createReadStream(filename);
|
|
33
|
-
}
|
|
21
|
+
const { totalBytes, stream } = yield tslib_1.__await((0, util_1.getLocalOrRemoteStream)(uri, outLocation));
|
|
34
22
|
if (!quiet) {
|
|
35
23
|
progressBar.start(totalBytes, 0);
|
|
36
24
|
}
|
|
37
|
-
|
|
25
|
+
stream.on('data', chunk => {
|
|
38
26
|
receivedBytes += chunk.length;
|
|
39
27
|
progressBar.update(receivedBytes);
|
|
40
28
|
});
|
|
41
29
|
const rl = readline_1.default.createInterface({
|
|
42
|
-
input: uri.
|
|
43
|
-
? fileDataStream.pipe((0, zlib_1.createGunzip)())
|
|
44
|
-
: fileDataStream,
|
|
30
|
+
input: uri.match(/.b?gz$/) ? stream.pipe((0, zlib_1.createGunzip)()) : stream,
|
|
45
31
|
});
|
|
46
32
|
try {
|
|
47
|
-
for (var rl_1 =
|
|
33
|
+
for (var rl_1 = tslib_1.__asyncValues(rl), rl_1_1; rl_1_1 = yield tslib_1.__await(rl_1.next()), !rl_1_1.done;) {
|
|
48
34
|
const line = rl_1_1.value;
|
|
49
35
|
if (line.startsWith('#')) {
|
|
50
36
|
continue;
|
|
@@ -75,7 +61,7 @@ function indexGff3(config, attributes, outLocation, typesToExclude, quiet) {
|
|
|
75
61
|
encodeURIComponent(trackId),
|
|
76
62
|
...attrs.map(a => encodeURIComponent(a)),
|
|
77
63
|
]).replace(/,/g, '|');
|
|
78
|
-
yield yield
|
|
64
|
+
yield yield tslib_1.__await(`${record} ${[...new Set(attrs)].join(' ')}\n`);
|
|
79
65
|
}
|
|
80
66
|
}
|
|
81
67
|
}
|
|
@@ -83,7 +69,7 @@ function indexGff3(config, attributes, outLocation, typesToExclude, quiet) {
|
|
|
83
69
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
84
70
|
finally {
|
|
85
71
|
try {
|
|
86
|
-
if (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield
|
|
72
|
+
if (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield tslib_1.__await(_a.call(rl_1));
|
|
87
73
|
}
|
|
88
74
|
finally { if (e_1) throw e_1.error; }
|
|
89
75
|
}
|
package/lib/types/gtfAdapter.js
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.indexGtf = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const util_1 = require("../util");
|
|
6
6
|
const cli_progress_1 = require("cli-progress");
|
|
7
7
|
const zlib_1 = require("zlib");
|
|
8
|
-
const readline_1 =
|
|
9
|
-
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
10
|
-
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
8
|
+
const readline_1 = tslib_1.__importDefault(require("readline"));
|
|
11
9
|
function indexGtf(config, attributes, outLocation, typesToExclude, quiet) {
|
|
12
|
-
return
|
|
10
|
+
return tslib_1.__asyncGenerator(this, arguments, function* indexGtf_1() {
|
|
13
11
|
var e_1, _a;
|
|
14
12
|
const { adapter, trackId } = config;
|
|
15
13
|
const { gtfLocation: { uri }, } = adapter;
|
|
@@ -19,33 +17,21 @@ function indexGtf(config, attributes, outLocation, typesToExclude, quiet) {
|
|
|
19
17
|
format: '{bar} ' + trackId + ' {percentage}% | ETA: {eta}s',
|
|
20
18
|
etaBuffer: 2000,
|
|
21
19
|
}, cli_progress_1.Presets.shades_classic);
|
|
22
|
-
let fileDataStream;
|
|
23
|
-
let totalBytes = 0;
|
|
24
20
|
let receivedBytes = 0;
|
|
25
|
-
|
|
26
|
-
fileDataStream = yield (0, tslib_1.__await)((0, common_1.createRemoteStream)(uri));
|
|
27
|
-
totalBytes = +(fileDataStream.headers['content-length'] || 0);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const filename = path_1.default.join(outLocation, uri);
|
|
31
|
-
totalBytes = fs_1.default.statSync(filename).size;
|
|
32
|
-
fileDataStream = fs_1.default.createReadStream(filename);
|
|
33
|
-
}
|
|
21
|
+
const { totalBytes, stream } = yield tslib_1.__await((0, util_1.getLocalOrRemoteStream)(uri, outLocation));
|
|
34
22
|
if (!quiet) {
|
|
35
23
|
progressBar.start(totalBytes, 0);
|
|
36
24
|
}
|
|
37
|
-
|
|
25
|
+
stream.on('data', chunk => {
|
|
38
26
|
receivedBytes += chunk.length;
|
|
39
27
|
progressBar.update(receivedBytes);
|
|
40
28
|
});
|
|
41
|
-
const gzStream = uri.
|
|
42
|
-
? fileDataStream.pipe((0, zlib_1.createGunzip)())
|
|
43
|
-
: fileDataStream;
|
|
29
|
+
const gzStream = uri.match(/.b?gz$/) ? stream.pipe((0, zlib_1.createGunzip)()) : stream;
|
|
44
30
|
const rl = readline_1.default.createInterface({
|
|
45
31
|
input: gzStream,
|
|
46
32
|
});
|
|
47
33
|
try {
|
|
48
|
-
for (var rl_1 =
|
|
34
|
+
for (var rl_1 = tslib_1.__asyncValues(rl), rl_1_1; rl_1_1 = yield tslib_1.__await(rl_1.next()), !rl_1_1.done;) {
|
|
49
35
|
const line = rl_1_1.value;
|
|
50
36
|
if (line.startsWith('#')) {
|
|
51
37
|
continue;
|
|
@@ -76,7 +62,7 @@ function indexGtf(config, attributes, outLocation, typesToExclude, quiet) {
|
|
|
76
62
|
encodeURIComponent(trackId),
|
|
77
63
|
...attrs.map(a => encodeURIComponent(a || '')),
|
|
78
64
|
]).replace(/,/g, '|');
|
|
79
|
-
yield yield
|
|
65
|
+
yield yield tslib_1.__await(`${record} ${[...new Set(attrs)].join(' ')}\n`);
|
|
80
66
|
}
|
|
81
67
|
}
|
|
82
68
|
}
|
|
@@ -84,7 +70,7 @@ function indexGtf(config, attributes, outLocation, typesToExclude, quiet) {
|
|
|
84
70
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
85
71
|
finally {
|
|
86
72
|
try {
|
|
87
|
-
if (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield
|
|
73
|
+
if (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield tslib_1.__await(_a.call(rl_1));
|
|
88
74
|
}
|
|
89
75
|
finally { if (e_1) throw e_1.error; }
|
|
90
76
|
}
|
package/lib/types/vcfAdapter.js
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.indexVcf = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const util_1 = require("../util");
|
|
6
6
|
const cli_progress_1 = require("cli-progress");
|
|
7
7
|
const zlib_1 = require("zlib");
|
|
8
|
-
const readline_1 =
|
|
9
|
-
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
10
|
-
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
8
|
+
const readline_1 = tslib_1.__importDefault(require("readline"));
|
|
11
9
|
function indexVcf(config, attributesToIndex, outLocation, typesToExclude, quiet) {
|
|
12
|
-
return
|
|
10
|
+
return tslib_1.__asyncGenerator(this, arguments, function* indexVcf_1() {
|
|
13
11
|
var e_1, _a;
|
|
14
12
|
const { adapter, trackId } = config;
|
|
15
13
|
const { vcfGzLocation: { uri }, } = adapter;
|
|
@@ -19,33 +17,21 @@ function indexVcf(config, attributesToIndex, outLocation, typesToExclude, quiet)
|
|
|
19
17
|
format: '{bar} ' + trackId + ' {percentage}% | ETA: {eta}s',
|
|
20
18
|
etaBuffer: 2000,
|
|
21
19
|
}, cli_progress_1.Presets.shades_classic);
|
|
22
|
-
let fileDataStream;
|
|
23
|
-
let totalBytes = 0;
|
|
24
20
|
let receivedBytes = 0;
|
|
25
|
-
|
|
26
|
-
fileDataStream = yield (0, tslib_1.__await)((0, common_1.createRemoteStream)(uri));
|
|
27
|
-
totalBytes = +(fileDataStream.headers['content-length'] || 0);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const filename = path_1.default.isAbsolute(uri) ? uri : path_1.default.join(outLocation, uri);
|
|
31
|
-
totalBytes = fs_1.default.statSync(filename).size;
|
|
32
|
-
fileDataStream = fs_1.default.createReadStream(filename);
|
|
33
|
-
}
|
|
21
|
+
const { totalBytes, stream } = yield tslib_1.__await((0, util_1.getLocalOrRemoteStream)(uri, outLocation));
|
|
34
22
|
if (!quiet) {
|
|
35
23
|
progressBar.start(totalBytes, 0);
|
|
36
24
|
}
|
|
37
|
-
|
|
25
|
+
stream.on('data', chunk => {
|
|
38
26
|
receivedBytes += chunk.length;
|
|
39
27
|
progressBar.update(receivedBytes);
|
|
40
28
|
});
|
|
41
|
-
const gzStream = uri.
|
|
42
|
-
? fileDataStream.pipe((0, zlib_1.createGunzip)())
|
|
43
|
-
: fileDataStream;
|
|
29
|
+
const gzStream = uri.match(/.b?gz$/) ? stream.pipe((0, zlib_1.createGunzip)()) : stream;
|
|
44
30
|
const rl = readline_1.default.createInterface({
|
|
45
31
|
input: gzStream,
|
|
46
32
|
});
|
|
47
33
|
try {
|
|
48
|
-
for (var rl_1 =
|
|
34
|
+
for (var rl_1 = tslib_1.__asyncValues(rl), rl_1_1; rl_1_1 = yield tslib_1.__await(rl_1.next()), !rl_1_1.done;) {
|
|
49
35
|
const line = rl_1_1.value;
|
|
50
36
|
if (line.startsWith('#')) {
|
|
51
37
|
continue;
|
|
@@ -81,14 +67,14 @@ function indexVcf(config, attributesToIndex, outLocation, typesToExclude, quiet)
|
|
|
81
67
|
encodeURIComponent(id || ''),
|
|
82
68
|
...infoAttrs.map(a => encodeURIComponent(a || '')),
|
|
83
69
|
]).replace(/,/g, '|');
|
|
84
|
-
yield yield
|
|
70
|
+
yield yield tslib_1.__await(`${record} ${[...new Set(attrs)].join(' ')}\n`);
|
|
85
71
|
}
|
|
86
72
|
}
|
|
87
73
|
}
|
|
88
74
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
89
75
|
finally {
|
|
90
76
|
try {
|
|
91
|
-
if (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield
|
|
77
|
+
if (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield tslib_1.__await(_a.call(rl_1));
|
|
92
78
|
}
|
|
93
79
|
finally { if (e_1) throw e_1.error; }
|
|
94
80
|
}
|
package/lib/util.d.ts
ADDED
package/lib/util.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLocalOrRemoteStream = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("./types/common");
|
|
6
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
+
async function getLocalOrRemoteStream(uri, out) {
|
|
9
|
+
let stream;
|
|
10
|
+
let totalBytes = 0;
|
|
11
|
+
if ((0, common_1.isURL)(uri)) {
|
|
12
|
+
const result = await (0, common_1.createRemoteStream)(uri);
|
|
13
|
+
totalBytes = +(result.headers.get('Content-Length') || 0);
|
|
14
|
+
stream = result.body;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
const filename = path_1.default.isAbsolute(uri) ? uri : path_1.default.join(out, uri);
|
|
18
|
+
totalBytes = fs_1.default.statSync(filename).size;
|
|
19
|
+
stream = fs_1.default.createReadStream(filename);
|
|
20
|
+
}
|
|
21
|
+
return { totalBytes, stream };
|
|
22
|
+
}
|
|
23
|
+
exports.getLocalOrRemoteStream = getLocalOrRemoteStream;
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.6.3","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.6.6","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."},"root":{"name":"root","type":"option","description":"path to the root of the JB2 installation.\nCreates ./config.json if nonexistent. note that you can navigate to ?config=path/to/subconfig.json in the web browser and it will write to rootDir/path/to/subconfig.json"},"bodySizeLimit":{"name":"bodySizeLimit","type":"option","description":"Size limit of the update message; may need to increase if config is large.\nArgument is passed to bytes library for parsing: https://www.npmjs.com/package/bytes.","default":"25mb"},"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},"clean":{"name":"clean","type":"boolean","description":"Removes old js,map,and LICENSE files in the installation","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.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "A command line tool for working with JBrowse 2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -54,16 +54,15 @@
|
|
|
54
54
|
"cli-progress": "^3.9.0",
|
|
55
55
|
"cors": "^2.8.5",
|
|
56
56
|
"express": "^4.17.1",
|
|
57
|
-
"follow-redirects": "^1.14.6",
|
|
58
57
|
"ixixx": "^1.0.19",
|
|
59
58
|
"json-parse-better-errors": "^1.0.2",
|
|
60
59
|
"node-fetch": "^2.6.0",
|
|
61
60
|
"object.fromentries": "^2.0.5",
|
|
61
|
+
"rimraf": "^3.0.2",
|
|
62
62
|
"tslib": "^2.3.1",
|
|
63
63
|
"unzipper": "^0.10.11"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@types/follow-redirects": "^1.13.0",
|
|
67
66
|
"typescript": "^4.5.2"
|
|
68
67
|
},
|
|
69
68
|
"oclif": {
|
|
@@ -77,5 +76,5 @@
|
|
|
77
76
|
"publishConfig": {
|
|
78
77
|
"access": "public"
|
|
79
78
|
},
|
|
80
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "9fcca7793af0df2d6e527ddaace2b368c8ed2879"
|
|
81
80
|
}
|