@jbrowse/plugin-legacy-jbrowse 1.5.0 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin-legacy-jbrowse.cjs.development.js +100 -70
- package/dist/plugin-legacy-jbrowse.cjs.development.js.map +1 -1
- package/dist/plugin-legacy-jbrowse.cjs.production.min.js +1 -1
- package/dist/plugin-legacy-jbrowse.cjs.production.min.js.map +1 -1
- package/dist/plugin-legacy-jbrowse.esm.js +100 -70
- package/dist/plugin-legacy-jbrowse.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/JBrowse1Connection/jb1ConfigLoad.ts +0 -3
- package/src/JBrowse1Connection/jb1ToJb2.ts +2 -2
- package/src/NCListAdapter/NCListFeature.ts +1 -5
- package/src/index.ts +23 -0
|
@@ -12,30 +12,74 @@ var configuration = require('@jbrowse/core/configuration');
|
|
|
12
12
|
var BaseAdapter = require('@jbrowse/core/data_adapters/BaseAdapter');
|
|
13
13
|
var BaseResult = _interopDefault(require('@jbrowse/core/TextSearch/BaseResults'));
|
|
14
14
|
var crc32 = _interopDefault(require('buffer-crc32'));
|
|
15
|
+
var tracks = require('@jbrowse/core/util/tracks');
|
|
15
16
|
var util = require('@jbrowse/core/util');
|
|
16
17
|
var models = require('@jbrowse/core/pluggableElementTypes/models');
|
|
17
18
|
var mobxStateTree = require('mobx-state-tree');
|
|
18
19
|
var io = require('@jbrowse/core/util/io');
|
|
19
20
|
var getValue = _interopDefault(require('get-value'));
|
|
20
21
|
var setValue = _interopDefault(require('set-value'));
|
|
21
|
-
var tracks = require('@jbrowse/core/util/tracks');
|
|
22
22
|
var NCListStore = _interopDefault(require('@gmod/nclist'));
|
|
23
23
|
var rxjs = require('@jbrowse/core/util/rxjs');
|
|
24
24
|
var genericFilehandle = require('generic-filehandle');
|
|
25
25
|
|
|
26
|
+
function _asyncIterator(iterable) {
|
|
27
|
+
var method,
|
|
28
|
+
async,
|
|
29
|
+
sync,
|
|
30
|
+
retry = 2;
|
|
31
|
+
|
|
32
|
+
for ("undefined" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) {
|
|
33
|
+
if (async && null != (method = iterable[async])) return method.call(iterable);
|
|
34
|
+
if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable));
|
|
35
|
+
async = "@@asyncIterator", sync = "@@iterator";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
throw new TypeError("Object is not async iterable");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function AsyncFromSyncIterator(s) {
|
|
42
|
+
function AsyncFromSyncIteratorContinuation(r) {
|
|
43
|
+
if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
|
|
44
|
+
var done = r.done;
|
|
45
|
+
return Promise.resolve(r.value).then(function (value) {
|
|
46
|
+
return {
|
|
47
|
+
value: value,
|
|
48
|
+
done: done
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return AsyncFromSyncIterator = function (s) {
|
|
54
|
+
this.s = s, this.n = s.next;
|
|
55
|
+
}, AsyncFromSyncIterator.prototype = {
|
|
56
|
+
s: null,
|
|
57
|
+
n: null,
|
|
58
|
+
next: function () {
|
|
59
|
+
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
60
|
+
},
|
|
61
|
+
return: function (value) {
|
|
62
|
+
var ret = this.s.return;
|
|
63
|
+
return void 0 === ret ? Promise.resolve({
|
|
64
|
+
value: value,
|
|
65
|
+
done: !0
|
|
66
|
+
}) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
|
|
67
|
+
},
|
|
68
|
+
throw: function (value) {
|
|
69
|
+
var thr = this.s.return;
|
|
70
|
+
return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
|
|
71
|
+
}
|
|
72
|
+
}, new AsyncFromSyncIterator(s);
|
|
73
|
+
}
|
|
74
|
+
|
|
26
75
|
function ownKeys(object, enumerableOnly) {
|
|
27
76
|
var keys = Object.keys(object);
|
|
28
77
|
|
|
29
78
|
if (Object.getOwnPropertySymbols) {
|
|
30
79
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
keys.push.apply(keys, symbols);
|
|
80
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
81
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
82
|
+
})), keys.push.apply(keys, symbols);
|
|
39
83
|
}
|
|
40
84
|
|
|
41
85
|
return keys;
|
|
@@ -43,19 +87,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
43
87
|
|
|
44
88
|
function _objectSpread2(target) {
|
|
45
89
|
for (var i = 1; i < arguments.length; i++) {
|
|
46
|
-
var source = arguments[i]
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
53
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
54
|
-
} else {
|
|
55
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
56
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
57
|
-
});
|
|
58
|
-
}
|
|
90
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
91
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
92
|
+
_defineProperty(target, key, source[key]);
|
|
93
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
94
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
95
|
+
});
|
|
59
96
|
}
|
|
60
97
|
|
|
61
98
|
return target;
|
|
@@ -64,31 +101,11 @@ function _objectSpread2(target) {
|
|
|
64
101
|
function _typeof(obj) {
|
|
65
102
|
"@babel/helpers - typeof";
|
|
66
103
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
_typeof = function (obj) {
|
|
73
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return _typeof(obj);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function _asyncIterator(iterable) {
|
|
81
|
-
var method;
|
|
82
|
-
|
|
83
|
-
if (typeof Symbol !== "undefined") {
|
|
84
|
-
if (Symbol.asyncIterator) method = iterable[Symbol.asyncIterator];
|
|
85
|
-
if (method == null && Symbol.iterator) method = iterable[Symbol.iterator];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (method == null) method = iterable["@@asyncIterator"];
|
|
89
|
-
if (method == null) method = iterable["@@iterator"];
|
|
90
|
-
if (method == null) throw new TypeError("Object is not async iterable");
|
|
91
|
-
return method.call(iterable);
|
|
104
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
105
|
+
return typeof obj;
|
|
106
|
+
} : function (obj) {
|
|
107
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
108
|
+
}, _typeof(obj);
|
|
92
109
|
}
|
|
93
110
|
|
|
94
111
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -146,6 +163,9 @@ function _defineProperties(target, props) {
|
|
|
146
163
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
147
164
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
148
165
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
166
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
167
|
+
writable: false
|
|
168
|
+
});
|
|
149
169
|
return Constructor;
|
|
150
170
|
}
|
|
151
171
|
|
|
@@ -169,12 +189,15 @@ function _inherits(subClass, superClass) {
|
|
|
169
189
|
throw new TypeError("Super expression must either be null or a function");
|
|
170
190
|
}
|
|
171
191
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
192
|
+
Object.defineProperty(subClass, "prototype", {
|
|
193
|
+
value: Object.create(superClass && superClass.prototype, {
|
|
194
|
+
constructor: {
|
|
195
|
+
value: subClass,
|
|
196
|
+
writable: true,
|
|
197
|
+
configurable: true
|
|
198
|
+
}
|
|
199
|
+
}),
|
|
200
|
+
writable: false
|
|
178
201
|
});
|
|
179
202
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
180
203
|
}
|
|
@@ -1722,7 +1745,8 @@ function mixin(dest, source, copyFunc) {
|
|
|
1722
1745
|
// toString() method that source inherited from Object.prototype
|
|
1723
1746
|
s = source[name];
|
|
1724
1747
|
|
|
1725
|
-
if (!(name in dest) ||
|
|
1748
|
+
if (!(name in dest) || // @ts-ignore
|
|
1749
|
+
dest[name] !== s && (!(name in empty) || empty[name] !== s)) {
|
|
1726
1750
|
dest[name] = copyFunc ? copyFunc(s) : s;
|
|
1727
1751
|
}
|
|
1728
1752
|
}
|
|
@@ -2369,33 +2393,25 @@ function _fetchConfigFile() {
|
|
|
2369
2393
|
case 2:
|
|
2370
2394
|
result = _context3.sent;
|
|
2371
2395
|
|
|
2372
|
-
if (!(typeof result !== 'string')) {
|
|
2373
|
-
_context3.next = 5;
|
|
2374
|
-
break;
|
|
2375
|
-
}
|
|
2376
|
-
|
|
2377
|
-
throw new Error("Error opening location: ".concat(location));
|
|
2378
|
-
|
|
2379
|
-
case 5:
|
|
2380
2396
|
if (!isUriLocation(location)) {
|
|
2381
|
-
_context3.next =
|
|
2397
|
+
_context3.next = 5;
|
|
2382
2398
|
break;
|
|
2383
2399
|
}
|
|
2384
2400
|
|
|
2385
2401
|
return _context3.abrupt("return", parseJb1(result, location.uri));
|
|
2386
2402
|
|
|
2387
|
-
case
|
|
2403
|
+
case 5:
|
|
2388
2404
|
if (!isLocalPathLocation(location)) {
|
|
2389
|
-
_context3.next =
|
|
2405
|
+
_context3.next = 7;
|
|
2390
2406
|
break;
|
|
2391
2407
|
}
|
|
2392
2408
|
|
|
2393
2409
|
return _context3.abrupt("return", parseJb1(result, location.localPath));
|
|
2394
2410
|
|
|
2395
|
-
case
|
|
2411
|
+
case 7:
|
|
2396
2412
|
return _context3.abrupt("return", parseJb1(result));
|
|
2397
2413
|
|
|
2398
|
-
case
|
|
2414
|
+
case 8:
|
|
2399
2415
|
case "end":
|
|
2400
2416
|
return _context3.stop();
|
|
2401
2417
|
}
|
|
@@ -3082,9 +3098,7 @@ function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
|
|
|
3082
3098
|
jb2TrackConfig.adapter = tracks.guessAdapter({
|
|
3083
3099
|
uri: urlTemplate,
|
|
3084
3100
|
locationType: 'UriLocation'
|
|
3085
|
-
}, undefined,
|
|
3086
|
-
return urlTemplate;
|
|
3087
|
-
});
|
|
3101
|
+
}, undefined, urlTemplate);
|
|
3088
3102
|
|
|
3089
3103
|
if (!jb2TrackConfig.adapter) {
|
|
3090
3104
|
throw new Error('Could not determine adapter');
|
|
@@ -3192,6 +3206,22 @@ var LegacyJBrowsePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
3192
3206
|
}
|
|
3193
3207
|
});
|
|
3194
3208
|
});
|
|
3209
|
+
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', function (adapterGuesser) {
|
|
3210
|
+
return function (file, index, adapterHint) {
|
|
3211
|
+
var regexGuess = /trackData.jsonz?$/i;
|
|
3212
|
+
var adapterName = 'NCListAdapter';
|
|
3213
|
+
var fileName = tracks.getFileName(file);
|
|
3214
|
+
|
|
3215
|
+
if (regexGuess.test(fileName) || adapterHint === adapterName) {
|
|
3216
|
+
return {
|
|
3217
|
+
type: adapterName,
|
|
3218
|
+
rootUrlTemplate: file
|
|
3219
|
+
};
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
return adapterGuesser(file, index, adapterHint);
|
|
3223
|
+
};
|
|
3224
|
+
});
|
|
3195
3225
|
pluginManager.addTextSearchAdapterType(function () {
|
|
3196
3226
|
return new TextSearchAdapterType({
|
|
3197
3227
|
name: 'JBrowse1TextSearchAdapter',
|