@jbrowse/cli 2.4.2 → 2.6.1

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
@@ -173,7 +173,7 @@ EXAMPLES
173
173
  ```
174
174
 
175
175
  _See code:
176
- [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/add-assembly.ts)_
176
+ [src/commands/add-assembly.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/add-assembly.ts)_
177
177
 
178
178
  ## `jbrowse add-connection CONNECTIONURLORPATH`
179
179
 
@@ -189,46 +189,45 @@ ARGUMENTS
189
189
  For JBrowse 1, location of JB1 data directory similar to http://mysite.com/jbrowse/data/
190
190
 
191
191
  OPTIONS
192
- -a, --assemblyName=assemblyName Assembly name of the connection If none, will default to the assembly in your config
193
- file
192
+ -a, --assemblyNames=assemblyNames For UCSC, optional: Comma separated list of assembly name(s) to filter from this
193
+ connection. For JBrowse: a single assembly name
194
194
 
195
- -c, --config=config Any extra config settings to add to connection in JSON object format, such as
196
- '{"uri":"url":"https://sample.com"}, "locationType": "UriLocation"}'
195
+ -c, --config=config Any extra config settings to add to connection in JSON object format, such as
196
+ '{"uri":"url":"https://sample.com"}, "locationType": "UriLocation"}'
197
197
 
198
- -f, --force Equivalent to `--skipCheck --overwrite`
198
+ -f, --force Equivalent to `--skipCheck --overwrite`
199
199
 
200
- -h, --help show CLI help
200
+ -h, --help show CLI help
201
201
 
202
- -n, --name=name Name of the connection. Defaults to connectionId if not provided
202
+ -n, --name=name Name of the connection. Defaults to connectionId if not provided
203
203
 
204
- -t, --type=type type of connection, ex. JBrowse1Connection, UCSCTrackHubConnection, custom
204
+ -t, --type=type type of connection, ex. JBrowse1Connection, UCSCTrackHubConnection, custom
205
205
 
206
- --connectionId=connectionId Id for the connection that must be unique to JBrowse. Defaults to
207
- 'connectionType-assemblyName-currentTime'
206
+ --connectionId=connectionId Id for the connection that must be unique to JBrowse. Defaults to
207
+ 'connectionType-assemblyName-currentTime'
208
208
 
209
- --out=out synonym for target
209
+ --out=out synonym for target
210
210
 
211
- --overwrite Overwrites any existing connections if same connection id
211
+ --overwrite Overwrites any existing connections if same connection id
212
212
 
213
- --skipCheck Don't check whether or not the data directory URL exists or if you are in a JBrowse
214
- directory
213
+ --skipCheck Don't check whether or not the data directory URL exists or if you are in a JBrowse
214
+ directory
215
215
 
216
- --target=target path to config file in JB2 installation directory to write out to.
216
+ --target=target path to config file in JB2 installation directory to write out to.
217
217
 
218
218
  EXAMPLES
219
- $ jbrowse add-connection http://mysite.com/jbrowse/data/
220
- $ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection
221
- $ jbrowse add-connection http://mysite.com/path/to/hub.txt --assemblyName hg19
222
- $ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection --assemblyName
223
- hg19
219
+ $ jbrowse add-connection http://mysite.com/jbrowse/data/ -a hg19
220
+ $ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection -a hg38
221
+ $ jbrowse add-connection http://mysite.com/path/to/hub.txt
222
+ $ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection
224
223
  $ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config
225
- '{"uri":{"url":"https://mysite.com/path/to/custom"}, "locationType": "UriLocation"}' --assemblyName hg19
224
+ '{"uri":{"url":"https://mysite.com/path/to/custom"}, "locationType": "UriLocation"}' -a hg19
226
225
  $ jbrowse add-connection https://mysite.com/path/to/hub.txt --connectionId newId --name newName --target
227
226
  /path/to/jb2/installation/config.json
228
227
  ```
229
228
 
230
229
  _See code:
231
- [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/add-connection.ts)_
230
+ [src/commands/add-connection.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/add-connection.ts)_
232
231
 
233
232
  ## `jbrowse add-track TRACK`
234
233
 
@@ -307,7 +306,7 @@ EXAMPLES
307
306
  ```
308
307
 
309
308
  _See code:
310
- [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/add-track.ts)_
309
+ [src/commands/add-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/add-track.ts)_
311
310
 
312
311
  ## `jbrowse add-track-json TRACK`
313
312
 
@@ -334,7 +333,7 @@ EXAMPLES
334
333
  ```
335
334
 
336
335
  _See code:
337
- [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/add-track-json.ts)_
336
+ [src/commands/add-track-json.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/add-track-json.ts)_
338
337
 
339
338
  ## `jbrowse admin-server`
340
339
 
@@ -365,7 +364,7 @@ EXAMPLES
365
364
  ```
366
365
 
367
366
  _See code:
368
- [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/admin-server.ts)_
367
+ [src/commands/admin-server.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/admin-server.ts)_
369
368
 
370
369
  ## `jbrowse create LOCALPATH`
371
370
 
@@ -410,7 +409,7 @@ EXAMPLES
410
409
  ```
411
410
 
412
411
  _See code:
413
- [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/create.ts)_
412
+ [src/commands/create.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/create.ts)_
414
413
 
415
414
  ## `jbrowse help [COMMAND]`
416
415
 
@@ -453,7 +452,7 @@ EXAMPLE
453
452
  ```
454
453
 
455
454
  _See code:
456
- [src/commands/remove-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/remove-track.ts)_
455
+ [src/commands/remove-track.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/remove-track.ts)_
457
456
 
458
457
  ## `jbrowse set-default-session`
459
458
 
@@ -491,7 +490,7 @@ EXAMPLES
491
490
  ```
492
491
 
493
492
  _See code:
494
- [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/set-default-session.ts)_
493
+ [src/commands/set-default-session.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/set-default-session.ts)_
495
494
 
496
495
  ## `jbrowse text-index`
497
496
 
@@ -555,7 +554,7 @@ EXAMPLES
555
554
  ```
556
555
 
557
556
  _See code:
558
- [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/text-index.ts)_
557
+ [src/commands/text-index.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/text-index.ts)_
559
558
 
560
559
  ## `jbrowse upgrade [LOCALPATH]`
561
560
 
@@ -604,7 +603,7 @@ EXAMPLES
604
603
  ```
605
604
 
606
605
  _See code:
607
- [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v2.4.2/products/jbrowse-cli/src/commands/upgrade.ts)_
606
+ [src/commands/upgrade.ts](https://github.com/GMOD/jbrowse-components/blob/v2.6.1/products/jbrowse-cli/src/commands/upgrade.ts)_
608
607
 
609
608
  <!-- commandsstop -->
610
609
 
package/lib/base.d.ts CHANGED
@@ -116,7 +116,7 @@ interface GithubRelease {
116
116
  export default abstract class JBrowseCommand extends Command {
117
117
  init(): Promise<void>;
118
118
  readFile(location: string): Promise<string>;
119
- readJsonFile(location: string): Promise<Record<string, unknown>>;
119
+ readJsonFile<T>(location: string): Promise<T>;
120
120
  writeJsonFile(location: string, contents: any): Promise<void>;
121
121
  resolveFileLocation(location: string, check?: boolean, inPlace?: boolean): Promise<string>;
122
122
  readInlineOrFileJson(inlineOrFileName: string): Promise<any>;
package/lib/base.js CHANGED
@@ -118,16 +118,11 @@ class JBrowseCommand extends command_1.default {
118
118
  var _a, e_1, _b, _c;
119
119
  let versions = [];
120
120
  try {
121
- for (var _d = true, _e = __asyncValues(this.fetchVersions()), _f; _f = await _e.next(), _a = _f.done, !_a;) {
121
+ for (var _d = true, _e = __asyncValues(this.fetchVersions()), _f; _f = await _e.next(), _a = _f.done, !_a; _d = true) {
122
122
  _c = _f.value;
123
123
  _d = false;
124
- try {
125
- const iter = _c;
126
- versions = [...versions, ...iter];
127
- }
128
- finally {
129
- _d = true;
130
- }
124
+ const iter = _c;
125
+ versions = [...versions, ...iter];
131
126
  }
132
127
  }
133
128
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -143,27 +138,22 @@ class JBrowseCommand extends command_1.default {
143
138
  var _a, e_2, _b, _c;
144
139
  var _d;
145
140
  try {
146
- for (var _e = true, _f = __asyncValues(this.fetchVersions()), _g; _g = await _f.next(), _a = _g.done, !_a;) {
141
+ for (var _e = true, _f = __asyncValues(this.fetchVersions()), _g; _g = await _f.next(), _a = _g.done, !_a; _e = true) {
147
142
  _c = _g.value;
148
143
  _e = false;
149
- try {
150
- const versions = _c;
151
- // if a release was just uploaded, or an erroneous build was made
152
- // then it might have no build asset
153
- const nonprereleases = versions
154
- .filter(release => release.prerelease === false)
155
- .filter(release => release.assets && release.assets.length > 0);
156
- if (nonprereleases.length > 0) {
157
- // @ts-expect-error
158
- const file = (_d = nonprereleases[0].assets.find(f => f.name.includes('jbrowse-web'))) === null || _d === void 0 ? void 0 : _d.browser_download_url;
159
- if (!file) {
160
- throw new Error('no jbrowse-web download found');
161
- }
162
- return file;
144
+ const versions = _c;
145
+ // if a release was just uploaded, or an erroneous build was made
146
+ // then it might have no build asset
147
+ const nonprereleases = versions
148
+ .filter(release => release.prerelease === false)
149
+ .filter(release => release.assets && release.assets.length > 0);
150
+ if (nonprereleases.length > 0) {
151
+ // @ts-expect-error
152
+ const file = (_d = nonprereleases[0].assets.find(f => f.name.includes('jbrowse-web'))) === null || _d === void 0 ? void 0 : _d.browser_download_url;
153
+ if (!file) {
154
+ throw new Error('no jbrowse-web download found');
163
155
  }
164
- }
165
- finally {
166
- _e = true;
156
+ return file;
167
157
  }
168
158
  }
169
159
  }
@@ -373,7 +373,6 @@ class AddAssembly extends base_1.default {
373
373
  return false;
374
374
  }
375
375
  }
376
- exports.default = AddAssembly;
377
376
  AddAssembly.description = 'Add an assembly to a JBrowse 2 configuration';
378
377
  AddAssembly.examples = [
379
378
  '# add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and GRCh38.fa.fai to current directory',
@@ -483,3 +482,4 @@ custom Either a JSON file location or inline JSON that defines a custom
483
482
  description: 'Equivalent to `--skipCheck --overwrite`',
484
483
  }),
485
484
  };
485
+ exports.default = AddAssembly;
@@ -11,7 +11,7 @@ export default class AddConnection extends JBrowseCommand {
11
11
  }[];
12
12
  static flags: {
13
13
  type: flags.IOptionFlag<string | undefined>;
14
- assemblyName: flags.IOptionFlag<string | undefined>;
14
+ assemblyNames: flags.IOptionFlag<string | undefined>;
15
15
  config: flags.IOptionFlag<string | undefined>;
16
16
  connectionId: flags.IOptionFlag<string | undefined>;
17
17
  name: flags.IOptionFlag<string | undefined>;
@@ -24,6 +24,6 @@ export default class AddConnection extends JBrowseCommand {
24
24
  };
25
25
  run(): Promise<void>;
26
26
  resolveURL(location: string, check?: boolean): Promise<string>;
27
- determineConnectionType(url: string, config: string | undefined): "custom" | "UCSCTrackHubConnection" | "JBrowse1Connection";
27
+ determineConnectionType(url: string): "custom" | "UCSCTrackHubConnection" | "JBrowse1Connection";
28
28
  isValidJSON(str: string): boolean;
29
29
  }
@@ -4,98 +4,54 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const command_1 = require("@oclif/command");
7
- const fetchWithProxy_1 = __importDefault(require("../fetchWithProxy"));
8
7
  const fs_1 = __importDefault(require("fs"));
9
8
  const path_1 = __importDefault(require("path"));
10
9
  const json_parse_better_errors_1 = __importDefault(require("json-parse-better-errors"));
10
+ // locals
11
+ const fetchWithProxy_1 = __importDefault(require("../fetchWithProxy"));
11
12
  const base_1 = __importDefault(require("../base"));
12
13
  class AddConnection extends base_1.default {
13
14
  async run() {
15
+ var _a, _b;
14
16
  const { args: runArgs, flags: runFlags } = this.parse(AddConnection);
15
17
  const output = runFlags.target || runFlags.out || '.';
16
18
  const isDir = fs_1.default.lstatSync(output).isDirectory();
17
19
  this.target = isDir ? `${output}/config.json` : output;
18
- const { connectionUrlOrPath: argsPath } = runArgs;
19
- const { config } = runFlags;
20
- let { type, name, connectionId, assemblyName } = runFlags;
20
+ const { connectionUrlOrPath } = runArgs;
21
+ const { assemblyNames, type, name, config, connectionId } = runFlags;
21
22
  const { skipCheck, force } = runFlags;
22
- const url = await this.resolveURL(argsPath, !(skipCheck || force));
23
+ const url = await this.resolveURL(connectionUrlOrPath, !(skipCheck || force));
23
24
  const configContents = await this.readJsonFile(this.target);
24
25
  this.debug(`Using config file ${this.target}`);
25
- if (!configContents.assemblies || configContents.assemblies.length === 0) {
26
+ if (!((_a = configContents.assemblies) === null || _a === void 0 ? void 0 : _a.length)) {
26
27
  this.error('No assemblies found. Please add one before adding connections', { exit: 120 });
27
28
  }
28
- else if (configContents.assemblies.length > 1 && !assemblyName) {
29
- this.error('Too many assemblies, cannot default to one. Please specify the assembly with the --assemblyNames flag');
30
- }
31
- if (assemblyName) {
32
- configContents.assemblies.findIndex(assemblies => assemblies.name === assemblyName) === -1
33
- ? this.error(`Assembly name provided does not match any in config. Valid assembly names are ${configContents.assemblies.map(assembly => assembly.name)}`, { exit: 130 })
34
- : this.debug(`Assembly name(s) is :${assemblyName}`);
35
- }
36
- else {
37
- assemblyName = configContents.assemblies[0].name;
38
- this.log(`Inferred default assembly name ${assemblyName}`);
39
- }
40
- if (type) {
41
- this.debug(`Type is ${type}`);
42
- }
43
- else {
44
- type = this.determineConnectionType(url, config);
45
- }
46
- if (connectionId) {
47
- this.debug(`Connection id is ${connectionId}`);
48
- }
49
- else {
50
- connectionId = `${type}-${assemblyName}-${Date.now()}`;
51
- }
52
- if (name) {
53
- this.debug(`Name is: ${name}`);
54
- }
55
- else {
56
- name = connectionId;
57
- }
58
- let configObj = {};
59
- if (config) {
60
- try {
61
- configObj = (0, json_parse_better_errors_1.default)(config);
62
- }
63
- catch (error) {
64
- this.error('Could not parse provided JSON object');
65
- }
66
- }
67
- const connectionConfig = Object.assign({ type,
68
- connectionId, name: name || connectionId, assemblyName }, configObj);
69
- switch (type) {
70
- case 'UCSCTrackHubConnection': {
71
- connectionConfig.hubTxtLocation = {
29
+ const configType = type || this.determineConnectionType(url);
30
+ const id = connectionId ||
31
+ [configType, assemblyNames, +Date.now()].filter(f => !!f).join('-');
32
+ const connectionConfig = Object.assign(Object.assign(Object.assign(Object.assign({ type: configType, name: name || id }, (configType === 'UCSCTrackHubConnection'
33
+ ? {
34
+ hubTxtLocation: {
72
35
  uri: url,
73
36
  locationType: 'UriLocation',
74
- };
75
- break;
37
+ },
76
38
  }
77
- case 'JBrowse1Connection': {
78
- connectionConfig.dataDirLocation = {
39
+ : {})), (configType === 'JBrowse1Connection'
40
+ ? {
41
+ dataDirLocation: {
79
42
  uri: url,
80
43
  locationType: 'UriLocation',
81
- };
82
- break;
44
+ },
83
45
  }
84
- default: {
85
- if (!config || !this.isValidJSON(config)) {
86
- this.error('When type is not UCSCTrackHubConnection or JBrowse1Connection, config object must be provided.\nPlease enter a config object using --config', { exit: 140 });
87
- }
88
- break;
89
- }
90
- }
46
+ : {})), { connectionId: id, assemblyNames: assemblyNames || type === 'JBrowse1Connection'
47
+ ? [(_b = configContents.assemblies[0]) === null || _b === void 0 ? void 0 : _b.name]
48
+ : undefined }), (config ? (0, json_parse_better_errors_1.default)(config) : {}));
91
49
  if (!configContents.connections) {
92
50
  configContents.connections = [];
93
51
  }
94
- const idx = configContents.connections.findIndex(configConnection => configConnection.connectionId === connectionId);
52
+ const idx = configContents.connections.findIndex(c => c.connectionId === connectionId);
95
53
  if (idx !== -1) {
96
- this.debug(`Found existing connectionId ${connectionId} in configuration`);
97
54
  if (runFlags.force || runFlags.overwrite) {
98
- this.debug(`Overwriting connection ${connectionId} in configuration`);
99
55
  configContents.connections[idx] = connectionConfig;
100
56
  }
101
57
  else {
@@ -137,17 +93,14 @@ class AddConnection extends base_1.default {
137
93
  exit: 180,
138
94
  });
139
95
  }
140
- determineConnectionType(url, config) {
96
+ determineConnectionType(url) {
141
97
  if (path_1.default.basename(url) === 'hub.txt') {
142
98
  return 'UCSCTrackHubConnection';
143
99
  }
144
100
  if (url.includes('jbrowse/data')) {
145
101
  return 'JBrowse1Connection';
146
102
  }
147
- if (config && this.isValidJSON(config)) {
148
- return 'custom';
149
- }
150
- return this.error(`Unable to determine a specific connection from URL given.\nPlease specify a type with --type.\nIf you want a custom type, please provide the config object with --config`);
103
+ return 'custom';
151
104
  }
152
105
  isValidJSON(str) {
153
106
  try {
@@ -159,14 +112,13 @@ class AddConnection extends base_1.default {
159
112
  }
160
113
  }
161
114
  }
162
- exports.default = AddConnection;
163
115
  AddConnection.description = 'Add a connection to a JBrowse 2 configuration';
164
116
  AddConnection.examples = [
165
- '$ jbrowse add-connection http://mysite.com/jbrowse/data/',
166
- '$ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection',
167
- '$ jbrowse add-connection http://mysite.com/path/to/hub.txt --assemblyName hg19',
168
- '$ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection --assemblyName hg19',
169
- `$ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config '{"uri":{"url":"https://mysite.com/path/to/custom"}, "locationType": "UriLocation"}' --assemblyName hg19`,
117
+ '$ jbrowse add-connection http://mysite.com/jbrowse/data/ -a hg19',
118
+ '$ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection -a hg38',
119
+ '$ jbrowse add-connection http://mysite.com/path/to/hub.txt',
120
+ '$ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection',
121
+ `$ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config '{"uri":{"url":"https://mysite.com/path/to/custom"}, "locationType": "UriLocation"}' -a hg19`,
170
122
  '$ jbrowse add-connection https://mysite.com/path/to/hub.txt --connectionId newId --name newName --target /path/to/jb2/installation/config.json',
171
123
  ];
172
124
  AddConnection.args = [
@@ -181,9 +133,9 @@ AddConnection.flags = {
181
133
  char: 't',
182
134
  description: 'type of connection, ex. JBrowse1Connection, UCSCTrackHubConnection, custom',
183
135
  }),
184
- assemblyName: command_1.flags.string({
136
+ assemblyNames: command_1.flags.string({
185
137
  char: 'a',
186
- description: 'Assembly name of the connection If none, will default to the assembly in your config file',
138
+ description: 'For UCSC, optional: Comma separated list of assembly name(s) to filter from this connection. For JBrowse: a single assembly name',
187
139
  }),
188
140
  config: command_1.flags.string({
189
141
  char: 'c',
@@ -214,3 +166,4 @@ AddConnection.flags = {
214
166
  description: 'Equivalent to `--skipCheck --overwrite`',
215
167
  }),
216
168
  };
169
+ exports.default = AddConnection;
@@ -41,7 +41,6 @@ class AddTrackJson extends base_1.default {
41
41
  this.log(`${idx !== -1 ? 'Overwrote' : 'Added'} assembly "${track.name}" ${idx !== -1 ? 'in' : 'to'} ${this.target}`);
42
42
  }
43
43
  }
44
- exports.default = AddTrackJson;
45
44
  AddTrackJson.description = 'Add a track configuration directly from a JSON hunk to the JBrowse 2 configuration';
46
45
  AddTrackJson.examples = [
47
46
  '$ jbrowse add-track-json track.json',
@@ -66,3 +65,4 @@ AddTrackJson.flags = {
66
65
  description: 'synonym for target',
67
66
  }),
68
67
  };
68
+ exports.default = AddTrackJson;
@@ -429,7 +429,6 @@ class AddTrack extends base_1.default {
429
429
  return known[adapterType] || 'FeatureTrack';
430
430
  }
431
431
  }
432
- exports.default = AddTrack;
433
432
  AddTrack.description = 'Add a track to a JBrowse 2 configuration';
434
433
  AddTrack.examples = [
435
434
  '# copy /path/to/my.bam and /path/to/my.bam.bai to current directory and adds track to config.json',
@@ -523,3 +522,4 @@ AddTrack.flags = {
523
522
  description: 'Used only for mcscan anchors/simpleAnchors types',
524
523
  }),
525
524
  };
525
+ exports.default = AddTrack;
@@ -123,7 +123,6 @@ class AdminServer extends base_1.default {
123
123
  this.log(`If you are running yarn start you can launch http://localhost:3000?adminKey=${adminKey}&adminServer=http://localhost:${port}/updateConfig`);
124
124
  }
125
125
  }
126
- exports.default = AdminServer;
127
126
  AdminServer.description = 'Start up a small admin server for JBrowse configuration';
128
127
  AdminServer.examples = ['$ jbrowse admin-server', '$ jbrowse admin-server -p 8888'];
129
128
  AdminServer.flags = {
@@ -140,6 +139,7 @@ AdminServer.flags = {
140
139
  }),
141
140
  help: command_1.flags.help({ char: 'h' }),
142
141
  };
142
+ exports.default = AdminServer;
143
143
  function getNetworkAddress() {
144
144
  for (const network of Object.values(os_1.default.networkInterfaces())) {
145
145
  for (const networkInterface of network || []) {
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const command_1 = require("@oclif/command");
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const fetchWithProxy_1 = __importDefault(require("../fetchWithProxy"));
9
- const unzipper_1 = __importDefault(require("unzipper"));
10
9
  const base_1 = __importDefault(require("../base"));
10
+ const decompress_1 = __importDefault(require("decompress"));
11
11
  const fsPromises = fs_1.default.promises;
12
12
  class Create extends base_1.default {
13
13
  async run() {
@@ -40,7 +40,7 @@ class Create extends base_1.default {
40
40
  type !== 'application/octet-stream') {
41
41
  this.error('The URL provided does not seem to be a JBrowse installation URL');
42
42
  }
43
- await response.body.pipe(unzipper_1.default.Extract({ path: argsPath })).promise();
43
+ await (0, decompress_1.default)(Buffer.from(await response.arrayBuffer()), argsPath);
44
44
  this.log(`Unpacked ${locationUrl} at ${argsPath}`);
45
45
  }
46
46
  async checkPath(userPath) {
@@ -50,8 +50,9 @@ class Create extends base_1.default {
50
50
  }
51
51
  }
52
52
  async catch(error) {
53
+ var _a;
53
54
  // @ts-expect-error
54
- if (error.parse && error.parse.output.flags.listVersions) {
55
+ if ((_a = error.parse) === null || _a === void 0 ? void 0 : _a.output.flags.listVersions) {
55
56
  const versions = (await this.fetchGithubVersions()).map(version => version.tag_name);
56
57
  this.log(`All JBrowse versions:\n${versions.join('\n')}`);
57
58
  this.exit();
@@ -59,7 +60,6 @@ class Create extends base_1.default {
59
60
  throw error;
60
61
  }
61
62
  }
62
- exports.default = Create;
63
63
  Create.description = 'Downloads and installs the latest JBrowse 2 release';
64
64
  Create.examples = [
65
65
  '# Download latest release from github, and put in specific path',
@@ -110,3 +110,4 @@ Create.flags = {
110
110
  description: 'Version of JBrowse 2 to install. Format is v1.0.0.\nDefaults to latest',
111
111
  }),
112
112
  };
113
+ exports.default = Create;
@@ -19,7 +19,6 @@ class RemoveTrackJson extends base_1.default {
19
19
  await this.writeJsonFile(this.target, config);
20
20
  }
21
21
  }
22
- exports.default = RemoveTrackJson;
23
22
  RemoveTrackJson.description = 'Remove a track configuration from a JBrowse 2 configuration. Be aware that this can cause crashes in saved sessions that refer to this track!';
24
23
  RemoveTrackJson.examples = ['$ jbrowse remove-track-json trackId'];
25
24
  RemoveTrackJson.args = [
@@ -37,3 +36,4 @@ RemoveTrackJson.flags = {
37
36
  description: 'synonym for target',
38
37
  }),
39
38
  };
39
+ exports.default = RemoveTrackJson;
@@ -101,7 +101,6 @@ class SetDefaultSession extends base_1.default {
101
101
  }
102
102
  }
103
103
  }
104
- exports.default = SetDefaultSession;
105
104
  SetDefaultSession.description = 'Set a default session with views and tracks';
106
105
  SetDefaultSession.examples = [
107
106
  '$ jbrowse set-default-session --session /path/to/default/session.json',
@@ -148,3 +147,4 @@ SetDefaultSession.flags = {
148
147
  char: 'h',
149
148
  }),
150
149
  };
150
+ exports.default = SetDefaultSession;
@@ -10,7 +10,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
10
10
  var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
11
11
  var i, p;
12
12
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
13
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
13
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
14
14
  };
15
15
  var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
16
16
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
@@ -321,7 +321,6 @@ class TextIndex extends base_1.default {
321
321
  .filter(track => assemblyName ? track.assemblyNames.includes(assemblyName) : true);
322
322
  }
323
323
  }
324
- exports.default = TextIndex;
325
324
  TextIndex.description = 'Make a text-indexing file for any given track(s).';
326
325
  TextIndex.examples = [
327
326
  "# indexes all tracks that it can find in the current directory's config.json",
@@ -390,3 +389,4 @@ TextIndex.flags = {
390
389
  description: 'Just print out tracks that will be indexed by the process, without doing any indexing',
391
390
  }),
392
391
  };
392
+ exports.default = TextIndex;
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const command_1 = require("@oclif/command");
7
- const rimraf_1 = __importDefault(require("rimraf"));
7
+ const rimraf_1 = require("rimraf");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
10
+ const decompress_1 = __importDefault(require("decompress"));
10
11
  const fetchWithProxy_1 = __importDefault(require("../fetchWithProxy"));
11
- const unzipper_1 = __importDefault(require("unzipper"));
12
12
  const base_1 = __importDefault(require("../base"));
13
13
  class Upgrade extends base_1.default {
14
14
  async run() {
@@ -44,16 +44,15 @@ class Upgrade extends base_1.default {
44
44
  this.error('The URL provided does not seem to be a JBrowse installation URL');
45
45
  }
46
46
  if (clean) {
47
- rimraf_1.default.sync(path_1.default.join(argsPath, 'static'));
47
+ (0, rimraf_1.rimrafSync)(path_1.default.join(argsPath, 'static'));
48
48
  fs_1.default.readdirSync(argsPath)
49
49
  .filter(f => f.includes('worker.js'))
50
50
  .forEach(f => fs_1.default.unlinkSync(path_1.default.join(argsPath, f)));
51
51
  }
52
- await response.body.pipe(unzipper_1.default.Extract({ path: argsPath })).promise();
52
+ await (0, decompress_1.default)(Buffer.from(await response.arrayBuffer()), argsPath);
53
53
  this.log(`Unpacked ${locationUrl} at ${argsPath}`);
54
54
  }
55
55
  }
56
- exports.default = Upgrade;
57
56
  Upgrade.description = 'Upgrades JBrowse 2 to latest version';
58
57
  Upgrade.examples = [
59
58
  '# Upgrades current directory to latest jbrowse release',
@@ -107,3 +106,4 @@ Upgrade.flags = {
107
106
  description: 'A direct URL to a JBrowse 2 release',
108
107
  }),
109
108
  };
109
+ exports.default = Upgrade;
@@ -4,9 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const node_fetch_1 = __importDefault(require("node-fetch"));
7
- const proxy_agent_1 = __importDefault(require("proxy-agent"));
7
+ const proxy_agent_1 = require("proxy-agent");
8
+ // The correct proxy `Agent` implementation to use will be determined
9
+ // via the `http_proxy` / `https_proxy` / `no_proxy` / etc. env vars
8
10
  function fetchWithProxy(url, options = {}) {
9
- const agent = new proxy_agent_1.default();
11
+ const agent = new proxy_agent_1.ProxyAgent();
10
12
  return (0, node_fetch_1.default)(url, Object.assign({ agent }, options));
11
13
  }
12
14
  exports.default = fetchWithProxy;
@@ -50,46 +50,44 @@ function indexGff3({ config, attributesToIndex, inLocation, outLocation, typesTo
50
50
  input: inLocation.match(/.b?gz$/) ? stream.pipe((0, zlib_1.createGunzip)()) : stream,
51
51
  });
52
52
  try {
53
- for (var _d = true, rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield __await(rl_1.next()), _a = rl_1_1.done, !_a;) {
53
+ for (var _d = true, rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield __await(rl_1.next()), _a = rl_1_1.done, !_a; _d = true) {
54
54
  _c = rl_1_1.value;
55
55
  _d = false;
56
- try {
57
- const line = _c;
58
- if (line.startsWith('#')) {
59
- continue;
60
- }
61
- else if (line.startsWith('>')) {
62
- break;
63
- }
64
- const [seq_id, , type, start, end, , , , col9] = line.split('\t');
65
- const locStr = `${seq_id}:${start}..${end}`;
66
- if (!typesToExclude.includes(type)) {
67
- // turns gff3 attrs into a map, and converts the arrays into space
68
- // separated strings
69
- const col9attrs = Object.fromEntries(col9
70
- .split(';')
71
- .map(f => f.trim())
72
- .filter(f => !!f)
73
- .map(f => f.split('='))
74
- .map(([key, val]) => [
75
- key.trim(),
76
- decodeURIComponent(val).trim().split(',').join(' '),
77
- ]));
78
- const attrs = attributesToIndex
79
- .map(attr => col9attrs[attr])
80
- .filter((f) => !!f);
81
- if (attrs.length) {
82
- const record = JSON.stringify([
83
- encodeURIComponent(locStr),
84
- encodeURIComponent(trackId),
85
- ...attrs.map(a => encodeURIComponent(a)),
86
- ]).replace(/,/g, '|');
87
- yield yield __await(`${record} ${[...new Set(attrs)].join(' ')}\n`);
88
- }
89
- }
56
+ const line = _c;
57
+ if (!line.trim()) {
58
+ continue;
90
59
  }
91
- finally {
92
- _d = true;
60
+ else if (line.startsWith('#')) {
61
+ continue;
62
+ }
63
+ else if (line.startsWith('>')) {
64
+ break;
65
+ }
66
+ const [seq_id, , type, start, end, , , , col9] = line.split('\t');
67
+ const locStr = `${seq_id}:${start}..${end}`;
68
+ if (!typesToExclude.includes(type)) {
69
+ // turns gff3 attrs into a map, and converts the arrays into space
70
+ // separated strings
71
+ const col9attrs = Object.fromEntries(col9
72
+ .split(';')
73
+ .map(f => f.trim())
74
+ .filter(f => !!f)
75
+ .map(f => f.split('='))
76
+ .map(([key, val]) => [
77
+ key.trim(),
78
+ decodeURIComponent(val).trim().split(',').join(' '),
79
+ ]));
80
+ const attrs = attributesToIndex
81
+ .map(attr => col9attrs[attr])
82
+ .filter((f) => !!f);
83
+ if (attrs.length) {
84
+ const record = JSON.stringify([
85
+ encodeURIComponent(locStr),
86
+ encodeURIComponent(trackId),
87
+ ...attrs.map(a => encodeURIComponent(a)),
88
+ ]).replaceAll(',', '|');
89
+ yield yield __await(`${record} ${[...new Set(attrs)].join(' ')}\n`);
90
+ }
93
91
  }
94
92
  }
95
93
  }
@@ -53,50 +53,45 @@ function indexVcf({ config, attributesToIndex, inLocation, outLocation, quiet, }
53
53
  input: gzStream,
54
54
  });
55
55
  try {
56
- for (var _d = true, rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield __await(rl_1.next()), _a = rl_1_1.done, !_a;) {
56
+ for (var _d = true, rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield __await(rl_1.next()), _a = rl_1_1.done, !_a; _d = true) {
57
57
  _c = rl_1_1.value;
58
58
  _d = false;
59
- try {
60
- const line = _c;
61
- if (line.startsWith('#')) {
62
- continue;
63
- }
64
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
65
- const [ref, pos, id, _ref, _alt, _qual, _filter, info] = line.split('\t');
66
- // turns gff3 attrs into a map, and converts the arrays into space
67
- // separated strings
68
- const fields = Object.fromEntries(info
69
- .split(';')
70
- .map(f => f.trim())
71
- .filter(f => !!f)
72
- .map(f => f.split('='))
73
- .map(([key, val]) => [
74
- key.trim(),
75
- val ? decodeURIComponent(val).trim().split(',').join(' ') : undefined,
76
- ]));
77
- const end = fields.END;
78
- const locStr = `${ref}:${pos}..${end || +pos + 1}`;
79
- if (id === '.') {
80
- continue;
81
- }
82
- const infoAttrs = attributesToIndex
83
- .map(attr => fields[attr])
84
- .filter((f) => !!f);
85
- const ids = id.split(',');
86
- for (let i = 0; i < ids.length; i++) {
87
- const id = ids[i];
88
- const attrs = [id];
89
- const record = JSON.stringify([
90
- encodeURIComponent(locStr),
91
- encodeURIComponent(trackId),
92
- encodeURIComponent(id || ''),
93
- ...infoAttrs.map(a => encodeURIComponent(a || '')),
94
- ]).replace(/,/g, '|');
95
- yield yield __await(`${record} ${[...new Set(attrs)].join(' ')}\n`);
96
- }
59
+ const line = _c;
60
+ if (line.startsWith('#')) {
61
+ continue;
97
62
  }
98
- finally {
99
- _d = true;
63
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
64
+ const [ref, pos, id, _ref, _alt, _qual, _filter, info] = line.split('\t');
65
+ // turns gff3 attrs into a map, and converts the arrays into space
66
+ // separated strings
67
+ const fields = Object.fromEntries(info
68
+ .split(';')
69
+ .map(f => f.trim())
70
+ .filter(f => !!f)
71
+ .map(f => f.split('='))
72
+ .map(([key, val]) => [
73
+ key.trim(),
74
+ val ? decodeURIComponent(val).trim().split(',').join(' ') : undefined,
75
+ ]));
76
+ const end = fields.END;
77
+ const locStr = `${ref}:${pos}..${end || +pos + 1}`;
78
+ if (id === '.') {
79
+ continue;
80
+ }
81
+ const infoAttrs = attributesToIndex
82
+ .map(attr => fields[attr])
83
+ .filter((f) => !!f);
84
+ const ids = id.split(',');
85
+ for (let i = 0; i < ids.length; i++) {
86
+ const id = ids[i];
87
+ const attrs = [id];
88
+ const record = JSON.stringify([
89
+ encodeURIComponent(locStr),
90
+ encodeURIComponent(trackId),
91
+ encodeURIComponent(id || ''),
92
+ ...infoAttrs.map(a => encodeURIComponent(a || '')),
93
+ ]).replaceAll(',', '|');
94
+ yield yield __await(`${record} ${[...new Set(attrs)].join(' ')}\n`);
100
95
  }
101
96
  }
102
97
  }
package/lib/util.d.ts CHANGED
@@ -3,5 +3,5 @@
3
3
  import fs from 'fs';
4
4
  export declare function getLocalOrRemoteStream(uri: string, out: string): Promise<{
5
5
  totalBytes: number;
6
- stream: NodeJS.ReadableStream | fs.ReadStream;
6
+ stream: fs.ReadStream | NodeJS.ReadableStream;
7
7
  }>;
@@ -1 +1 @@
1
- {"version":"2.4.2","commands":{"add-assembly":{"id":"add-assembly","description":"Add an assembly to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and GRCh38.fa.fai to current directory","$ jbrowse add-assembly GRCh38.fa --load copy","","# add assembly to a specific jb2 installation path using --out, and copies the .fa and .fa.fai file to /path/to/jb2","$ jbrowse add-assembly GRCh38.fa --out /path/to/jb2/ --load copy","","# force indexedFasta for add-assembly without relying on file extension","$ jbrowse add-assembly GRCh38.xyz --type indexedFasta --load copy","","# add displayName for an assembly","$ jbrowse add-assembly myFile.fa.gz --name hg38 --displayName \"Homo sapiens (hg38)\"","","# use chrom.sizes file for assembly instead of a fasta file","$ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace","","# add assembly from preconfigured json file, expert option","$ jbrowse add-assembly GRCh38.config.json --load copy","","# add assembly from a 2bit file, also note pointing direct to a URL so no --load flag needed","$ jbrowse add-assembly https://example.com/data/sample.2bit","","# add a bgzip indexed fasta inferred by fa.gz extension. assumes .fa.gz.gzi and .fa.gz.fai files also exists","$ jbrowse add-assembly myfile.fa.gz --load copy"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of sequence, by default inferred from sequence file\n\nindexedFasta An index FASTA (e.g. .fa or .fasta) file;\n can optionally specify --faiLocation\n\nbgzipFasta A block-gzipped and indexed FASTA (e.g. .fa.gz or .fasta.gz) file;\n can optionally specify --faiLocation and/or --gziLocation\n\ntwoBit A twoBit (e.g. .2bit) file\n\nchromSizes A chromosome sizes (e.g. .chrom.sizes) file\n\ncustom Either a JSON file location or inline JSON that defines a custom\n sequence adapter; must provide --name if using inline JSON","options":["indexedFasta","bgzipFasta","twoBit","chromSizes","custom"]},"name":{"name":"name","type":"option","char":"n","description":"Name of the assembly; if not specified, will be guessed using the sequence file name"},"alias":{"name":"alias","type":"option","char":"a","description":"An alias for the assembly name (e.g. \"hg38\" if the name of the assembly is \"GRCh38\");\ncan be specified multiple times"},"displayName":{"name":"displayName","type":"option","description":"The display name to specify for the assembly, e.g. \"Homo sapiens (hg38)\" while the name can be a shorter identifier like \"hg38\""},"faiLocation":{"name":"faiLocation","type":"option","description":"[default: <fastaLocation>.fai] FASTA index file or URL"},"gziLocation":{"name":"gziLocation","type":"option","description":"[default: <fastaLocation>.gzi] FASTA gzip index file or URL"},"refNameAliases":{"name":"refNameAliases","type":"option","description":"Reference sequence name aliases file or URL; assumed to be a tab-separated aliases\nfile unless --refNameAliasesType is specified"},"refNameAliasesType":{"name":"refNameAliasesType","type":"option","description":"Type of aliases defined by --refNameAliases; if \"custom\", --refNameAliases is either\na JSON file location or inline JSON that defines a custom sequence adapter","options":["aliases","custom"]},"refNameColors":{"name":"refNameColors","type":"option","description":"A comma-separated list of color strings for the reference sequence names; will cycle\nthrough colors if there are fewer colors than sequences"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the data directory. Copy, symlink, or move the data directory to the JBrowse directory. Or use inPlace to modify the config without doing any file operations","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the sequence file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrite existing assembly if one with the same name exists","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"sequence","description":"sequence file or URL\n\nIf TYPE is indexedFasta or bgzipFasta, the index file defaults to <location>.fai\nand can be optionally specified with --faiLocation\nIf TYPE is bgzipFasta, the gzip index file defaults to <location>.gzi and can be\noptionally specified with --gziLocation","required":true}]},"add-connection":{"id":"add-connection","description":"Add a connection to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-connection http://mysite.com/jbrowse/data/","$ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection","$ jbrowse add-connection http://mysite.com/path/to/hub.txt --assemblyName hg19","$ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection --assemblyName hg19","$ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config '{\"uri\":{\"url\":\"https://mysite.com/path/to/custom\"}, \"locationType\": \"UriLocation\"}' --assemblyName hg19","$ jbrowse add-connection https://mysite.com/path/to/hub.txt --connectionId newId --name newName --target /path/to/jb2/installation/config.json"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of connection, ex. JBrowse1Connection, UCSCTrackHubConnection, custom"},"assemblyName":{"name":"assemblyName","type":"option","char":"a","description":"Assembly name of the connection If none, will default to the assembly in your config file"},"config":{"name":"config","type":"option","char":"c","description":"Any extra config settings to add to connection in JSON object format, such as '{\"uri\":\"url\":\"https://sample.com\"}, \"locationType\": \"UriLocation\"}'"},"connectionId":{"name":"connectionId","type":"option","description":"Id for the connection that must be unique to JBrowse. Defaults to 'connectionType-assemblyName-currentTime'"},"name":{"name":"name","type":"option","char":"n","description":"Name of the connection. Defaults to connectionId if not provided"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to."},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the data directory URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrites any existing connections if same connection id","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"connectionUrlOrPath","description":"URL of data directory\nFor hub file, usually called hub.txt\nFor JBrowse 1, location of JB1 data directory similar to http://mysite.com/jbrowse/data/ ","required":true}]},"add-track-json":{"id":"add-track-json","description":"Add a track configuration directly from a JSON hunk to the JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-track-json track.json","$ jbrowse add-track-json track.json --update"],"flags":{"update":{"name":"update","type":"boolean","char":"u","description":"update the contents of an existing track, matched based on trackId","allowNo":false},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"}},"args":[{"name":"track","description":"track JSON file or command line arg blob","required":true}]},"add-track":{"id":"add-track","description":"Add a track to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# copy /path/to/my.bam and /path/to/my.bam.bai to current directory and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load copy","","# copy my.bam and my.bam.bai to /path/to/jb2/bam and adds track entry to /path/to/jb2/bam/config.json","$ jbrowse add-track my.bam --load copy --out /path/to/jb2 --subDir bam","","# same as above, but specify path to bai file. needed for if the bai file does not have the extension .bam.bai","$ jbrowse add-track my.bam --indexFile my.bai --load copy","","# creates symlink for /path/to/my.bam and adds track to config.json","$ jbrowse add-track /path/to/my.bam --load symlink","","# add track from URL to config.json, no --load flag needed","$ jbrowse add-track https://mywebsite.com/my.bam","","# --load inPlace adds a track without doing file operations","$ jbrowse add-track /url/relative/path.bam --load inPlace"],"flags":{"trackType":{"name":"trackType","type":"option","char":"t","description":"Type of track, by default inferred from track file"},"name":{"name":"name","type":"option","char":"n","description":"Name of the track. Will be defaulted to the trackId if none specified"},"indexFile":{"name":"indexFile","type":"option","description":"Optional index file for the track"},"description":{"name":"description","type":"option","char":"d","description":"Optional description of the track"},"assemblyNames":{"name":"assemblyNames","type":"option","char":"a","description":"Assembly name or names for track as comma separated string. If none, will default to the assembly in your config file"},"category":{"name":"category","type":"option","description":"Optional Comma separated string of categories to group tracks"},"config":{"name":"config","type":"option","description":"Any extra config settings to add to a track. i.e '{\"defaultRendering\": \"density\"}'"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation to write out to."},"out":{"name":"out","type":"option","description":"synonym for target"},"subDir":{"name":"subDir","type":"option","description":"when using --load a file, output to a subdirectory of the target dir","default":""},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"trackId":{"name":"trackId","type":"option","description":"trackId for the track, by default inferred from filename, must be unique throughout config"},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the track. Copy, symlink, or move the track to the JBrowse directory. Or inPlace to leave track alone","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Skip check for whether or not the file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrites existing track if it shares the same trackId","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false},"protocol":{"name":"protocol","type":"option","description":"Force protocol to a specific value","default":"uri"},"bed1":{"name":"bed1","type":"option","description":"Used only for mcscan anchors/simpleAnchors types"},"bed2":{"name":"bed2","type":"option","description":"Used only for mcscan anchors/simpleAnchors types"}},"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}]},"remove-track":{"id":"remove-track","description":"Remove a track configuration from a JBrowse 2 configuration. Be aware that this can cause crashes in saved sessions that refer to this track!","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse remove-track-json trackId"],"flags":{"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}]},"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"},"prefixSize":{"name":"prefixSize","type":"option","description":"Specify the prefix size for the ixx index. We attempt to automatically calculate this, but you can manually specify this too. If many genes have similar gene IDs e.g. Z000000001, Z000000002 the prefix size should be larger so that they get split into different bins"},"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)"},"fileId":{"name":"fileId","type":"option","description":"Set the trackId used for the indexes generated with the --file argument"},"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":"."}]}}}
1
+ {"version":"2.6.1","commands":{"add-assembly":{"id":"add-assembly","description":"Add an assembly to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["# add assembly to installation in current directory. assumes .fai file also exists, and copies GRCh38.fa and GRCh38.fa.fai to current directory","$ jbrowse add-assembly GRCh38.fa --load copy","","# add assembly to a specific jb2 installation path using --out, and copies the .fa and .fa.fai file to /path/to/jb2","$ jbrowse add-assembly GRCh38.fa --out /path/to/jb2/ --load copy","","# force indexedFasta for add-assembly without relying on file extension","$ jbrowse add-assembly GRCh38.xyz --type indexedFasta --load copy","","# add displayName for an assembly","$ jbrowse add-assembly myFile.fa.gz --name hg38 --displayName \"Homo sapiens (hg38)\"","","# use chrom.sizes file for assembly instead of a fasta file","$ jbrowse add-assembly GRCh38.chrom.sizes --load inPlace","","# add assembly from preconfigured json file, expert option","$ jbrowse add-assembly GRCh38.config.json --load copy","","# add assembly from a 2bit file, also note pointing direct to a URL so no --load flag needed","$ jbrowse add-assembly https://example.com/data/sample.2bit","","# add a bgzip indexed fasta inferred by fa.gz extension. assumes .fa.gz.gzi and .fa.gz.fai files also exists","$ jbrowse add-assembly myfile.fa.gz --load copy"],"flags":{"type":{"name":"type","type":"option","char":"t","description":"type of sequence, by default inferred from sequence file\n\nindexedFasta An index FASTA (e.g. .fa or .fasta) file;\n can optionally specify --faiLocation\n\nbgzipFasta A block-gzipped and indexed FASTA (e.g. .fa.gz or .fasta.gz) file;\n can optionally specify --faiLocation and/or --gziLocation\n\ntwoBit A twoBit (e.g. .2bit) file\n\nchromSizes A chromosome sizes (e.g. .chrom.sizes) file\n\ncustom Either a JSON file location or inline JSON that defines a custom\n sequence adapter; must provide --name if using inline JSON","options":["indexedFasta","bgzipFasta","twoBit","chromSizes","custom"]},"name":{"name":"name","type":"option","char":"n","description":"Name of the assembly; if not specified, will be guessed using the sequence file name"},"alias":{"name":"alias","type":"option","char":"a","description":"An alias for the assembly name (e.g. \"hg38\" if the name of the assembly is \"GRCh38\");\ncan be specified multiple times"},"displayName":{"name":"displayName","type":"option","description":"The display name to specify for the assembly, e.g. \"Homo sapiens (hg38)\" while the name can be a shorter identifier like \"hg38\""},"faiLocation":{"name":"faiLocation","type":"option","description":"[default: <fastaLocation>.fai] FASTA index file or URL"},"gziLocation":{"name":"gziLocation","type":"option","description":"[default: <fastaLocation>.gzi] FASTA gzip index file or URL"},"refNameAliases":{"name":"refNameAliases","type":"option","description":"Reference sequence name aliases file or URL; assumed to be a tab-separated aliases\nfile unless --refNameAliasesType is specified"},"refNameAliasesType":{"name":"refNameAliasesType","type":"option","description":"Type of aliases defined by --refNameAliases; if \"custom\", --refNameAliases is either\na JSON file location or inline JSON that defines a custom sequence adapter","options":["aliases","custom"]},"refNameColors":{"name":"refNameColors","type":"option","description":"A comma-separated list of color strings for the reference sequence names; will cycle\nthrough colors if there are fewer colors than sequences"},"target":{"name":"target","type":"option","description":"path to config file in JB2 installation directory to write out to.\nCreates ./config.json if nonexistent"},"out":{"name":"out","type":"option","description":"synonym for target"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"load":{"name":"load","type":"option","char":"l","description":"Required flag when using a local file. Choose how to manage the data directory. Copy, symlink, or move the data directory to the JBrowse directory. Or use inPlace to modify the config without doing any file operations","options":["copy","symlink","move","inPlace"]},"skipCheck":{"name":"skipCheck","type":"boolean","description":"Don't check whether or not the sequence file or URL exists or if you are in a JBrowse directory","allowNo":false},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrite existing assembly if one with the same name exists","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","description":"Equivalent to `--skipCheck --overwrite`","allowNo":false}},"args":[{"name":"sequence","description":"sequence file or URL\n\nIf TYPE is indexedFasta or bgzipFasta, the index file defaults to <location>.fai\nand can be optionally specified with --faiLocation\nIf TYPE is bgzipFasta, the gzip index file defaults to <location>.gzi and can be\noptionally specified with --gziLocation","required":true}]},"add-connection":{"id":"add-connection","description":"Add a connection to a JBrowse 2 configuration","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse add-connection http://mysite.com/jbrowse/data/ -a hg19","$ jbrowse add-connection http://mysite.com/jbrowse/custom_data_folder/ --type JBrowse1Connection -a hg38","$ jbrowse add-connection http://mysite.com/path/to/hub.txt","$ jbrowse add-connection http://mysite.com/path/to/custom_hub_name.txt --type UCSCTrackHubConnection","$ jbrowse add-connection http://mysite.com/path/to/custom --type custom --config '{\"uri\":{\"url\":\"https://mysite.com/path/to/custom\"}, \"locationType\": \"UriLocation\"}' -a 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"},"assemblyNames":{"name":"assemblyNames","type":"option","char":"a","description":"For UCSC, optional: Comma separated list of assembly name(s) to filter from this connection. For JBrowse: a single assembly name"},"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"},"bed1":{"name":"bed1","type":"option","description":"Used only for mcscan anchors/simpleAnchors types"},"bed2":{"name":"bed2","type":"option","description":"Used only for mcscan anchors/simpleAnchors types"}},"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}]},"remove-track":{"id":"remove-track","description":"Remove a track configuration from a JBrowse 2 configuration. Be aware that this can cause crashes in saved sessions that refer to this track!","pluginName":"@jbrowse/cli","pluginType":"core","aliases":[],"examples":["$ jbrowse remove-track-json trackId"],"flags":{"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}]},"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"},"prefixSize":{"name":"prefixSize","type":"option","description":"Specify the prefix size for the ixx index. We attempt to automatically calculate this, but you can manually specify this too. If many genes have similar gene IDs e.g. Z000000001, Z000000002 the prefix size should be larger so that they get split into different bins"},"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)"},"fileId":{"name":"fileId","type":"option","description":"Set the trackId used for the indexes generated with the --file argument"},"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": "2.4.2",
3
+ "version": "2.6.1",
4
4
  "description": "A command line tool for working with JBrowse 2",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -52,17 +52,17 @@
52
52
  "chalk": "^4.1.0",
53
53
  "cli-progress": "^3.9.0",
54
54
  "cors": "^2.8.5",
55
+ "decompress": "^4.0.0",
55
56
  "express": "^4.17.1",
56
57
  "ixixx": "^2.0.1",
57
58
  "json-parse-better-errors": "^1.0.2",
58
59
  "node-fetch": "^2.6.0",
59
- "proxy-agent": "^5.0.0",
60
- "rimraf": "^3.0.2",
61
- "tslib": "^2.3.1",
62
- "unzipper": "^0.10.11"
60
+ "proxy-agent": "^6.2.1",
61
+ "rimraf": "^5.0.0",
62
+ "tslib": "^2.3.1"
63
63
  },
64
64
  "devDependencies": {
65
- "typescript": "^4.5.2"
65
+ "typescript": "^5.1.3"
66
66
  },
67
67
  "oclif": {
68
68
  "commands": "./lib/commands",
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "36e382a70e7d220343b873e7e6aba5c83e5342c8"
78
+ "gitHead": "1cbe7ba097fb2d2763c776e5e429e4670cdd583c"
79
79
  }