@jbrowse/cli 1.5.0 → 1.5.4

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 CHANGED
@@ -4,7 +4,7 @@ id: cli
4
4
  toplevel: true
5
5
  ---
6
6
 
7
- This document covers the CLI tools.
7
+ This document covers the CLI tools. Note: for @jbrowse/img static export tool, see https://www.npmjs.com/package/@jbrowse/img
8
8
 
9
9
  ## Installation
10
10
 
@@ -83,17 +83,17 @@ OPTIONS
83
83
  type of sequence, by default inferred from sequence file
84
84
 
85
85
  indexedFasta An index FASTA (e.g. .fa or .fasta) file;
86
- can optionally specify --faiLocation
86
+ can optionally specify --faiLocation
87
87
 
88
88
  bgzipFasta A block-gzipped and indexed FASTA (e.g. .fa.gz or .fasta.gz) file;
89
- can optionally specify --faiLocation and/or --gziLocation
89
+ can optionally specify --faiLocation and/or --gziLocation
90
90
 
91
91
  twoBit A twoBit (e.g. .2bit) file
92
92
 
93
93
  chromSizes A chromosome sizes (e.g. .chrom.sizes) file
94
94
 
95
95
  custom Either a JSON file location or inline JSON that defines a custom
96
- sequence adapter; must provide --name if using inline JSON
96
+ sequence adapter; must provide --name if using inline JSON
97
97
 
98
98
  --displayName=displayName
99
99
  The display name to specify for the assembly, e.g. "Homo sapiens (hg38)" while the name can be a shorter identifier
@@ -131,16 +131,33 @@ OPTIONS
131
131
  Creates ./config.json if nonexistent
132
132
 
133
133
  EXAMPLES
134
+ # add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and
135
+ GRCh38.fa.fai to current directory
134
136
  $ jbrowse add-assembly GRCh38.fa --load copy
135
- $ jbrowse add-assembly GRCh38.fasta.with.custom.extension.xyz --type indexedFasta --load move
136
- $ jbrowse add-assembly myFile.fa.gz --name hg38 --alias GRCh38 --displayName "Homo sapiens (hg38)" --load inPlace
137
+
138
+ # add assembly to a specific jb2 installation path using --out, and copies the .fa and .fa.fai file to /path/to/jb2
139
+ $ jbrowse add-assembly GRCh38.fa --out /path/to/jb2/ --load copy
140
+
141
+ # force indexedFasta for add-assembly without relying on file extension
142
+ $ jbrowse add-assembly GRCh38.xyz --type indexedFasta --load copy
143
+
144
+ # add displayName for an assembly
145
+ $ jbrowse add-assembly myFile.fa.gz --name hg38 --displayName "Homo sapiens (hg38)"
146
+
147
+ # use chrom.sizes file for assembly instead of a fasta file
137
148
  $ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace
149
+
150
+ # add assembly from preconfigured json file, expert option
138
151
  $ jbrowse add-assembly GRCh38.config.json --load copy
152
+
153
+ # add assembly from a 2bit file, also note pointing direct to a URL so no --load flag needed
139
154
  $ jbrowse add-assembly https://example.com/data/sample.2bit
140
- $ jbrowse add-assembly GRCh38.fa --target /path/to/jb2/installation/customconfig.json --load copy
155
+
156
+ # add a bgzip indexed fasta inferred by fa.gz extension. assumes .fa.gz.gzi and .fa.gz.fai files also exists
157
+ $ jbrowse add-assembly myfile.fa.gz --load copy
141
158
  ```
142
159
 
143
- _See code: [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/add-assembly.ts)_
160
+ _See code: [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/add-assembly.ts)_
144
161
 
145
162
  ## `jbrowse add-connection CONNECTIONURLORPATH`
146
163
 
@@ -194,7 +211,7 @@ EXAMPLES
194
211
  /path/to/jb2/installation/config.json
195
212
  ```
196
213
 
197
- _See code: [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/add-connection.ts)_
214
+ _See code: [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/add-connection.ts)_
198
215
 
199
216
  ## `jbrowse add-track TRACK`
200
217
 
@@ -249,26 +266,26 @@ OPTIONS
249
266
  throughout config
250
267
 
251
268
  EXAMPLES
252
- # --load copy copies my.bam and my.bam.bai to current directory and adds track to config.json
269
+ # copy /path/to/my.bam and /path/to/my.bam.bai to current directory and adds track to config.json
253
270
  $ jbrowse add-track /path/to/my.bam --load copy
254
271
 
255
- # same as above, but specify path to bai file
256
- $ jbrowse add-track /path/to/my.bam --indexFile /path/to/my.bai --load copy
272
+ # copy my.bam and my.bam.bai to /path/to/jb2/bam and adds track entry to /path/to/jb2/bam/config.json
273
+ $ jbrowse add-track my.bam --load copy --out /path/to/jb2 --subDir bam
257
274
 
258
- # --load symlink creates symlink in /path/to/jb2/ directory for this file, and adds track to config.json
259
- $ jbrowse add-track /path/to/my.bam --target /path/to/jb2/config.json --load symlink
275
+ # same as above, but specify path to bai file. needed for if the bai file does not have the extension .bam.bai
276
+ $ jbrowse add-track my.bam --indexFile my.bai --load copy
260
277
 
261
- # no --load flag to add literal URL for this track to config.json
262
- $ jbrowse add-track https://mywebsite.com/my.bam
278
+ # creates symlink for /path/to/my.bam and adds track to config.json
279
+ $ jbrowse add-track /path/to/my.bam --load symlink
263
280
 
264
- # --load move to move the file
265
- $ jbrowse add-track /path/to/my.bam --name 'New Track' --load move
281
+ # add track from URL to config.json, no --load flag needed
282
+ $ jbrowse add-track https://mywebsite.com/my.bam
266
283
 
267
- # --load inPlace puts /url/relative/path.bam in the config without performing any file operations
268
- $ jbrowse add-track /url/relative/path.bam --trackId AlignmentsTrack1 --load url --overwrite
284
+ # --load inPlace adds a track without doing file operations
285
+ $ jbrowse add-track /url/relative/path.bam --load inPlace
269
286
  ```
270
287
 
271
- _See code: [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/add-track.ts)_
288
+ _See code: [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/add-track.ts)_
272
289
 
273
290
  ## `jbrowse add-track-json TRACK`
274
291
 
@@ -293,7 +310,7 @@ EXAMPLES
293
310
  $ jbrowse add-track-json track.json --update
294
311
  ```
295
312
 
296
- _See code: [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/add-track-json.ts)_
313
+ _See code: [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/add-track-json.ts)_
297
314
 
298
315
  ## `jbrowse admin-server`
299
316
 
@@ -319,7 +336,7 @@ EXAMPLES
319
336
  $ jbrowse admin-server -p 8888
320
337
  ```
321
338
 
322
- _See code: [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/admin-server.ts)_
339
+ _See code: [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/admin-server.ts)_
323
340
 
324
341
  ## `jbrowse create LOCALPATH`
325
342
 
@@ -347,14 +364,23 @@ OPTIONS
347
364
  --nightly Download the latest development build from the main branch
348
365
 
349
366
  EXAMPLES
367
+ # Download latest release from github, and put in specific path
350
368
  $ jbrowse create /path/to/new/installation
369
+
370
+ # Download latest release from github and force overwrite existing contents at path
351
371
  $ jbrowse create /path/to/new/installation --force
372
+
373
+ # Download latest release from a specific URL
352
374
  $ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip
375
+
376
+ # Download a specific tag from github
353
377
  $ jbrowse create /path/to/new/installation --tag v1.0.0
354
- $ jbrowse create --listVersions # Lists out all available versions of JBrowse 2
378
+
379
+ # List available versions
380
+ $ jbrowse create --listVersions
355
381
  ```
356
382
 
357
- _See code: [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/create.ts)_
383
+ _See code: [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/create.ts)_
358
384
 
359
385
  ## `jbrowse help [COMMAND]`
360
386
 
@@ -371,7 +397,7 @@ OPTIONS
371
397
  --all see all commands in CLI
372
398
  ```
373
399
 
374
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.3/src/commands/help.ts)_
400
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.14/src/commands/help.ts)_
375
401
 
376
402
  ## `jbrowse set-default-session`
377
403
 
@@ -408,7 +434,7 @@ EXAMPLES
408
434
  $ jbrowse set-default-session --currentSession # Prints out current default session
409
435
  ```
410
436
 
411
- _See code: [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/set-default-session.ts)_
437
+ _See code: [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/set-default-session.ts)_
412
438
 
413
439
  ## `jbrowse text-index`
414
440
 
@@ -457,14 +483,14 @@ EXAMPLES
457
483
  $ jbrowse text-index --out /path/to/jb2/
458
484
 
459
485
  # indexes only a specific assembly, and overwrite what was previously there using force (which is needed if a previous
460
- index already existed)
486
+ index already existed)
461
487
  $ jbrowse text-index -a hg19 --force
462
488
 
463
489
  # create index for some files for use in @jbrowse/react-linear-genome-view or similar
464
490
  $ jbrowse text-index --file myfile.gff3.gz --file myfile.vcfgz --out indexes
465
491
  ```
466
492
 
467
- _See code: [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/text-index.ts)_
493
+ _See code: [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/text-index.ts)_
468
494
 
469
495
  ## `jbrowse upgrade [LOCALPATH]`
470
496
 
@@ -491,14 +517,26 @@ OPTIONS
491
517
  --nightly Download the latest development build from the main branch
492
518
 
493
519
  EXAMPLES
494
- $ jbrowse upgrade # Upgrades current directory to latest jbrowse release
520
+ # Upgrades current directory to latest jbrowse release
521
+ $ jbrowse upgrade
522
+
523
+ # Upgrade jbrowse instance at a specific filesystem path
495
524
  $ jbrowse upgrade /path/to/jbrowse2/installation
525
+
526
+ # Upgrade to a specific tag
496
527
  $ jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0
497
- $ jbrowse upgrade --listVersions # Lists out all available versions of JBrowse 2
528
+
529
+ # List versions available on github
530
+ $ jbrowse upgrade --listVersions
531
+
532
+ # Upgrade from a specific URL
498
533
  $ jbrowse upgrade --url https://sample.com/jbrowse2.zip
534
+
535
+ # Get nightly release from main branch
536
+ $ jbrowse upgrade --nightly
499
537
  ```
500
538
 
501
- _See code: [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.0/products/jbrowse-cli/src/commands/upgrade.ts)_
539
+ _See code: [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v1.5.4/products/jbrowse-cli/src/commands/upgrade.ts)_
502
540
 
503
541
  <!-- commandsstop -->
504
542
 
package/lib/base.d.ts CHANGED
@@ -10,9 +10,9 @@ export interface Gff3TabixAdapter {
10
10
  type: 'Gff3TabixAdapter';
11
11
  gffGzLocation: UriLocation;
12
12
  }
13
- export interface GtfTabixAdapter {
14
- type: 'GtfTabixAdapter';
15
- gtfGzLocation: UriLocation;
13
+ export interface GtfAdapter {
14
+ type: 'GtfAdapter';
15
+ gtfLocation: UriLocation;
16
16
  }
17
17
  export interface VcfTabixAdapter {
18
18
  type: 'VcfTabixAdapter';
@@ -79,7 +79,7 @@ export interface Track {
79
79
  trackId: string;
80
80
  name: string;
81
81
  assemblyNames: string[];
82
- adapter: Gff3TabixAdapter | GtfTabixAdapter | VcfTabixAdapter;
82
+ adapter: Gff3TabixAdapter | GtfAdapter | VcfTabixAdapter;
83
83
  textSearching?: TextSearching;
84
84
  }
85
85
  export interface Config {
@@ -97,6 +97,7 @@ interface GithubRelease {
97
97
  assets?: [
98
98
  {
99
99
  browser_download_url: string;
100
+ name: string;
100
101
  }
101
102
  ];
102
103
  }
@@ -110,7 +111,7 @@ export default abstract class JBrowseCommand extends Command {
110
111
  fetchGithubVersions(): Promise<GithubRelease[]>;
111
112
  getLatest(): Promise<string>;
112
113
  fetchVersions(): AsyncGenerator<GithubRelease[], void, unknown>;
113
- getTag(tag: string): Promise<any>;
114
+ getTag(tag: string): Promise<string>;
114
115
  getBranch(branch: string): Promise<string>;
115
116
  }
116
117
  export {};
package/lib/base.js CHANGED
@@ -118,9 +118,10 @@ class JBrowseCommand extends command_1.default {
118
118
  }
119
119
  async getLatest() {
120
120
  var e_2, _a;
121
+ var _b;
121
122
  try {
122
- for (var _b = (0, tslib_1.__asyncValues)(this.fetchVersions()), _c; _c = await _b.next(), !_c.done;) {
123
- const versions = _c.value;
123
+ for (var _c = (0, tslib_1.__asyncValues)(this.fetchVersions()), _d; _d = await _c.next(), !_d.done;) {
124
+ const versions = _d.value;
124
125
  // if a release was just uploaded, or an erroneous build was made
125
126
  // then it might have no build asset
126
127
  const nonprereleases = versions
@@ -128,14 +129,18 @@ class JBrowseCommand extends command_1.default {
128
129
  .filter(release => release.assets && release.assets.length > 0);
129
130
  if (nonprereleases.length !== 0) {
130
131
  // @ts-ignore
131
- return nonprereleases[0].assets[0].browser_download_url;
132
+ const file = (_b = nonprereleases[0].assets.find(f => f.name.includes('jbrowse-web'))) === null || _b === void 0 ? void 0 : _b.browser_download_url;
133
+ if (!file) {
134
+ throw new Error('no jbrowse-web download found');
135
+ }
136
+ return file;
132
137
  }
133
138
  }
134
139
  }
135
140
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
136
141
  finally {
137
142
  try {
138
- if (_c && !_c.done && (_a = _b.return)) await _a.call(_b);
143
+ if (_d && !_d.done && (_a = _c.return)) await _a.call(_c);
139
144
  }
140
145
  finally { if (e_2) throw e_2.error; }
141
146
  }
@@ -159,12 +164,15 @@ class JBrowseCommand extends command_1.default {
159
164
  });
160
165
  }
161
166
  async getTag(tag) {
167
+ var _a, _b;
162
168
  const response = await (0, node_fetch_1.default)(`https://api.github.com/repos/GMOD/jbrowse-components/releases/tags/${tag}`);
163
169
  if (response.ok) {
164
- const result = await response.json();
165
- return result && result.assets
166
- ? result.assets[0].browser_download_url
167
- : this.error('Could not find version specified. Use --listVersions to see all available versions', { exit: 90 });
170
+ const result = (await response.json());
171
+ const file = (_b = (_a = result === null || result === void 0 ? void 0 : result.assets) === null || _a === void 0 ? void 0 : _a.find(f => f.name.includes('jbrowse-web'))) === null || _b === void 0 ? void 0 : _b.browser_download_url;
172
+ if (!file) {
173
+ this.error('Could not find version specified. Use --listVersions to see all available versions', { exit: 90 });
174
+ }
175
+ return file;
168
176
  }
169
177
  return this.error(`Error: Could not find version: ${response.statusText}`, {
170
178
  exit: 90,
@@ -5,7 +5,7 @@ const command_1 = require("@oclif/command");
5
5
  const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
6
6
  const path_1 = (0, tslib_1.__importDefault)(require("path"));
7
7
  const base_1 = (0, tslib_1.__importDefault)(require("../base"));
8
- const fsPromises = fs_1.default.promises;
8
+ const { rename, copyFile, mkdir, symlink } = fs_1.default.promises;
9
9
  function isValidJSON(string) {
10
10
  try {
11
11
  JSON.parse(string);
@@ -206,7 +206,7 @@ class AddAssembly extends base_1.default {
206
206
  const { args: runArgs, flags: runFlags } = this.parse(AddAssembly);
207
207
  const output = runFlags.target || runFlags.out || '.';
208
208
  if (!(await exists(output))) {
209
- await fsPromises.mkdir(output, { recursive: true });
209
+ await mkdir(output, { recursive: true });
210
210
  }
211
211
  const isDir = fs_1.default.statSync(output).isDirectory();
212
212
  this.target = isDir ? `${output}/config.json` : output;
@@ -347,7 +347,7 @@ class AddAssembly extends base_1.default {
347
347
  if (!filePath) {
348
348
  return undefined;
349
349
  }
350
- return fsPromises.copyFile(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
350
+ return copyFile(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
351
351
  }));
352
352
  return true;
353
353
  }
@@ -356,7 +356,7 @@ class AddAssembly extends base_1.default {
356
356
  if (!filePath) {
357
357
  return undefined;
358
358
  }
359
- return fsPromises.symlink(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
359
+ return symlink(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
360
360
  }));
361
361
  return true;
362
362
  }
@@ -365,7 +365,7 @@ class AddAssembly extends base_1.default {
365
365
  if (!filePath) {
366
366
  return undefined;
367
367
  }
368
- return fsPromises.rename(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
368
+ return rename(filePath, path_1.default.join(path_1.default.dirname(destination), path_1.default.basename(filePath)));
369
369
  }));
370
370
  return true;
371
371
  }
@@ -379,13 +379,29 @@ class AddAssembly extends base_1.default {
379
379
  exports.default = AddAssembly;
380
380
  AddAssembly.description = 'Add an assembly to a JBrowse 2 configuration';
381
381
  AddAssembly.examples = [
382
+ '# add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and GRCh38.fa.fai to current directory',
382
383
  '$ jbrowse add-assembly GRCh38.fa --load copy',
383
- '$ jbrowse add-assembly GRCh38.fasta.with.custom.extension.xyz --type indexedFasta --load move',
384
- '$ jbrowse add-assembly myFile.fa.gz --name hg38 --alias GRCh38 --displayName "Homo sapiens (hg38)" --load inPlace',
384
+ '',
385
+ '# add assembly to a specific jb2 installation path using --out, and copies the .fa and .fa.fai file to /path/to/jb2',
386
+ '$ jbrowse add-assembly GRCh38.fa --out /path/to/jb2/ --load copy',
387
+ '',
388
+ '# force indexedFasta for add-assembly without relying on file extension',
389
+ '$ jbrowse add-assembly GRCh38.xyz --type indexedFasta --load copy',
390
+ '',
391
+ '# add displayName for an assembly',
392
+ '$ jbrowse add-assembly myFile.fa.gz --name hg38 --displayName "Homo sapiens (hg38)"',
393
+ '',
394
+ '# use chrom.sizes file for assembly instead of a fasta file',
385
395
  '$ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace',
396
+ '',
397
+ '# add assembly from preconfigured json file, expert option',
386
398
  '$ jbrowse add-assembly GRCh38.config.json --load copy',
399
+ '',
400
+ '# add assembly from a 2bit file, also note pointing direct to a URL so no --load flag needed',
387
401
  '$ jbrowse add-assembly https://example.com/data/sample.2bit',
388
- '$ jbrowse add-assembly GRCh38.fa --target /path/to/jb2/installation/customconfig.json --load copy',
402
+ '',
403
+ '# add a bgzip indexed fasta inferred by fa.gz extension. assumes .fa.gz.gzi and .fa.gz.fai files also exists',
404
+ '$ jbrowse add-assembly myfile.fa.gz --load copy',
389
405
  ];
390
406
  AddAssembly.args = [
391
407
  {
@@ -42,21 +42,17 @@ export default class AddTrack extends JBrowseCommand {
42
42
  index: string;
43
43
  index2?: undefined;
44
44
  } | {
45
- file?: undefined;
45
+ file: string;
46
46
  index?: undefined;
47
47
  index2?: undefined;
48
48
  } | {
49
- file: string;
50
- index: undefined;
49
+ file?: undefined;
50
+ index?: undefined;
51
51
  index2?: undefined;
52
52
  } | {
53
53
  file: string;
54
54
  index: string;
55
55
  index2: string;
56
- } | {
57
- file: string;
58
- index?: undefined;
59
- index2?: undefined;
60
56
  };
61
57
  guessAdapter(fileName: string, protocol: string, index?: string): {
62
58
  type: string;
@@ -67,7 +63,9 @@ export default class AddTrack extends JBrowseCommand {
67
63
  };
68
64
  cramLocation?: undefined;
69
65
  craiLocation?: undefined;
66
+ gffLocation?: undefined;
70
67
  gffGzLocation?: undefined;
68
+ gtfLocation?: undefined;
71
69
  vcfLocation?: undefined;
72
70
  vcfGzLocation?: undefined;
73
71
  bedGzLocation?: undefined;
@@ -87,7 +85,9 @@ export default class AddTrack extends JBrowseCommand {
87
85
  craiLocation: UriLocation | LocalPathLocation;
88
86
  bamLocation?: undefined;
89
87
  index?: undefined;
88
+ gffLocation?: undefined;
90
89
  gffGzLocation?: undefined;
90
+ gtfLocation?: undefined;
91
91
  vcfLocation?: undefined;
92
92
  vcfGzLocation?: undefined;
93
93
  bedGzLocation?: undefined;
@@ -103,11 +103,13 @@ export default class AddTrack extends JBrowseCommand {
103
103
  pafLocation?: undefined;
104
104
  } | {
105
105
  type: string;
106
+ gffLocation: UriLocation | LocalPathLocation;
106
107
  bamLocation?: undefined;
107
108
  index?: undefined;
108
109
  cramLocation?: undefined;
109
110
  craiLocation?: undefined;
110
111
  gffGzLocation?: undefined;
112
+ gtfLocation?: undefined;
111
113
  vcfLocation?: undefined;
112
114
  vcfGzLocation?: undefined;
113
115
  bedGzLocation?: undefined;
@@ -131,6 +133,30 @@ export default class AddTrack extends JBrowseCommand {
131
133
  bamLocation?: undefined;
132
134
  cramLocation?: undefined;
133
135
  craiLocation?: undefined;
136
+ gffLocation?: undefined;
137
+ gtfLocation?: undefined;
138
+ vcfLocation?: undefined;
139
+ vcfGzLocation?: undefined;
140
+ bedGzLocation?: undefined;
141
+ bigBedLocation?: undefined;
142
+ bigWigLocation?: undefined;
143
+ fastaLocation?: undefined;
144
+ faiLocation?: undefined;
145
+ gziLocation?: undefined;
146
+ twoBitLocation?: undefined;
147
+ rootUrlTemplate?: undefined;
148
+ endpoint?: undefined;
149
+ hicLocation?: undefined;
150
+ pafLocation?: undefined;
151
+ } | {
152
+ type: string;
153
+ gtfLocation: UriLocation | LocalPathLocation;
154
+ bamLocation?: undefined;
155
+ index?: undefined;
156
+ cramLocation?: undefined;
157
+ craiLocation?: undefined;
158
+ gffLocation?: undefined;
159
+ gffGzLocation?: undefined;
134
160
  vcfLocation?: undefined;
135
161
  vcfGzLocation?: undefined;
136
162
  bedGzLocation?: undefined;
@@ -151,7 +177,9 @@ export default class AddTrack extends JBrowseCommand {
151
177
  index?: undefined;
152
178
  cramLocation?: undefined;
153
179
  craiLocation?: undefined;
180
+ gffLocation?: undefined;
154
181
  gffGzLocation?: undefined;
182
+ gtfLocation?: undefined;
155
183
  vcfGzLocation?: undefined;
156
184
  bedGzLocation?: undefined;
157
185
  bigBedLocation?: undefined;
@@ -174,8 +202,32 @@ export default class AddTrack extends JBrowseCommand {
174
202
  bamLocation?: undefined;
175
203
  cramLocation?: undefined;
176
204
  craiLocation?: undefined;
205
+ gffLocation?: undefined;
206
+ gffGzLocation?: undefined;
207
+ gtfLocation?: undefined;
208
+ vcfLocation?: undefined;
209
+ bedGzLocation?: undefined;
210
+ bigBedLocation?: undefined;
211
+ bigWigLocation?: undefined;
212
+ fastaLocation?: undefined;
213
+ faiLocation?: undefined;
214
+ gziLocation?: undefined;
215
+ twoBitLocation?: undefined;
216
+ rootUrlTemplate?: undefined;
217
+ endpoint?: undefined;
218
+ hicLocation?: undefined;
219
+ pafLocation?: undefined;
220
+ } | {
221
+ type: string;
222
+ bamLocation?: undefined;
223
+ index?: undefined;
224
+ cramLocation?: undefined;
225
+ craiLocation?: undefined;
226
+ gffLocation?: undefined;
177
227
  gffGzLocation?: undefined;
228
+ gtfLocation?: undefined;
178
229
  vcfLocation?: undefined;
230
+ vcfGzLocation?: undefined;
179
231
  bedGzLocation?: undefined;
180
232
  bigBedLocation?: undefined;
181
233
  bigWigLocation?: undefined;
@@ -197,7 +249,9 @@ export default class AddTrack extends JBrowseCommand {
197
249
  bamLocation?: undefined;
198
250
  cramLocation?: undefined;
199
251
  craiLocation?: undefined;
252
+ gffLocation?: undefined;
200
253
  gffGzLocation?: undefined;
254
+ gtfLocation?: undefined;
201
255
  vcfLocation?: undefined;
202
256
  vcfGzLocation?: undefined;
203
257
  bigBedLocation?: undefined;
@@ -217,7 +271,9 @@ export default class AddTrack extends JBrowseCommand {
217
271
  index?: undefined;
218
272
  cramLocation?: undefined;
219
273
  craiLocation?: undefined;
274
+ gffLocation?: undefined;
220
275
  gffGzLocation?: undefined;
276
+ gtfLocation?: undefined;
221
277
  vcfLocation?: undefined;
222
278
  vcfGzLocation?: undefined;
223
279
  bedGzLocation?: undefined;
@@ -237,7 +293,9 @@ export default class AddTrack extends JBrowseCommand {
237
293
  index?: undefined;
238
294
  cramLocation?: undefined;
239
295
  craiLocation?: undefined;
296
+ gffLocation?: undefined;
240
297
  gffGzLocation?: undefined;
298
+ gtfLocation?: undefined;
241
299
  vcfLocation?: undefined;
242
300
  vcfGzLocation?: undefined;
243
301
  bedGzLocation?: undefined;
@@ -258,7 +316,9 @@ export default class AddTrack extends JBrowseCommand {
258
316
  index?: undefined;
259
317
  cramLocation?: undefined;
260
318
  craiLocation?: undefined;
319
+ gffLocation?: undefined;
261
320
  gffGzLocation?: undefined;
321
+ gtfLocation?: undefined;
262
322
  vcfLocation?: undefined;
263
323
  vcfGzLocation?: undefined;
264
324
  bedGzLocation?: undefined;
@@ -279,7 +339,9 @@ export default class AddTrack extends JBrowseCommand {
279
339
  index?: undefined;
280
340
  cramLocation?: undefined;
281
341
  craiLocation?: undefined;
342
+ gffLocation?: undefined;
282
343
  gffGzLocation?: undefined;
344
+ gtfLocation?: undefined;
283
345
  vcfLocation?: undefined;
284
346
  vcfGzLocation?: undefined;
285
347
  bedGzLocation?: undefined;
@@ -297,7 +359,9 @@ export default class AddTrack extends JBrowseCommand {
297
359
  index?: undefined;
298
360
  cramLocation?: undefined;
299
361
  craiLocation?: undefined;
362
+ gffLocation?: undefined;
300
363
  gffGzLocation?: undefined;
364
+ gtfLocation?: undefined;
301
365
  vcfLocation?: undefined;
302
366
  vcfGzLocation?: undefined;
303
367
  bedGzLocation?: undefined;
@@ -317,7 +381,9 @@ export default class AddTrack extends JBrowseCommand {
317
381
  index?: undefined;
318
382
  cramLocation?: undefined;
319
383
  craiLocation?: undefined;
384
+ gffLocation?: undefined;
320
385
  gffGzLocation?: undefined;
386
+ gtfLocation?: undefined;
321
387
  vcfLocation?: undefined;
322
388
  vcfGzLocation?: undefined;
323
389
  bedGzLocation?: undefined;
@@ -337,7 +403,9 @@ export default class AddTrack extends JBrowseCommand {
337
403
  index?: undefined;
338
404
  cramLocation?: undefined;
339
405
  craiLocation?: undefined;
406
+ gffLocation?: undefined;
340
407
  gffGzLocation?: undefined;
408
+ gtfLocation?: undefined;
341
409
  vcfLocation?: undefined;
342
410
  vcfGzLocation?: undefined;
343
411
  bedGzLocation?: undefined;
@@ -357,7 +425,9 @@ export default class AddTrack extends JBrowseCommand {
357
425
  index?: undefined;
358
426
  cramLocation?: undefined;
359
427
  craiLocation?: undefined;
428
+ gffLocation?: undefined;
360
429
  gffGzLocation?: undefined;
430
+ gtfLocation?: undefined;
361
431
  vcfLocation?: undefined;
362
432
  vcfGzLocation?: undefined;
363
433
  bedGzLocation?: undefined;
@@ -377,7 +447,9 @@ export default class AddTrack extends JBrowseCommand {
377
447
  index?: undefined;
378
448
  cramLocation?: undefined;
379
449
  craiLocation?: undefined;
450
+ gffLocation?: undefined;
380
451
  gffGzLocation?: undefined;
452
+ gtfLocation?: undefined;
381
453
  vcfLocation?: undefined;
382
454
  vcfGzLocation?: undefined;
383
455
  bedGzLocation?: undefined;
@@ -6,14 +6,16 @@ const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
6
6
  const path_1 = (0, tslib_1.__importDefault)(require("path"));
7
7
  const json_parse_better_errors_1 = (0, tslib_1.__importDefault)(require("json-parse-better-errors"));
8
8
  const base_1 = (0, tslib_1.__importDefault)(require("../base"));
9
- const fsPromises = fs_1.default.promises;
9
+ const { copyFile, rename, symlink, lstat, unlink } = fs_1.default.promises;
10
+ const { COPYFILE_EXCL } = fs_1.default.constants;
11
+ const isUrl = (loc) => loc === null || loc === void 0 ? void 0 : loc.match(/^https?:\/\//);
10
12
  class AddTrack extends base_1.default {
11
13
  async run() {
12
14
  const { args: runArgs, flags: runFlags } = this.parse(AddTrack);
13
15
  const { track: argsTrack } = runArgs;
14
16
  const { config, skipCheck, force, overwrite, category, description, load, subDir, target, protocol, out, indexFile: index, } = runFlags;
15
17
  const output = target || out || '.';
16
- const isDir = (await fsPromises.lstat(output)).isDirectory();
18
+ const isDir = (await lstat(output)).isDirectory();
17
19
  this.target = isDir ? `${output}/config.json` : output;
18
20
  let { trackType, trackId, name, assemblyNames } = runFlags;
19
21
  const configDirectory = path_1.default.dirname(this.target);
@@ -27,7 +29,6 @@ class AddTrack extends base_1.default {
27
29
  }
28
30
  }
29
31
  const location = argsTrack;
30
- const isUrl = (loc) => loc === null || loc === void 0 ? void 0 : loc.match(/^https?:\/\//);
31
32
  const inPlace = load === 'inPlace';
32
33
  const useIndex = isUrl(index) || inPlace || index;
33
34
  const effectiveLocation = isUrl(location) || inPlace
@@ -78,11 +79,9 @@ class AddTrack extends base_1.default {
78
79
  this.debug(`Assembly name(s) is :${assemblyNames}`);
79
80
  const configObj = config ? (0, json_parse_better_errors_1.default)(config) : {};
80
81
  const trackConfig = Object.assign({ type: trackType, trackId,
81
- name, category: category ? category.split(',').map(c => c.trim()) : undefined, assemblyNames: assemblyNames.split(',').map(a => a.trim()), adapter }, configObj);
82
+ name,
83
+ adapter, category: category === null || category === void 0 ? void 0 : category.split(',').map(c => c.trim()), assemblyNames: assemblyNames.split(',').map(a => a.trim()), description }, configObj);
82
84
  this.debug(`Track location: ${location}, index: ${adapter ? adapter.index : ''}`);
83
- if (description) {
84
- trackConfig.description = description;
85
- }
86
85
  // any special track modifications go here
87
86
  switch (trackType) {
88
87
  case 'AlignmentsTrack': {
@@ -113,56 +112,27 @@ class AddTrack extends base_1.default {
113
112
  else {
114
113
  configContents.tracks.push(trackConfig);
115
114
  }
116
- // copy/symlinks/moves the track into the jbrowse installation directory
117
- const filePaths = Object.values(this.guessFileNames(location, index)).filter(f => !!f);
118
- const destinationFn = (dir, file) => path_1.default.join(dir, subDir, path_1.default.basename(file));
119
- switch (load) {
120
- case 'copy': {
121
- await Promise.all(filePaths.map(async (filePath) => {
122
- const dest = destinationFn(configDirectory, filePath);
123
- try {
124
- if (force && fs_1.default.existsSync(dest)) {
125
- await fsPromises.unlink(dest);
126
- }
127
- }
128
- catch (e) {
129
- this.error(e instanceof Error ? e : `${e}`);
130
- }
131
- return fsPromises.copyFile(filePath, dest, fs_1.default.constants.COPYFILE_EXCL);
132
- }));
133
- break;
134
- }
135
- case 'symlink': {
136
- await Promise.all(filePaths.map(async (filePath) => {
137
- const dest = destinationFn(configDirectory, filePath);
138
- try {
139
- if (force && fs_1.default.existsSync(dest)) {
140
- await fsPromises.unlink(dest);
141
- }
142
- }
143
- catch (e) {
144
- this.error(e instanceof Error ? e : `${e}`);
145
- }
146
- return fsPromises.symlink(filePath, dest);
147
- }));
148
- break;
115
+ const filePaths = Object.values(this.guessFileNames(location, index)).filter((f) => !!f);
116
+ // get path of destination, and remove file at that path if it exists and
117
+ // force is set
118
+ const destinationFn = async (dir, file) => {
119
+ const dest = path_1.default.join(dir, subDir, path_1.default.basename(file));
120
+ if (force && fs_1.default.existsSync(dest)) {
121
+ await unlink(dest);
149
122
  }
150
- case 'move': {
151
- await Promise.all(filePaths.map(async (filePath) => {
152
- const dest = destinationFn(configDirectory, filePath);
153
- try {
154
- if (force && fs_1.default.existsSync(dest)) {
155
- await fsPromises.unlink(dest);
156
- }
157
- }
158
- catch (e) {
159
- this.error(e instanceof Error ? e : `${e}`);
160
- }
161
- return fsPromises.rename(filePath, dest);
162
- }));
163
- break;
123
+ return dest;
124
+ };
125
+ const callbacks = {
126
+ copy: (src, dest) => copyFile(src, dest, COPYFILE_EXCL),
127
+ move: (src, dest) => rename(src, dest),
128
+ symlink: (src, dest) => symlink(src, dest),
129
+ };
130
+ await Promise.all(filePaths.map(async (src) => {
131
+ const dest = await destinationFn(configDirectory, src);
132
+ if (load === 'copy' || load === 'move' || load === 'symlink') {
133
+ return callbacks[load](src, dest);
164
134
  }
165
- }
135
+ }));
166
136
  this.debug(`Writing configuration to file ${this.target}`);
167
137
  await this.writeJsonFile(this.target, configContents);
168
138
  this.log(`${idx !== -1 ? 'Overwrote' : 'Added'} track "${name}" ${idx !== -1 ? 'in' : 'to'} ${this.target}`);
@@ -177,28 +147,34 @@ class AddTrack extends base_1.default {
177
147
  if (/\.cram$/i.test(fileName)) {
178
148
  return {
179
149
  file: fileName,
180
- index: `${fileName}.crai`,
150
+ index: index || `${fileName}.crai`,
181
151
  };
182
152
  }
183
153
  if (/\.gff3?$/i.test(fileName)) {
184
- return {};
154
+ return {
155
+ file: fileName,
156
+ };
185
157
  }
186
158
  if (/\.gff3?\.b?gz$/i.test(fileName)) {
187
159
  return {
188
160
  file: fileName,
189
- index: `${fileName}.tbi`,
161
+ index: index || `${fileName}.tbi`,
190
162
  };
191
163
  }
192
164
  if (/\.gtf?$/i.test(fileName)) {
193
- return {};
165
+ return {
166
+ file: fileName,
167
+ };
194
168
  }
195
169
  if (/\.vcf$/i.test(fileName)) {
196
- return {};
170
+ return {
171
+ file: fileName,
172
+ };
197
173
  }
198
174
  if (/\.vcf\.b?gz$/i.test(fileName)) {
199
175
  return {
200
176
  file: fileName,
201
- index: `${fileName}.tbi`,
177
+ index: index || `${fileName}.tbi`,
202
178
  };
203
179
  }
204
180
  if (/\.vcf\.idx$/i.test(fileName)) {
@@ -219,13 +195,11 @@ class AddTrack extends base_1.default {
219
195
  if (/\.(bb|bigbed)$/i.test(fileName)) {
220
196
  return {
221
197
  file: fileName,
222
- index: undefined,
223
198
  };
224
199
  }
225
200
  if (/\.(bw|bigwig)$/i.test(fileName)) {
226
201
  return {
227
202
  file: fileName,
228
- index: undefined,
229
203
  };
230
204
  }
231
205
  if (/\.(fa|fasta|fas|fna|mfa)$/i.test(fileName)) {
@@ -278,7 +252,10 @@ class AddTrack extends base_1.default {
278
252
  return { uri: location, locationType: 'UriLocation' };
279
253
  }
280
254
  if (protocol === 'localPath') {
281
- return { localPath: location, locationType: 'LocalPathLocation' };
255
+ return {
256
+ localPath: location,
257
+ locationType: 'LocalPathLocation',
258
+ };
282
259
  }
283
260
  throw new Error(`invalid protocol ${protocol}`);
284
261
  }
@@ -301,7 +278,8 @@ class AddTrack extends base_1.default {
301
278
  }
302
279
  if (/\.gff3?$/i.test(fileName)) {
303
280
  return {
304
- type: 'UNSUPPORTED',
281
+ type: 'Gff3Adapter',
282
+ gffLocation: makeLocation(fileName),
305
283
  };
306
284
  }
307
285
  if (/\.gff3?\.b?gz$/i.test(fileName)) {
@@ -316,7 +294,8 @@ class AddTrack extends base_1.default {
316
294
  }
317
295
  if (/\.gtf?$/i.test(fileName)) {
318
296
  return {
319
- type: 'UNSUPPORTED',
297
+ type: 'GtfAdapter',
298
+ gtfLocation: makeLocation(fileName),
320
299
  };
321
300
  }
322
301
  if (/\.vcf$/i.test(fileName)) {
@@ -439,18 +418,23 @@ class AddTrack extends base_1.default {
439
418
  exports.default = AddTrack;
440
419
  AddTrack.description = 'Add a track to a JBrowse 2 configuration';
441
420
  AddTrack.examples = [
442
- `# --load copy copies my.bam and my.bam.bai to current directory and adds track to config.json`,
443
- '$ jbrowse add-track /path/to/my.bam --load copy\n',
444
- `# same as above, but specify path to bai file`,
445
- '$ jbrowse add-track /path/to/my.bam --indexFile /path/to/my.bai --load copy\n',
446
- `# --load symlink creates symlink in /path/to/jb2/ directory for this file, and adds track to config.json`,
447
- '$ jbrowse add-track /path/to/my.bam --target /path/to/jb2/config.json --load symlink\n',
448
- `# no --load flag to add literal URL for this track to config.json`,
449
- '$ jbrowse add-track https://mywebsite.com/my.bam\n',
450
- `# --load move to move the file `,
451
- `$ jbrowse add-track /path/to/my.bam --name 'New Track' --load move\n`,
452
- `# --load inPlace puts /url/relative/path.bam in the config without performing any file operations`,
453
- `$ jbrowse add-track /url/relative/path.bam --trackId AlignmentsTrack1 --load url --overwrite`,
421
+ '# copy /path/to/my.bam and /path/to/my.bam.bai to current directory and adds track to config.json',
422
+ '$ jbrowse add-track /path/to/my.bam --load copy',
423
+ '',
424
+ '# copy my.bam and my.bam.bai to /path/to/jb2/bam and adds track entry to /path/to/jb2/bam/config.json',
425
+ '$ jbrowse add-track my.bam --load copy --out /path/to/jb2 --subDir bam',
426
+ '',
427
+ `# same as above, but specify path to bai file. needed for if the bai file does not have the extension .bam.bai`,
428
+ '$ jbrowse add-track my.bam --indexFile my.bai --load copy',
429
+ '',
430
+ '# creates symlink for /path/to/my.bam and adds track to config.json',
431
+ '$ jbrowse add-track /path/to/my.bam --load symlink',
432
+ '',
433
+ '# add track from URL to config.json, no --load flag needed',
434
+ '$ jbrowse add-track https://mywebsite.com/my.bam',
435
+ '',
436
+ '# --load inPlace adds a track without doing file operations',
437
+ '$ jbrowse add-track /url/relative/path.bam --load inPlace',
454
438
  ];
455
439
  AddTrack.args = [
456
440
  {
@@ -60,11 +60,20 @@ class Create extends base_1.default {
60
60
  exports.default = Create;
61
61
  Create.description = 'Downloads and installs the latest JBrowse 2 release';
62
62
  Create.examples = [
63
+ '# Download latest release from github, and put in specific path',
63
64
  '$ jbrowse create /path/to/new/installation',
65
+ '',
66
+ '# Download latest release from github and force overwrite existing contents at path',
64
67
  '$ jbrowse create /path/to/new/installation --force',
68
+ '',
69
+ '# Download latest release from a specific URL',
65
70
  '$ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip',
71
+ '',
72
+ '# Download a specific tag from github',
66
73
  '$ jbrowse create /path/to/new/installation --tag v1.0.0',
67
- '$ jbrowse create --listVersions # Lists out all available versions of JBrowse 2',
74
+ '',
75
+ '# List available versions',
76
+ '$ jbrowse create --listVersions',
68
77
  ];
69
78
  Create.args = [
70
79
  {
@@ -7,10 +7,14 @@ 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
- const gtfAdapter_1 = require("../types/gtfAdapter");
11
10
  const vcfAdapter_1 = require("../types/vcfAdapter");
12
11
  const base_1 = (0, tslib_1.__importDefault)(require("../base"));
13
12
  const common_1 = require("../types/common");
13
+ const object_fromentries_1 = (0, tslib_1.__importDefault)(require("object.fromentries"));
14
+ if (!Object.fromEntries) {
15
+ // @ts-ignore
16
+ object_fromentries_1.default.shim();
17
+ }
14
18
  function readConf(confFilePath) {
15
19
  return JSON.parse(fs_1.default.readFileSync(confFilePath, 'utf8'));
16
20
  }
@@ -209,12 +213,10 @@ class TextIndex extends base_1.default {
209
213
  if (type === 'Gff3TabixAdapter') {
210
214
  yield (0, tslib_1.__await)(yield* (0, tslib_1.__asyncDelegator)((0, tslib_1.__asyncValues)((0, gff3Adapter_1.indexGff3)(config, attrs, outLocation, types, quiet))));
211
215
  }
212
- else if (type === 'GtfTabixAdapter') {
213
- yield (0, tslib_1.__await)(yield* (0, tslib_1.__asyncDelegator)((0, tslib_1.__asyncValues)((0, gtfAdapter_1.indexGtf)(config, attrs, outLocation, types, quiet))));
214
- }
215
216
  else if (type === 'VcfTabixAdapter') {
216
217
  yield (0, tslib_1.__await)(yield* (0, tslib_1.__asyncDelegator)((0, tslib_1.__asyncValues)((0, vcfAdapter_1.indexVcf)(config, attrs, outLocation, types, quiet))));
217
218
  }
219
+ // gtf unused currently
218
220
  }
219
221
  });
220
222
  }
@@ -3,19 +3,12 @@ import JBrowseCommand from '../base';
3
3
  export default class Upgrade extends JBrowseCommand {
4
4
  static description: string;
5
5
  static examples: string[];
6
- static args: ({
6
+ static args: {
7
7
  name: string;
8
8
  required: boolean;
9
9
  description: string;
10
10
  default: string;
11
- hidden?: undefined;
12
- } | {
13
- name: string;
14
- required: boolean;
15
- description: string;
16
- hidden: boolean;
17
- default?: undefined;
18
- })[];
11
+ }[];
19
12
  static flags: {
20
13
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
21
14
  listVersions: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
@@ -47,11 +47,23 @@ class Upgrade extends base_1.default {
47
47
  exports.default = Upgrade;
48
48
  Upgrade.description = 'Upgrades JBrowse 2 to latest version';
49
49
  Upgrade.examples = [
50
- '$ jbrowse upgrade # Upgrades current directory to latest jbrowse release',
50
+ '# Upgrades current directory to latest jbrowse release',
51
+ '$ jbrowse upgrade',
52
+ '',
53
+ '# Upgrade jbrowse instance at a specific filesystem path',
51
54
  '$ jbrowse upgrade /path/to/jbrowse2/installation',
55
+ '',
56
+ '# Upgrade to a specific tag',
52
57
  '$ jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0',
53
- '$ jbrowse upgrade --listVersions # Lists out all available versions of JBrowse 2',
58
+ '',
59
+ '# List versions available on github',
60
+ '$ jbrowse upgrade --listVersions',
61
+ '',
62
+ '# Upgrade from a specific URL',
54
63
  '$ jbrowse upgrade --url https://sample.com/jbrowse2.zip',
64
+ '',
65
+ '# Get nightly release from main branch',
66
+ '$ jbrowse upgrade --nightly',
55
67
  ];
56
68
  Upgrade.args = [
57
69
  {
@@ -60,12 +72,6 @@ Upgrade.args = [
60
72
  description: `Location where JBrowse 2 is installed`,
61
73
  default: '.',
62
74
  },
63
- {
64
- name: 'placeholder',
65
- required: false,
66
- description: `Placeholder for config file migration scripts`,
67
- hidden: true,
68
- },
69
75
  ];
70
76
  Upgrade.flags = {
71
77
  help: command_1.flags.help({ char: 'h' }),
@@ -58,8 +58,8 @@ function guessAdapterFromFileName(filePath) {
58
58
  name,
59
59
  assemblyNames: [],
60
60
  adapter: {
61
- type: 'GtfTabixAdapter',
62
- gtfGzLocation: { uri, locationType: 'UriLocation' },
61
+ type: 'GtfAdapter',
62
+ gtfLocation: { uri, locationType: 'UriLocation' },
63
63
  },
64
64
  };
65
65
  }
@@ -69,7 +69,7 @@ function guessAdapterFromFileName(filePath) {
69
69
  }
70
70
  exports.guessAdapterFromFileName = guessAdapterFromFileName;
71
71
  function supported(type) {
72
- return ['Gff3TabixAdapter', 'GtfTabixAdapter', 'VcfTabixAdapter'].includes(type);
72
+ return ['Gff3TabixAdapter', 'VcfTabixAdapter'].includes(type);
73
73
  }
74
74
  exports.supported = supported;
75
75
  /**
@@ -12,7 +12,7 @@ function indexGtf(config, attributes, outLocation, typesToExclude, quiet) {
12
12
  return (0, tslib_1.__asyncGenerator)(this, arguments, function* indexGtf_1() {
13
13
  var e_1, _a;
14
14
  const { adapter, trackId } = config;
15
- const { gtfGzLocation: { uri }, } = adapter;
15
+ const { gtfLocation: { uri }, } = adapter;
16
16
  // progress bar code was aided by blog post at
17
17
  // https://webomnizz.com/download-a-file-with-progressbar-using-node-js/
18
18
  const progressBar = new cli_progress_1.SingleBar({
@@ -67,22 +67,14 @@ function indexGtf(config, attributes, outLocation, typesToExclude, quiet) {
67
67
  val.trim().split(',').join(' ').replace(/("|')/g, ''),
68
68
  ];
69
69
  }));
70
- const name = col9Attrs['gene_name'] || '';
71
- const id = col9Attrs['gene_id'] || '';
72
70
  const attrs = attributes
73
71
  .map(attr => col9Attrs[attr])
74
72
  .filter((f) => !!f);
75
- const restAttrs = attributes
76
- .filter(attr => attr !== 'gene_name' && attr !== 'gene_id')
77
- .map(attr => col9Attrs[attr])
78
- .filter((f) => !!f);
79
- if (name || id) {
73
+ if (attrs.length) {
80
74
  const record = JSON.stringify([
81
75
  encodeURIComponent(locStr),
82
76
  encodeURIComponent(trackId),
83
- encodeURIComponent(name),
84
- encodeURIComponent(id),
85
- ...restAttrs.map(a => encodeURIComponent(a || '')),
77
+ ...attrs.map(a => encodeURIComponent(a || '')),
86
78
  ]).replace(/,/g, '|');
87
79
  yield yield (0, tslib_1.__await)(`${record} ${[...new Set(attrs)].join(' ')}\n`);
88
80
  }
@@ -1 +1 @@
1
- {"version":"1.5.0","commands":{"add-assembly":{"id":"add-assembly","description":"Add an assembly to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-assembly GRCh38.fa --load copy","$ jbrowse add-assembly GRCh38.fasta.with.custom.extension.xyz --type indexedFasta --load move","$ jbrowse add-assembly myFile.fa.gz --name hg38 --alias GRCh38 --displayName \"Homo sapiens (hg38)\" --load inPlace","$ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace","$ jbrowse add-assembly GRCh38.config.json --load copy","$ jbrowse add-assembly https://example.com/data/sample.2bit","$ jbrowse add-assembly GRCh38.fa --target /path/to/jb2/installation/customconfig.json --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":["# --load copy copies my.bam and my.bam.bai to current directory and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load copy\n","# same as above, but specify path to bai file","$ jbrowse add-track /path/to/my.bam --indexFile /path/to/my.bai --load copy\n","# --load symlink creates symlink in /path/to/jb2/ directory for this file, and adds track to config.json","$ jbrowse add-track /path/to/my.bam --target /path/to/jb2/config.json --load symlink\n","# no --load flag to add literal URL for this track to config.json","$ jbrowse add-track https://mywebsite.com/my.bam\n","# --load move to move the file ","$ jbrowse add-track /path/to/my.bam --name 'New Track' --load move\n","# --load inPlace puts /url/relative/path.bam in the config without performing any file operations","$ jbrowse add-track /url/relative/path.bam --trackId AlignmentsTrack1 --load url --overwrite"],"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":["$ jbrowse create /path/to/new/installation","$ jbrowse create /path/to/new/installation --force","$ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip","$ jbrowse create /path/to/new/installation --tag v1.0.0","$ jbrowse create --listVersions # Lists out all available versions of JBrowse 2"],"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":["$ jbrowse upgrade # Upgrades current directory to latest jbrowse release","$ jbrowse upgrade /path/to/jbrowse2/installation","$ jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0","$ jbrowse upgrade --listVersions # Lists out all available versions of JBrowse 2","$ jbrowse upgrade --url https://sample.com/jbrowse2.zip"],"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":"."},{"name":"placeholder","description":"Placeholder for config file migration scripts","required":false,"hidden":true}]}}}
1
+ {"version":"1.5.4","commands":{"add-assembly":{"id":"add-assembly","description":"Add an assembly to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and GRCh38.fa.fai to current directory","$ jbrowse add-assembly GRCh38.fa --load copy","","# add assembly to a specific jb2 installation path using --out, and copies the .fa and .fa.fai file to /path/to/jb2","$ jbrowse add-assembly GRCh38.fa --out /path/to/jb2/ --load copy","","# force indexedFasta for add-assembly without relying on file extension","$ jbrowse add-assembly GRCh38.xyz --type indexedFasta --load copy","","# add displayName for an assembly","$ jbrowse add-assembly myFile.fa.gz --name hg38 --displayName \"Homo sapiens (hg38)\"","","# use chrom.sizes file for assembly instead of a fasta file","$ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace","","# add assembly from preconfigured json file, expert option","$ jbrowse add-assembly GRCh38.config.json --load copy","","# add assembly from a 2bit file, also note pointing direct to a URL so no --load flag needed","$ jbrowse add-assembly https://example.com/data/sample.2bit","","# add a bgzip indexed fasta inferred by fa.gz extension. assumes .fa.gz.gzi and .fa.gz.fai files also exists","$ jbrowse add-assembly myfile.fa.gz --load copy"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of sequence, by default inferred from sequence file\n\nindexedFasta An index FASTA (e.g. .fa or .fasta) file;\n can optionally specify --faiLocation\n\nbgzipFasta A block-gzipped and indexed FASTA (e.g. .fa.gz or .fasta.gz) file;\n can optionally specify --faiLocation and/or --gziLocation\n\ntwoBit A twoBit (e.g. .2bit) file\n\nchromSizes A chromosome sizes (e.g. .chrom.sizes) file\n\ncustom Either a JSON file location or inline JSON that defines a custom\n sequence adapter; must provide --name if using inline JSON","options":["indexedFasta","bgzipFasta","twoBit","chromSizes","custom"]},"name":{"name":"name","type":"option","char":"n","description":"Name of the assembly; if not specified, will be guessed using the sequence file name"},"alias":{"name":"alias","type":"option","char":"a","description":"An alias for the assembly name (e.g. \"hg38\" if the name of the assembly is \"GRCh38\");\ncan be specified multiple times"},"displayName":{"name":"displayName","type":"option","description":"The display name to specify for the assembly, e.g. \"Homo sapiens (hg38)\" while the name can be a shorter identifier like \"hg38\""},"faiLocation":{"name":"faiLocation","type":"option","description":"[default: <fastaLocation>.fai] FASTA index file or URL"},"gziLocation":{"name":"gziLocation","type":"option","description":"[default: <fastaLocation>.gzi] FASTA gzip index file or URL"},"refNameAliases":{"name":"refNameAliases","type":"option","description":"Reference sequence name aliases file or URL; assumed to be a tab-separated aliases\nfile unless --refNameAliasesType is specified"},"refNameAliasesType":{"name":"refNameAliasesType","type":"option","description":"Type of aliases defined by --refNameAliases; if \"custom\", --refNameAliases is either\na JSON file location or inline JSON that defines a custom sequence adapter","options":["aliases","custom"]},"refNameColors":{"name":"refNameColors","type":"option","description":"A comma-separated list of color strings for the reference sequence names; will cycle\nthrough colors if there are fewer colors than sequences"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the data directory. Copy, symlink, or move the data directory to the JBrowse directory. Or use inPlace to modify the config without doing any file operations","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the sequence file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrite existing assembly if one with the same name exists","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"sequence","description":"sequence file or URL\n\nIf TYPE is indexedFasta or bgzipFasta, the index file defaults to <location>.fai\nand can be optionally specified with --faiLocation\nIf TYPE is bgzipFasta, the gzip index file defaults to <location>.gzi and can be\noptionally specified with --gziLocation","required":true}]},"add-connection":{"id":"add-connection","description":"Add a connection to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-connection http://mysite.com/jbrowse/data/","$ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection","$ jbrowse add-connection http://mysite.com/path/to/hub.txt --assemblyName hg19","$ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection --assemblyName hg19","$ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config '{\"uri\":{\"url\":\"https://mysite.com/path/to/custom\"}, \"locationType\": \"UriLocation\"}' --assemblyName hg19","$ jbrowse add-connection https://mysite.com/path/to/hub.txt --connectionId newId --name newName --target /path/to/jb2/installation/config.json"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of connection, ex. JBrowse1Connection, UCSCTrackHubConnection, custom"},"assemblyName":{"name":"assemblyName","type":"option","char":"a","description":"Assembly name of the connection If none, will default to the assembly in your config file"},"config":{"name":"config","type":"option","char":"c","description":"Any extra config settings to add to connection in JSON object format, such as '{\"uri\":\"url\":\"https://sample.com\"}, \"locationType\": \"UriLocation\"}'"},"connectionId":{"name":"connectionId","type":"option","description":"Id for the connection that must be unique to JBrowse. Defaults to 'connectionType-assemblyName-currentTime'"},"name":{"name":"name","type":"option","char":"n","description":"Name of the connection. Defaults to connectionId if not provided"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to."},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the data directory URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrites any existing connections if same connection id","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"connectionUrlOrPath","description":"URL of data directory\nFor hub file, usually called hub.txt\nFor JBrowse 1, location of JB1 data directory similar to http://mysite.com/jbrowse/data/ ","required":true}]},"add-track-json":{"id":"add-track-json","description":"Add a track configuration directly from a JSON hunk to the JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-track-json track.json","$ jbrowse add-track-json track.json --update"],"flags":{"update":{"name":"update","type":"boolean","char":"u","description":"update the contents of an existing track, matched based on trackId","allowNo":false},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"}},"args":[{"name":"track","description":"track JSON file or command line arg blob","required":true}]},"add-track":{"id":"add-track","description":"Add a track to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# copy /path/to/my.bam and /path/to/my.bam.bai to current directory and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load copy","","# copy my.bam and my.bam.bai to /path/to/jb2/bam and adds track entry to /path/to/jb2/bam/config.json","$ jbrowse add-track my.bam --load copy --out /path/to/jb2 --subDir bam","","# same as above, but specify path to bai file. needed for if the bai file does not have the extension .bam.bai","$ jbrowse add-track my.bam --indexFile my.bai --load copy","","# creates symlink for /path/to/my.bam and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load symlink","","# add track from URL to config.json, no --load flag needed","$ jbrowse add-track https://mywebsite.com/my.bam","","# --load inPlace adds a track without doing file operations","$ jbrowse add-track /url/relative/path.bam --load inPlace"],"flags":{"trackType":{"name":"trackType","type":"option","char":"t","description":"Type of track, by default inferred from track file"},"name":{"name":"name","type":"option","char":"n","description":"Name of the track. Will be defaulted to the trackId if none specified"},"indexFile":{"name":"indexFile","type":"option","description":"Optional index file for the track"},"description":{"name":"description","type":"option","char":"d","description":"Optional description of the track"},"assemblyNames":{"name":"assemblyNames","type":"option","char":"a","description":"Assembly name or names for track as comma separated string. If none, will default to the assembly in your config file"},"category":{"name":"category","type":"option","description":"Optional Comma separated string of categories to group tracks"},"config":{"name":"config","type":"option","description":"Any extra config settings to add to a track. i.e '{\"defaultRendering\": \"density\"}'"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation to write out to."},"out":{"name":"out","type":"option","description":"synonym for target"},"subDir":{"name":"subDir","type":"option","description":"when using --load a file, output to a subdirectory of the target dir","default":""},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"trackId":{"name":"trackId","type":"option","description":"trackId for the track, by default inferred from filename, must be unique throughout config"},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the track. Copy, symlink, or move the track to the JBrowse directory. Or inPlace to leave track alone","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Skip check for whether or not the file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrites existing track if it shares the same trackId","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false},"protocol":{"name":"protocol","type":"option","description":"Force protocol to a specific value","default":"uri"}},"args":[{"name":"track","description":"Track file or URL","required":true}]},"admin-server":{"id":"admin-server","description":"Start up a small admin server for JBrowse configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse admin-server","$ jbrowse admin-server -p 8888"],"flags":{"port":{"name":"port","type":"option","char":"p","description":"Specifified port to start the server on;\nDefault is 9090."},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"create":{"id":"create","description":"Downloads and installs the latest JBrowse 2 release","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# Download latest release from github, and put in specific path","$ jbrowse create /path/to/new/installation","","# Download latest release from github and force overwrite existing contents at path","$ jbrowse create /path/to/new/installation --force","","# Download latest release from a specific URL","$ jbrowse create /path/to/new/installation --url url.com/directjbrowselink.zip","","# Download a specific tag from github","$ jbrowse create /path/to/new/installation --tag v1.0.0","","# List available versions","$ jbrowse create --listVersions"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Overwrites existing JBrowse 2 installation if present in path","allowNo":false},"listVersions":{"name":"listVersions","type":"boolean","char":"l","description":"Lists out all versions of JBrowse 2","allowNo":false},"branch":{"name":"branch","type":"option","description":"Download a development build from a named git branch"},"nightly":{"name":"nightly","type":"boolean","description":"Download the latest development build from the main branch","allowNo":false},"url":{"name":"url","type":"option","char":"u","description":"A direct URL to a JBrowse 2 release"},"tag":{"name":"tag","type":"option","char":"t","description":"Version of JBrowse 2 to install. Format is v1.0.0.\nDefaults to latest"}},"args":[{"name":"localPath","description":"Location where JBrowse 2 will be installed","required":true}]},"set-default-session":{"id":"set-default-session","description":"Set a default session with views and tracks","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse set-default-session --session /path/to/default/session.json","$ jbrowse set-default-session --target /path/to/jb2/installation/config.json --view LinearGenomeView --tracks track1, track2, track3","$ jbrowse set-default-session --view LinearGenomeView, --name newName --viewId view-no-tracks","$ jbrowse set-default-session --currentSession # Prints out current default session"],"flags":{"session":{"name":"session","type":"option","char":"s","description":"set path to a file containing session in json format"},"name":{"name":"name","type":"option","char":"n","description":"Give a name for the default session","default":"New Default Session"},"view":{"name":"view","type":"option","char":"v","description":"View type in config to be added as default session, i.e LinearGenomeView, CircularView, DotplotView.\nMust be provided if no default session file provided"},"viewId":{"name":"viewId","type":"option","description":"Identifier for the view. Will be generated on default"},"tracks":{"name":"tracks","type":"option","char":"t","description":"Track id or track ids as comma separated string to put into default session"},"currentSession":{"name":"currentSession","type":"boolean","char":"c","description":"List out the current default session","allowNo":false},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to"},"out":{"name":"out","type":"option","description":"synonym for target"},"delete":{"name":"delete","type":"boolean","description":"Delete any existing default session.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"text-index":{"id":"text-index","description":"Make a text-indexing file for any given track(s).","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# indexes all tracks that it can find in the current directory's config.json","$ jbrowse text-index","","# indexes specific trackIds that it can find in the current directory's config.json","$ jbrowse text-index --tracks=track1,track2,track3","","# indexes all tracks in a directory's config.json or in a specific config file","$ jbrowse text-index --out /path/to/jb2/","","# indexes only a specific assembly, and overwrite what was previously there using force (which is needed if a previous index already existed)","$ jbrowse text-index -a hg19 --force","","# create index for some files for use in @jbrowse/react-linear-genome-view or similar","$ jbrowse text-index --file myfile.gff3.gz --file myfile.vcfgz --out indexes"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"tracks":{"name":"tracks","type":"option","description":"Specific tracks to index, formatted as comma separated trackIds. If unspecified, indexes all available tracks"},"target":{"name":"target","type":"option","description":"Path to config file in JB2 installation directory to read from."},"out":{"name":"out","type":"option","description":"Synonym for target"},"attributes":{"name":"attributes","type":"option","description":"Comma separated list of attributes to index","default":"Name,ID"},"assemblies":{"name":"assemblies","type":"option","char":"a","description":"Specify the assembl(ies) to create an index for. If unspecified, creates an index for each assembly in the config"},"force":{"name":"force","type":"boolean","description":"Overwrite previously existing indexes","allowNo":false},"quiet":{"name":"quiet","type":"boolean","char":"q","description":"Hide the progress bars","allowNo":false},"perTrack":{"name":"perTrack","type":"boolean","description":"If set, creates an index per track","allowNo":false},"exclude":{"name":"exclude","type":"option","description":"Adds gene type to list of excluded types","default":"CDS,exon"},"file":{"name":"file","type":"option","description":"File or files to index (can be used to create trix indexes for embedded component use cases not using a config.json for example)"},"dryrun":{"name":"dryrun","type":"boolean","description":"Just print out tracks that will be indexed by the process, without doing any indexing","allowNo":false}},"args":[]},"upgrade":{"id":"upgrade","description":"Upgrades JBrowse 2 to latest version","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# Upgrades current directory to latest jbrowse release","$ jbrowse upgrade","","# Upgrade jbrowse instance at a specific filesystem path","$ jbrowse upgrade /path/to/jbrowse2/installation","","# Upgrade to a specific tag","$ jbrowse upgrade /path/to/jbrowse2/installation --tag v1.0.0","","# List versions available on github","$ jbrowse upgrade --listVersions","","# Upgrade from a specific URL","$ jbrowse upgrade --url https://sample.com/jbrowse2.zip","","# Get nightly release from main branch","$ jbrowse upgrade --nightly"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"listVersions":{"name":"listVersions","type":"boolean","char":"l","description":"Lists out all versions of JBrowse 2","allowNo":false},"tag":{"name":"tag","type":"option","char":"t","description":"Version of JBrowse 2 to install. Format is v1.0.0.\nDefaults to latest"},"branch":{"name":"branch","type":"option","description":"Download a development build from a named git branch"},"nightly":{"name":"nightly","type":"boolean","description":"Download the latest development build from the main branch","allowNo":false},"url":{"name":"url","type":"option","char":"u","description":"A direct URL to a JBrowse 2 release"}},"args":[{"name":"localPath","description":"Location where JBrowse 2 is installed","required":false,"default":"."}]}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.4",
4
4
  "description": "A command line tool for working with JBrowse 2",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -44,25 +44,27 @@
44
44
  "docs:version:add": "git add README.md"
45
45
  },
46
46
  "dependencies": {
47
- "@gmod/gff": "^1.1.2",
48
- "@oclif/command": "^1",
49
- "@oclif/config": "^1",
50
- "@oclif/plugin-help": "^3",
47
+ "@gmod/gff": "^1.2.0",
48
+ "@oclif/command": "^1.8.11",
49
+ "@oclif/config": "^1.18.2",
50
+ "@oclif/errors": "^1",
51
+ "@oclif/plugin-help": "3.2.14",
51
52
  "boxen": "^4.2.0",
52
53
  "chalk": "^4.1.0",
53
54
  "cli-progress": "^3.9.0",
54
55
  "cors": "^2.8.5",
55
56
  "express": "^4.17.1",
56
- "follow-redirects": "^1.14.1",
57
- "ixixx": "^1.0.15",
57
+ "follow-redirects": "^1.14.6",
58
+ "ixixx": "^1.0.19",
58
59
  "json-parse-better-errors": "^1.0.2",
59
60
  "node-fetch": "^2.6.0",
60
- "tslib": "^1",
61
+ "object.fromentries": "^2.0.5",
62
+ "tslib": "^2.3.1",
61
63
  "unzipper": "^0.10.11"
62
64
  },
63
65
  "devDependencies": {
64
66
  "@types/follow-redirects": "^1.13.0",
65
- "typescript": "^4.0.0"
67
+ "typescript": "^4.5.2"
66
68
  },
67
69
  "oclif": {
68
70
  "commands": "./lib/commands",
@@ -75,5 +77,5 @@
75
77
  "publishConfig": {
76
78
  "access": "public"
77
79
  },
78
- "gitHead": "542025578a39bd170c8a166f2568ee7edbd54072"
80
+ "gitHead": "0c398214590969168694b4ed8e20b595178b9efd"
79
81
  }
package/CHANGELOG.md DELETED
@@ -1,2 +0,0 @@
1
- - Fixed usage of the `jbrowse upgrade` command having unzipping failures (https://github.com/GMOD/jbrowse-components/pull/1085)
2
- - Fixed `jbrowse add-track` when there are multiple assemblies (https://github.com/GMOD/jbrowse-components/pull/1103)