@jbrowse/cli 2.6.2 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +274 -206
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +6 -3
- package/lib/base.js +32 -80
- package/lib/commands/add-assembly.js +29 -27
- package/lib/commands/add-connection.js +43 -37
- package/lib/commands/add-track-json.js +9 -10
- package/lib/commands/add-track.js +74 -73
- package/lib/commands/admin-server.js +7 -7
- package/lib/commands/create.js +14 -16
- package/lib/commands/remove-track.js +9 -11
- package/lib/commands/set-default-session.js +14 -17
- package/lib/commands/text-index.js +86 -101
- package/lib/commands/upgrade.js +13 -14
- package/lib/fetchWithProxy.js +1 -1
- package/lib/index.js +2 -2
- package/lib/types/common.js +2 -2
- package/lib/types/gff3Adapter.js +54 -88
- package/lib/types/vcfAdapter.js +58 -93
- package/oclif.manifest.json +918 -1
- package/package.json +10 -12
|
@@ -3,15 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const json_parse_better_errors_1 = __importDefault(require("json-parse-better-errors"));
|
|
9
9
|
const base_1 = __importDefault(require("../base"));
|
|
10
10
|
const fsPromises = fs_1.default.promises;
|
|
11
11
|
class SetDefaultSession extends base_1.default {
|
|
12
12
|
async run() {
|
|
13
|
-
|
|
14
|
-
const { flags: runFlags } = this.parse(SetDefaultSession);
|
|
13
|
+
const { flags: runFlags } = await this.parse(SetDefaultSession);
|
|
15
14
|
const { session, name, tracks, currentSession, view, viewId, delete: deleteDefaultSession, } = runFlags;
|
|
16
15
|
const output = runFlags.target || runFlags.out || '.';
|
|
17
16
|
const isDir = (await fsPromises.lstat(output)).isDirectory();
|
|
@@ -30,7 +29,7 @@ class SetDefaultSession extends base_1.default {
|
|
|
30
29
|
this.exit();
|
|
31
30
|
}
|
|
32
31
|
const foundTracks = [];
|
|
33
|
-
const existingDefaultSession =
|
|
32
|
+
const existingDefaultSession = configContents.defaultSession?.length > 0;
|
|
34
33
|
// must provide default session, or view, or tracks + view
|
|
35
34
|
if (!session && !view && !tracks) {
|
|
36
35
|
this.error(`No default session information provided, Please either provide a default session file or enter information to build a default session`, { exit: 120 });
|
|
@@ -49,9 +48,8 @@ class SetDefaultSession extends base_1.default {
|
|
|
49
48
|
}
|
|
50
49
|
trackIds = tracks.split(',').map(c => c.trim());
|
|
51
50
|
trackIds.forEach(trackId => {
|
|
52
|
-
var _a;
|
|
53
51
|
this.log(trackId);
|
|
54
|
-
const matchingTrack =
|
|
52
|
+
const matchingTrack = configContents.tracks?.find(track => trackId === track.trackId);
|
|
55
53
|
if (!matchingTrack) {
|
|
56
54
|
this.error(`Track ${trackId} has not been added to config yet.\nPlease add the track with the add-track command before adding to the default session`, { exit: 140 });
|
|
57
55
|
}
|
|
@@ -108,42 +106,41 @@ SetDefaultSession.examples = [
|
|
|
108
106
|
'$ jbrowse set-default-session --view LinearGenomeView, --name newName --viewId view-no-tracks',
|
|
109
107
|
'$ jbrowse set-default-session --currentSession # Prints out current default session',
|
|
110
108
|
];
|
|
111
|
-
SetDefaultSession.args = [];
|
|
112
109
|
SetDefaultSession.flags = {
|
|
113
|
-
session:
|
|
110
|
+
session: core_1.Flags.string({
|
|
114
111
|
char: 's',
|
|
115
112
|
description: 'set path to a file containing session in json format',
|
|
116
113
|
}),
|
|
117
|
-
name:
|
|
114
|
+
name: core_1.Flags.string({
|
|
118
115
|
char: 'n',
|
|
119
116
|
description: 'Give a name for the default session',
|
|
120
117
|
default: 'New Default Session',
|
|
121
118
|
}),
|
|
122
|
-
view:
|
|
119
|
+
view: core_1.Flags.string({
|
|
123
120
|
char: 'v',
|
|
124
121
|
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',
|
|
125
122
|
}),
|
|
126
|
-
viewId:
|
|
123
|
+
viewId: core_1.Flags.string({
|
|
127
124
|
description: 'Identifier for the view. Will be generated on default',
|
|
128
125
|
}),
|
|
129
|
-
tracks:
|
|
126
|
+
tracks: core_1.Flags.string({
|
|
130
127
|
char: 't',
|
|
131
128
|
description: 'Track id or track ids as comma separated string to put into default session',
|
|
132
129
|
}),
|
|
133
|
-
currentSession:
|
|
130
|
+
currentSession: core_1.Flags.boolean({
|
|
134
131
|
char: 'c',
|
|
135
132
|
description: 'List out the current default session',
|
|
136
133
|
}),
|
|
137
|
-
target:
|
|
134
|
+
target: core_1.Flags.string({
|
|
138
135
|
description: 'path to config file in JB2 installation directory to write out to',
|
|
139
136
|
}),
|
|
140
|
-
out:
|
|
137
|
+
out: core_1.Flags.string({
|
|
141
138
|
description: 'synonym for target',
|
|
142
139
|
}),
|
|
143
|
-
delete:
|
|
140
|
+
delete: core_1.Flags.boolean({
|
|
144
141
|
description: 'Delete any existing default session.',
|
|
145
142
|
}),
|
|
146
|
-
help:
|
|
143
|
+
help: core_1.Flags.help({
|
|
147
144
|
char: 'h',
|
|
148
145
|
}),
|
|
149
146
|
};
|
|
@@ -1,28 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
3
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
4
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
5
|
-
var m = o[Symbol.asyncIterator], i;
|
|
6
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
7
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
8
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
9
|
-
};
|
|
10
|
-
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
11
|
-
var i, p;
|
|
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: false } : f ? f(v) : v; } : f; }
|
|
14
|
-
};
|
|
15
|
-
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
16
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
17
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
18
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
19
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
20
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
21
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
22
|
-
function fulfill(value) { resume("next", value); }
|
|
23
|
-
function reject(value) { resume("throw", value); }
|
|
24
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
25
|
-
};
|
|
26
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
4
|
};
|
|
@@ -31,7 +7,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
31
7
|
const path_1 = __importDefault(require("path"));
|
|
32
8
|
const stream_1 = require("stream");
|
|
33
9
|
const ixixx_1 = require("ixixx");
|
|
34
|
-
const
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
35
11
|
// locals
|
|
36
12
|
const gff3Adapter_1 = require("../types/gff3Adapter");
|
|
37
13
|
const vcfAdapter_1 = require("../types/vcfAdapter");
|
|
@@ -48,7 +24,7 @@ function getLoc(elt) {
|
|
|
48
24
|
}
|
|
49
25
|
class TextIndex extends base_1.default {
|
|
50
26
|
async run() {
|
|
51
|
-
const { flags } = this.parse(TextIndex);
|
|
27
|
+
const { flags } = await this.parse(TextIndex);
|
|
52
28
|
const { perTrack, file } = flags;
|
|
53
29
|
if (file) {
|
|
54
30
|
await this.indexFileList();
|
|
@@ -62,8 +38,7 @@ class TextIndex extends base_1.default {
|
|
|
62
38
|
this.log('Finished!');
|
|
63
39
|
}
|
|
64
40
|
async aggregateIndex() {
|
|
65
|
-
|
|
66
|
-
const { flags } = this.parse(TextIndex);
|
|
41
|
+
const { flags } = await this.parse(TextIndex);
|
|
67
42
|
const { out, target, tracks, assemblies, attributes, quiet, force, exclude, dryrun, prefixSize, } = flags;
|
|
68
43
|
const outFlag = target || out || '.';
|
|
69
44
|
const isDir = fs_1.default.lstatSync(outFlag).isDirectory();
|
|
@@ -75,14 +50,14 @@ class TextIndex extends base_1.default {
|
|
|
75
50
|
fs_1.default.mkdirSync(trixDir);
|
|
76
51
|
}
|
|
77
52
|
const aggregateTextSearchAdapters = config.aggregateTextSearchAdapters || [];
|
|
78
|
-
const asms =
|
|
79
|
-
|
|
53
|
+
const asms = assemblies?.split(',') ||
|
|
54
|
+
config.assemblies?.map(a => a.name) ||
|
|
80
55
|
(config.assembly ? [config.assembly.name] : []);
|
|
81
|
-
if (!
|
|
56
|
+
if (!asms?.length) {
|
|
82
57
|
throw new Error('No assemblies found');
|
|
83
58
|
}
|
|
84
59
|
for (const asm of asms) {
|
|
85
|
-
const trackConfigs = await this.getTrackConfigs(confPath, tracks
|
|
60
|
+
const trackConfigs = await this.getTrackConfigs(confPath, tracks?.split(','), asm);
|
|
86
61
|
if (!trackConfigs.length) {
|
|
87
62
|
this.log('Indexing assembly ' + asm + '...(no tracks found)...');
|
|
88
63
|
continue;
|
|
@@ -134,11 +109,14 @@ class TextIndex extends base_1.default {
|
|
|
134
109
|
}
|
|
135
110
|
}
|
|
136
111
|
if (!dryrun) {
|
|
137
|
-
writeConf(
|
|
112
|
+
writeConf({
|
|
113
|
+
...config,
|
|
114
|
+
aggregateTextSearchAdapters,
|
|
115
|
+
}, confPath);
|
|
138
116
|
}
|
|
139
117
|
}
|
|
140
118
|
async perTrackIndex() {
|
|
141
|
-
const { flags } = this.parse(TextIndex);
|
|
119
|
+
const { flags } = await this.parse(TextIndex);
|
|
142
120
|
const { out, target, tracks, assemblies, attributes, quiet, force, exclude, prefixSize, } = flags;
|
|
143
121
|
const outFlag = target || out || '.';
|
|
144
122
|
const isDir = fs_1.default.lstatSync(outFlag).isDirectory();
|
|
@@ -153,13 +131,13 @@ class TextIndex extends base_1.default {
|
|
|
153
131
|
if (assemblies) {
|
|
154
132
|
throw new Error(`Can't specify assemblies when indexing per track, remove assemblies flag to continue.`);
|
|
155
133
|
}
|
|
156
|
-
const confs = await this.getTrackConfigs(confFilePath, tracks
|
|
134
|
+
const confs = await this.getTrackConfigs(confFilePath, tracks?.split(','));
|
|
157
135
|
if (!confs.length) {
|
|
158
136
|
throw new Error(`Tracks not found in config.json, please add track configurations before indexing.`);
|
|
159
137
|
}
|
|
160
138
|
for (const trackConfig of confs) {
|
|
161
139
|
const { textSearching, trackId, assemblyNames } = trackConfig;
|
|
162
|
-
if (
|
|
140
|
+
if (textSearching?.textSearchAdapter && !force) {
|
|
163
141
|
this.log(`Note: ${trackId} has already been indexed with this configuration, use --force to overwrite this track. Skipping for now`);
|
|
164
142
|
continue;
|
|
165
143
|
}
|
|
@@ -174,11 +152,15 @@ class TextIndex extends base_1.default {
|
|
|
174
152
|
assemblyNames,
|
|
175
153
|
prefixSize,
|
|
176
154
|
});
|
|
177
|
-
if (!
|
|
155
|
+
if (!textSearching?.textSearchAdapter) {
|
|
178
156
|
// modifies track with new text search adapter
|
|
179
157
|
const index = configTracks.findIndex(track => trackId === track.trackId);
|
|
180
158
|
if (index !== -1) {
|
|
181
|
-
configTracks[index] =
|
|
159
|
+
configTracks[index] = {
|
|
160
|
+
...trackConfig,
|
|
161
|
+
textSearching: {
|
|
162
|
+
...textSearching,
|
|
163
|
+
textSearchAdapter: {
|
|
182
164
|
type: 'TrixTextSearchAdapter',
|
|
183
165
|
textSearchAdapterId: trackId + '-index',
|
|
184
166
|
ixFilePath: {
|
|
@@ -194,18 +176,23 @@ class TextIndex extends base_1.default {
|
|
|
194
176
|
locationType: 'UriLocation',
|
|
195
177
|
},
|
|
196
178
|
assemblyNames: assemblyNames,
|
|
197
|
-
}
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
};
|
|
198
182
|
}
|
|
199
183
|
else {
|
|
200
184
|
this.log("Error: can't find trackId");
|
|
201
185
|
}
|
|
202
186
|
}
|
|
203
|
-
writeConf(
|
|
187
|
+
writeConf({ ...config, tracks: configTracks }, confFilePath);
|
|
204
188
|
}
|
|
205
189
|
}
|
|
206
190
|
async indexFileList() {
|
|
207
|
-
const { flags } = this.parse(TextIndex);
|
|
191
|
+
const { flags } = await this.parse(TextIndex);
|
|
208
192
|
const { out, target, fileId, file, attributes, quiet, exclude, prefixSize, } = flags;
|
|
193
|
+
if (!file) {
|
|
194
|
+
throw new Error('Cannot index file list without files');
|
|
195
|
+
}
|
|
209
196
|
const outFlag = target || out || '.';
|
|
210
197
|
const trixDir = path_1.default.join(outFlag, 'trix');
|
|
211
198
|
if (!fs_1.default.existsSync(trixDir)) {
|
|
@@ -214,7 +201,7 @@ class TextIndex extends base_1.default {
|
|
|
214
201
|
const trackConfigs = file
|
|
215
202
|
.map(file => (0, common_1.guessAdapterFromFileName)(file))
|
|
216
203
|
.filter(fileConfig => (0, common_1.supported)(fileConfig.adapter.type));
|
|
217
|
-
if (fileId
|
|
204
|
+
if (fileId?.length) {
|
|
218
205
|
for (let i = 0; i < fileId.length; i++) {
|
|
219
206
|
trackConfigs[i].trackId = fileId[i];
|
|
220
207
|
}
|
|
@@ -255,50 +242,48 @@ class TextIndex extends base_1.default {
|
|
|
255
242
|
});
|
|
256
243
|
return ixIxxStream;
|
|
257
244
|
}
|
|
258
|
-
indexFiles({ trackConfigs, attributes, outLocation, quiet, typesToExclude, }) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
loc = adapter.gffGzLocation;
|
|
267
|
-
}
|
|
268
|
-
else if (type === 'Gff3Adapter') {
|
|
269
|
-
loc = adapter.gffLocation;
|
|
270
|
-
}
|
|
271
|
-
else if (type === 'VcfAdapter') {
|
|
272
|
-
loc = adapter.vcfLocation;
|
|
273
|
-
}
|
|
274
|
-
else if (type === 'VcfTabixAdapter') {
|
|
275
|
-
loc = adapter.vcfGzLocation;
|
|
276
|
-
}
|
|
277
|
-
if (!loc) {
|
|
278
|
-
return yield __await(void 0);
|
|
279
|
-
}
|
|
280
|
-
if (type === 'Gff3TabixAdapter' || type === 'Gff3Adapter') {
|
|
281
|
-
yield __await(yield* __asyncDelegator(__asyncValues((0, gff3Adapter_1.indexGff3)({
|
|
282
|
-
config,
|
|
283
|
-
attributesToIndex: indexingAttributes,
|
|
284
|
-
inLocation: getLoc(loc),
|
|
285
|
-
outLocation,
|
|
286
|
-
typesToExclude: indexingFeatureTypesToExclude,
|
|
287
|
-
quiet,
|
|
288
|
-
}))));
|
|
289
|
-
}
|
|
290
|
-
else if (type === 'VcfTabixAdapter' || type === 'VcfAdapter') {
|
|
291
|
-
yield __await(yield* __asyncDelegator(__asyncValues((0, vcfAdapter_1.indexVcf)({
|
|
292
|
-
config,
|
|
293
|
-
attributesToIndex: indexingAttributes,
|
|
294
|
-
inLocation: getLoc(loc),
|
|
295
|
-
outLocation,
|
|
296
|
-
typesToExclude: indexingFeatureTypesToExclude,
|
|
297
|
-
quiet,
|
|
298
|
-
}))));
|
|
299
|
-
}
|
|
245
|
+
async *indexFiles({ trackConfigs, attributes, outLocation, quiet, typesToExclude, }) {
|
|
246
|
+
for (const config of trackConfigs) {
|
|
247
|
+
const { adapter, textSearching } = config;
|
|
248
|
+
const { type } = adapter;
|
|
249
|
+
const { indexingFeatureTypesToExclude = typesToExclude, indexingAttributes = attributes, } = textSearching || {};
|
|
250
|
+
let loc;
|
|
251
|
+
if (type === 'Gff3TabixAdapter') {
|
|
252
|
+
loc = adapter.gffGzLocation;
|
|
300
253
|
}
|
|
301
|
-
|
|
254
|
+
else if (type === 'Gff3Adapter') {
|
|
255
|
+
loc = adapter.gffLocation;
|
|
256
|
+
}
|
|
257
|
+
else if (type === 'VcfAdapter') {
|
|
258
|
+
loc = adapter.vcfLocation;
|
|
259
|
+
}
|
|
260
|
+
else if (type === 'VcfTabixAdapter') {
|
|
261
|
+
loc = adapter.vcfGzLocation;
|
|
262
|
+
}
|
|
263
|
+
if (!loc) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (type === 'Gff3TabixAdapter' || type === 'Gff3Adapter') {
|
|
267
|
+
yield* (0, gff3Adapter_1.indexGff3)({
|
|
268
|
+
config,
|
|
269
|
+
attributesToIndex: indexingAttributes,
|
|
270
|
+
inLocation: getLoc(loc),
|
|
271
|
+
outLocation,
|
|
272
|
+
typesToExclude: indexingFeatureTypesToExclude,
|
|
273
|
+
quiet,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
else if (type === 'VcfTabixAdapter' || type === 'VcfAdapter') {
|
|
277
|
+
yield* (0, vcfAdapter_1.indexVcf)({
|
|
278
|
+
config,
|
|
279
|
+
attributesToIndex: indexingAttributes,
|
|
280
|
+
inLocation: getLoc(loc),
|
|
281
|
+
outLocation,
|
|
282
|
+
typesToExclude: indexingFeatureTypesToExclude,
|
|
283
|
+
quiet,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
302
287
|
}
|
|
303
288
|
runIxIxx({ readStream, outLocation, name, prefixSize, }) {
|
|
304
289
|
return (0, ixixx_1.ixIxxStream)(readStream, path_1.default.join(outLocation, 'trix', `${name}.ix`), path_1.default.join(outLocation, 'trix', `${name}.ixx`), prefixSize);
|
|
@@ -308,7 +293,7 @@ class TextIndex extends base_1.default {
|
|
|
308
293
|
if (!tracks) {
|
|
309
294
|
return [];
|
|
310
295
|
}
|
|
311
|
-
const trackIdsToIndex = trackIds ||
|
|
296
|
+
const trackIdsToIndex = trackIds || tracks?.map(track => track.trackId);
|
|
312
297
|
return trackIdsToIndex
|
|
313
298
|
.map(trackId => {
|
|
314
299
|
const currentTrack = tracks.find(t => trackId === t.trackId);
|
|
@@ -317,7 +302,7 @@ class TextIndex extends base_1.default {
|
|
|
317
302
|
}
|
|
318
303
|
return currentTrack;
|
|
319
304
|
})
|
|
320
|
-
.filter(track =>
|
|
305
|
+
.filter(track => (0, common_1.supported)(track.adapter?.type))
|
|
321
306
|
.filter(track => assemblyName ? track.assemblyNames.includes(assemblyName) : true);
|
|
322
307
|
}
|
|
323
308
|
}
|
|
@@ -339,53 +324,53 @@ TextIndex.examples = [
|
|
|
339
324
|
'$ jbrowse text-index --file myfile.gff3.gz --file myfile.vcfgz --out indexes',
|
|
340
325
|
];
|
|
341
326
|
TextIndex.flags = {
|
|
342
|
-
help:
|
|
343
|
-
tracks:
|
|
327
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
328
|
+
tracks: core_1.Flags.string({
|
|
344
329
|
description: `Specific tracks to index, formatted as comma separated trackIds. If unspecified, indexes all available tracks`,
|
|
345
330
|
}),
|
|
346
|
-
target:
|
|
331
|
+
target: core_1.Flags.string({
|
|
347
332
|
description: 'Path to config file in JB2 installation directory to read from.',
|
|
348
333
|
}),
|
|
349
|
-
out:
|
|
334
|
+
out: core_1.Flags.string({
|
|
350
335
|
description: 'Synonym for target',
|
|
351
336
|
}),
|
|
352
|
-
attributes:
|
|
337
|
+
attributes: core_1.Flags.string({
|
|
353
338
|
description: 'Comma separated list of attributes to index',
|
|
354
339
|
default: 'Name,ID',
|
|
355
340
|
}),
|
|
356
|
-
assemblies:
|
|
341
|
+
assemblies: core_1.Flags.string({
|
|
357
342
|
char: 'a',
|
|
358
343
|
description: 'Specify the assembl(ies) to create an index for. If unspecified, creates an index for each assembly in the config',
|
|
359
344
|
}),
|
|
360
|
-
force:
|
|
345
|
+
force: core_1.Flags.boolean({
|
|
361
346
|
default: false,
|
|
362
347
|
description: 'Overwrite previously existing indexes',
|
|
363
348
|
}),
|
|
364
|
-
quiet:
|
|
349
|
+
quiet: core_1.Flags.boolean({
|
|
365
350
|
char: 'q',
|
|
366
351
|
default: false,
|
|
367
352
|
description: 'Hide the progress bars',
|
|
368
353
|
}),
|
|
369
|
-
perTrack:
|
|
354
|
+
perTrack: core_1.Flags.boolean({
|
|
370
355
|
default: false,
|
|
371
356
|
description: 'If set, creates an index per track',
|
|
372
357
|
}),
|
|
373
|
-
exclude:
|
|
358
|
+
exclude: core_1.Flags.string({
|
|
374
359
|
description: 'Adds gene type to list of excluded types',
|
|
375
360
|
default: 'CDS,exon',
|
|
376
361
|
}),
|
|
377
|
-
prefixSize:
|
|
362
|
+
prefixSize: core_1.Flags.integer({
|
|
378
363
|
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',
|
|
379
364
|
}),
|
|
380
|
-
file:
|
|
365
|
+
file: core_1.Flags.string({
|
|
381
366
|
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)',
|
|
382
367
|
multiple: true,
|
|
383
368
|
}),
|
|
384
|
-
fileId:
|
|
369
|
+
fileId: core_1.Flags.string({
|
|
385
370
|
description: 'Set the trackId used for the indexes generated with the --file argument',
|
|
386
371
|
multiple: true,
|
|
387
372
|
}),
|
|
388
|
-
dryrun:
|
|
373
|
+
dryrun: core_1.Flags.boolean({
|
|
389
374
|
description: 'Just print out tracks that will be indexed by the process, without doing any indexing',
|
|
390
375
|
}),
|
|
391
376
|
};
|
package/lib/commands/upgrade.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
const rimraf_1 = require("rimraf");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -12,7 +12,7 @@ const fetchWithProxy_1 = __importDefault(require("../fetchWithProxy"));
|
|
|
12
12
|
const base_1 = __importDefault(require("../base"));
|
|
13
13
|
class Upgrade extends base_1.default {
|
|
14
14
|
async run() {
|
|
15
|
-
const { args: runArgs, flags: runFlags } = this.parse(Upgrade);
|
|
15
|
+
const { args: runArgs, flags: runFlags } = await this.parse(Upgrade);
|
|
16
16
|
const { localPath: argsPath } = runArgs;
|
|
17
17
|
const { clean, listVersions, tag, url, branch, nightly } = runFlags;
|
|
18
18
|
if (listVersions) {
|
|
@@ -73,35 +73,34 @@ Upgrade.examples = [
|
|
|
73
73
|
'# Get nightly release from main branch',
|
|
74
74
|
'$ jbrowse upgrade --nightly',
|
|
75
75
|
];
|
|
76
|
-
Upgrade.args =
|
|
77
|
-
{
|
|
78
|
-
name: 'localPath',
|
|
76
|
+
Upgrade.args = {
|
|
77
|
+
localPath: core_1.Args.string({
|
|
79
78
|
required: false,
|
|
80
79
|
description: `Location where JBrowse 2 is installed`,
|
|
81
80
|
default: '.',
|
|
82
|
-
},
|
|
83
|
-
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
84
83
|
Upgrade.flags = {
|
|
85
|
-
help:
|
|
84
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
86
85
|
// will need to account for pagenation once there is a lot of releases
|
|
87
|
-
listVersions:
|
|
86
|
+
listVersions: core_1.Flags.boolean({
|
|
88
87
|
char: 'l',
|
|
89
88
|
description: 'Lists out all versions of JBrowse 2',
|
|
90
89
|
}),
|
|
91
|
-
tag:
|
|
90
|
+
tag: core_1.Flags.string({
|
|
92
91
|
char: 't',
|
|
93
92
|
description: 'Version of JBrowse 2 to install. Format is v1.0.0.\nDefaults to latest',
|
|
94
93
|
}),
|
|
95
|
-
branch:
|
|
94
|
+
branch: core_1.Flags.string({
|
|
96
95
|
description: 'Download a development build from a named git branch',
|
|
97
96
|
}),
|
|
98
|
-
nightly:
|
|
97
|
+
nightly: core_1.Flags.boolean({
|
|
99
98
|
description: 'Download the latest development build from the main branch',
|
|
100
99
|
}),
|
|
101
|
-
clean:
|
|
100
|
+
clean: core_1.Flags.boolean({
|
|
102
101
|
description: 'Removes old js,map,and LICENSE files in the installation',
|
|
103
102
|
}),
|
|
104
|
-
url:
|
|
103
|
+
url: core_1.Flags.string({
|
|
105
104
|
char: 'u',
|
|
106
105
|
description: 'A direct URL to a JBrowse 2 release',
|
|
107
106
|
}),
|
package/lib/fetchWithProxy.js
CHANGED
|
@@ -9,6 +9,6 @@ const proxy_agent_1 = require("proxy-agent");
|
|
|
9
9
|
// via the `http_proxy` / `https_proxy` / `no_proxy` / etc. env vars
|
|
10
10
|
function fetchWithProxy(url, options = {}) {
|
|
11
11
|
const agent = new proxy_agent_1.ProxyAgent();
|
|
12
|
-
return (0, node_fetch_1.default)(url,
|
|
12
|
+
return (0, node_fetch_1.default)(url, { agent, ...options });
|
|
13
13
|
}
|
|
14
14
|
exports.default = fetchWithProxy;
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.run = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "run", { enumerable: true, get: function () { return
|
|
4
|
+
var core_1 = require("@oclif/core");
|
|
5
|
+
Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
|
|
6
6
|
// trigger build
|
package/lib/types/common.js
CHANGED
|
@@ -117,8 +117,8 @@ exports.supported = supported;
|
|
|
117
117
|
async function generateMeta({ trackConfigs, attributes, outLocation, name, typesToExclude, assemblyNames, }) {
|
|
118
118
|
const tracks = trackConfigs.map(({ adapter, textSearching, trackId }) => ({
|
|
119
119
|
trackId,
|
|
120
|
-
attributesIndexed:
|
|
121
|
-
excludedTypes:
|
|
120
|
+
attributesIndexed: textSearching?.indexingAttributes || attributes,
|
|
121
|
+
excludedTypes: textSearching?.indexingFeatureTypesToExclude || typesToExclude,
|
|
122
122
|
adapterConf: adapter,
|
|
123
123
|
}));
|
|
124
124
|
fs_1.default.writeFileSync(path_1.default.join(outLocation, 'trix', `${name}_meta.json`), JSON.stringify({
|