@jbrowse/plugin-legacy-jbrowse 1.7.9 → 2.0.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/dist/JBrowse1Connection/configSchema.js +18 -28
- package/dist/JBrowse1Connection/configSchema.js.map +1 -0
- package/dist/JBrowse1Connection/index.js +10 -22
- package/dist/JBrowse1Connection/index.js.map +1 -0
- package/dist/JBrowse1Connection/jb1ConfigLoad.js +387 -501
- package/dist/JBrowse1Connection/jb1ConfigLoad.js.map +1 -0
- package/dist/JBrowse1Connection/jb1ConfigParse.js +414 -435
- package/dist/JBrowse1Connection/jb1ConfigParse.js.map +1 -0
- package/dist/JBrowse1Connection/jb1ToJb2.js +405 -546
- package/dist/JBrowse1Connection/jb1ToJb2.js.map +1 -0
- package/dist/JBrowse1Connection/model.js +49 -57
- package/dist/JBrowse1Connection/model.js.map +1 -0
- package/dist/JBrowse1Connection/types.js +2 -4
- package/dist/JBrowse1Connection/types.js.map +1 -0
- package/dist/JBrowse1Connection/util.js +123 -130
- package/dist/JBrowse1Connection/util.js.map +1 -0
- package/dist/JBrowse1TextSeachAdapter/HttpMap.js +181 -326
- package/dist/JBrowse1TextSeachAdapter/HttpMap.js.map +1 -0
- package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js +164 -185
- package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js.map +1 -0
- package/dist/JBrowse1TextSeachAdapter/configSchema.js +20 -33
- package/dist/JBrowse1TextSeachAdapter/configSchema.js.map +1 -0
- package/dist/JBrowse1TextSeachAdapter/index.js +10 -22
- package/dist/JBrowse1TextSeachAdapter/index.js.map +1 -0
- package/dist/NCListAdapter/NCListAdapter.js +164 -224
- package/dist/NCListAdapter/NCListAdapter.js.map +1 -0
- package/dist/NCListAdapter/NCListFeature.js +68 -125
- package/dist/NCListAdapter/NCListFeature.js.map +1 -0
- package/dist/NCListAdapter/configSchema.js +17 -26
- package/dist/NCListAdapter/configSchema.js.map +1 -0
- package/dist/NCListAdapter/index.js +8 -14
- package/dist/NCListAdapter/index.js.map +1 -0
- package/dist/index.js +97 -116
- package/dist/index.js.map +1 -0
- package/esm/JBrowse1Connection/configSchema.d.ts +2 -0
- package/esm/JBrowse1Connection/configSchema.js +18 -0
- package/esm/JBrowse1Connection/configSchema.js.map +1 -0
- package/esm/JBrowse1Connection/index.d.ts +2 -0
- package/esm/JBrowse1Connection/index.js +3 -0
- package/esm/JBrowse1Connection/index.js.map +1 -0
- package/esm/JBrowse1Connection/jb1ConfigLoad.d.ts +36 -0
- package/esm/JBrowse1Connection/jb1ConfigLoad.js +281 -0
- package/esm/JBrowse1Connection/jb1ConfigLoad.js.map +1 -0
- package/esm/JBrowse1Connection/jb1ConfigParse.d.ts +11 -0
- package/esm/JBrowse1Connection/jb1ConfigParse.js +377 -0
- package/esm/JBrowse1Connection/jb1ConfigParse.js.map +1 -0
- package/esm/JBrowse1Connection/jb1ToJb2.d.ts +49 -0
- package/esm/JBrowse1Connection/jb1ToJb2.js +424 -0
- package/esm/JBrowse1Connection/jb1ToJb2.js.map +1 -0
- package/esm/JBrowse1Connection/model.d.ts +15 -0
- package/esm/JBrowse1Connection/model.js +44 -0
- package/esm/JBrowse1Connection/model.js.map +1 -0
- package/esm/JBrowse1Connection/types.d.ts +91 -0
- package/esm/JBrowse1Connection/types.js +2 -0
- package/esm/JBrowse1Connection/types.js.map +1 -0
- package/esm/JBrowse1Connection/util.d.ts +26 -0
- package/esm/JBrowse1Connection/util.js +136 -0
- package/esm/JBrowse1Connection/util.js.map +1 -0
- package/esm/JBrowse1TextSeachAdapter/HttpMap.d.ts +39 -0
- package/esm/JBrowse1TextSeachAdapter/HttpMap.js +89 -0
- package/esm/JBrowse1TextSeachAdapter/HttpMap.js.map +1 -0
- package/esm/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.d.ts +33 -0
- package/esm/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js +67 -0
- package/esm/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.js.map +1 -0
- package/esm/JBrowse1TextSeachAdapter/configSchema.d.ts +2 -0
- package/esm/JBrowse1TextSeachAdapter/configSchema.js +20 -0
- package/esm/JBrowse1TextSeachAdapter/configSchema.js.map +1 -0
- package/esm/JBrowse1TextSeachAdapter/index.d.ts +2 -0
- package/esm/JBrowse1TextSeachAdapter/index.js +3 -0
- package/esm/JBrowse1TextSeachAdapter/index.js.map +1 -0
- package/esm/NCListAdapter/NCListAdapter.d.ts +31 -0
- package/esm/NCListAdapter/NCListAdapter.js +62 -0
- package/esm/NCListAdapter/NCListAdapter.js.map +1 -0
- package/esm/NCListAdapter/NCListFeature.d.ts +31 -0
- package/esm/NCListAdapter/NCListFeature.js +78 -0
- package/esm/NCListAdapter/NCListFeature.js.map +1 -0
- package/esm/NCListAdapter/configSchema.d.ts +2 -0
- package/esm/NCListAdapter/configSchema.js +16 -0
- package/esm/NCListAdapter/configSchema.js.map +1 -0
- package/esm/NCListAdapter/index.d.ts +1 -0
- package/esm/NCListAdapter/index.js +2 -0
- package/esm/NCListAdapter/index.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +50 -0
- package/esm/index.js.map +1 -0
- package/package.json +15 -6
- package/dist/JBrowse1TextSeachAdapter/HttpMap.test.js +0 -118
- package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.test.js +0 -98
- package/dist/NCListAdapter/NCListAdapter.test.js +0 -108
- package/dist/declare.d.js +0 -1
- package/dist/index.test.js +0 -44
|
@@ -1,574 +1,433 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.convertTrackConfig = convertTrackConfig;
|
|
9
|
-
exports.createRefSeqsAdapter = createRefSeqsAdapter;
|
|
10
|
-
|
|
11
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
|
-
|
|
13
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
-
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
|
|
17
|
-
var _io = require("@jbrowse/core/util/io");
|
|
18
|
-
|
|
19
|
-
var _util = require("@jbrowse/core/util");
|
|
20
|
-
|
|
21
|
-
var _tracks = require("@jbrowse/core/util/tracks");
|
|
22
|
-
|
|
23
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
|
-
|
|
25
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
|
-
|
|
27
|
-
function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
|
|
28
|
-
var jb2TrackConfig = {
|
|
29
|
-
trackId: (0, _util.objectHash)(jb1TrackConfig),
|
|
30
|
-
name: jb1TrackConfig.key || jb1TrackConfig.label
|
|
31
|
-
};
|
|
32
|
-
var description = jb1TrackConfig.metadata && (jb1TrackConfig.metadata.description || jb1TrackConfig.metadata.Description);
|
|
33
|
-
|
|
34
|
-
if (description) {
|
|
35
|
-
jb2TrackConfig.description = description;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var category = jb1TrackConfig.category || jb1TrackConfig.metadata && jb1TrackConfig.metadata.category;
|
|
39
|
-
jb2TrackConfig.category = category ? category.split(/\s*\/\s*/) : [];
|
|
40
|
-
var storeClass = jb1TrackConfig.storeClass;
|
|
41
|
-
|
|
42
|
-
if (!jb1TrackConfig.urlTemplate) {
|
|
43
|
-
if (!(storeClass && storeClass.endsWith('FromConfig'))) {
|
|
44
|
-
var trackIdentifier = jb1TrackConfig.key || jb1TrackConfig.label;
|
|
45
|
-
console.warn("Could not import JBrowse1 track \"".concat(trackIdentifier, "\" because it does not have a \"urlTemplate\" or is not a \"FromConfig\" track"));
|
|
46
|
-
return (0, _tracks.generateUnsupportedTrackConf)(jb2TrackConfig.name, trackIdentifier, jb2TrackConfig.category);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return generateFromConfigTrackConfig(jb1TrackConfig, jb2TrackConfig);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var resolveUrlTemplate = function resolveUrlTemplate(urlTemplate) {
|
|
53
|
-
return new URL(urlTemplate, "".concat(dataRoot, "/")).href.replace(/%7B/gi, '{').replace(/%7D/gi, '}');
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var urlTemplate = resolveUrlTemplate(jb1TrackConfig.urlTemplate);
|
|
57
|
-
|
|
58
|
-
if (storeClass) {
|
|
59
|
-
if (storeClass === 'JBrowse/Store/SeqFeature/BAM') {
|
|
60
|
-
var adapter = {
|
|
61
|
-
type: 'BamAdapter',
|
|
62
|
-
bamLocation: {
|
|
63
|
-
uri: urlTemplate,
|
|
64
|
-
locationType: 'UriLocation'
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
65
8
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
96
47
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
};
|
|
113
|
-
} else {
|
|
114
|
-
_adapter.craiLocation = {
|
|
115
|
-
uri: "".concat(urlTemplate, ".crai"),
|
|
116
|
-
locationType: 'UriLocation'
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return _objectSpread(_objectSpread({}, jb2TrackConfig), {}, {
|
|
121
|
-
type: 'AlignmentsTrack',
|
|
122
|
-
adapter: _adapter
|
|
123
|
-
});
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.createRefSeqsAdapter = exports.convertTrackConfig = void 0;
|
|
51
|
+
var io_1 = require("@jbrowse/core/util/io");
|
|
52
|
+
var util_1 = require("@jbrowse/core/util");
|
|
53
|
+
var tracks_1 = require("@jbrowse/core/util/tracks");
|
|
54
|
+
function convertTrackConfig(jb1TrackConfig, dataRoot, sequenceAdapter) {
|
|
55
|
+
var jb2TrackConfig = {
|
|
56
|
+
trackId: (0, util_1.objectHash)(jb1TrackConfig),
|
|
57
|
+
name: jb1TrackConfig.key || jb1TrackConfig.label,
|
|
58
|
+
};
|
|
59
|
+
var description = jb1TrackConfig.metadata &&
|
|
60
|
+
(jb1TrackConfig.metadata.description || jb1TrackConfig.metadata.Description);
|
|
61
|
+
if (description) {
|
|
62
|
+
jb2TrackConfig.description = description;
|
|
124
63
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
64
|
+
var category = jb1TrackConfig.category ||
|
|
65
|
+
(jb1TrackConfig.metadata && jb1TrackConfig.metadata.category);
|
|
66
|
+
jb2TrackConfig.category = category ? category.split(/\s*\/\s*/) : [];
|
|
67
|
+
var storeClass = jb1TrackConfig.storeClass;
|
|
68
|
+
if (!jb1TrackConfig.urlTemplate) {
|
|
69
|
+
if (!(storeClass && storeClass.endsWith('FromConfig'))) {
|
|
70
|
+
var trackIdentifier = jb1TrackConfig.key || jb1TrackConfig.label;
|
|
71
|
+
console.warn("Could not import JBrowse1 track \"".concat(trackIdentifier, "\" because it does not have a \"urlTemplate\" or is not a \"FromConfig\" track"));
|
|
72
|
+
return (0, tracks_1.generateUnsupportedTrackConf)(jb2TrackConfig.name, trackIdentifier, jb2TrackConfig.category);
|
|
135
73
|
}
|
|
136
|
-
|
|
74
|
+
return generateFromConfigTrackConfig(jb1TrackConfig, jb2TrackConfig);
|
|
137
75
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
76
|
+
var resolveUrlTemplate = function (urlTemplate) {
|
|
77
|
+
return new URL(urlTemplate, "".concat(dataRoot, "/")).href
|
|
78
|
+
.replace(/%7B/gi, '{')
|
|
79
|
+
.replace(/%7D/gi, '}');
|
|
80
|
+
};
|
|
81
|
+
var urlTemplate = resolveUrlTemplate(jb1TrackConfig.urlTemplate);
|
|
82
|
+
if (storeClass) {
|
|
83
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/BAM') {
|
|
84
|
+
var adapter = {
|
|
85
|
+
type: 'BamAdapter',
|
|
86
|
+
bamLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
87
|
+
};
|
|
88
|
+
if (jb1TrackConfig.baiUrlTemplate) {
|
|
89
|
+
adapter.index = {
|
|
90
|
+
location: {
|
|
91
|
+
uri: resolveUrlTemplate(jb1TrackConfig.baiUrlTemplate),
|
|
92
|
+
locationType: 'UriLocation',
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
else if (jb1TrackConfig.csiUrlTemplate) {
|
|
97
|
+
adapter.index = {
|
|
98
|
+
location: {
|
|
99
|
+
uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),
|
|
100
|
+
locationType: 'UriLocation',
|
|
101
|
+
},
|
|
102
|
+
indexType: 'CSI',
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
adapter.index = {
|
|
107
|
+
location: { uri: "".concat(urlTemplate, ".bai"), locationType: 'UriLocation' },
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'AlignmentsTrack', adapter: adapter });
|
|
154
111
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
112
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/CRAM') {
|
|
113
|
+
var adapter = {
|
|
114
|
+
type: 'CramAdapter',
|
|
115
|
+
cramLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
116
|
+
sequenceAdapter: sequenceAdapter,
|
|
117
|
+
};
|
|
118
|
+
if (jb1TrackConfig.craiUrlTemplate) {
|
|
119
|
+
adapter.craiLocation = {
|
|
120
|
+
uri: resolveUrlTemplate(jb1TrackConfig.craiUrlTemplate),
|
|
121
|
+
locationType: 'UriLocation',
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
adapter.craiLocation = {
|
|
126
|
+
uri: "".concat(urlTemplate, ".crai"),
|
|
127
|
+
locationType: 'UriLocation',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'AlignmentsTrack', adapter: adapter });
|
|
164
131
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
uri: resolveUrlTemplate(jb1TrackConfig.tbiUrlTemplate),
|
|
171
|
-
locationType: 'UriLocation'
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
} else if (jb1TrackConfig.csiUrlTemplate) {
|
|
175
|
-
_adapter2.index = {
|
|
176
|
-
location: {
|
|
177
|
-
uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),
|
|
178
|
-
locationType: 'UriLocation'
|
|
179
|
-
},
|
|
180
|
-
indexType: 'CSI'
|
|
181
|
-
};
|
|
182
|
-
} else {
|
|
183
|
-
_adapter2.index = {
|
|
184
|
-
location: {
|
|
185
|
-
uri: "".concat(urlTemplate, ".tbi"),
|
|
186
|
-
locationType: 'UriLocation'
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return _objectSpread(_objectSpread({}, jb2TrackConfig), {}, {
|
|
192
|
-
type: 'VariantTrack',
|
|
193
|
-
adapter: _adapter2
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (storeClass === 'JBrowse/Store/SeqFeature/VCFTribble') {
|
|
198
|
-
return (0, _tracks.generateUnsupportedTrackConf)(jb2TrackConfig.name, "VCFTribble (".concat(urlTemplate, ")"), jb2TrackConfig.category);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (storeClass === 'JBrowse/Store/SeqFeature/GFF3') {
|
|
202
|
-
return _objectSpread(_objectSpread({}, jb2TrackConfig), {}, {
|
|
203
|
-
type: 'FeatureTrack',
|
|
204
|
-
adapter: {
|
|
205
|
-
type: 'Gff3Adapter',
|
|
206
|
-
gffLocation: {
|
|
207
|
-
uri: urlTemplate,
|
|
208
|
-
locationType: 'UriLocation'
|
|
209
|
-
}
|
|
132
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/NCList') {
|
|
133
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'FeatureTrack', adapter: {
|
|
134
|
+
type: 'NCListAdapter',
|
|
135
|
+
rootUrlTemplate: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
136
|
+
} });
|
|
210
137
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
138
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/BigWig' ||
|
|
139
|
+
storeClass === 'JBrowse/Store/BigWig') {
|
|
140
|
+
if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('XYPlot')) {
|
|
141
|
+
jb2TrackConfig.defaultRendering = 'xyplot';
|
|
142
|
+
}
|
|
143
|
+
else if (jb1TrackConfig.type &&
|
|
144
|
+
jb1TrackConfig.type.endsWith('Density')) {
|
|
145
|
+
jb2TrackConfig.defaultRendering = 'density';
|
|
146
|
+
}
|
|
147
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'QuantitativeTrack', adapter: {
|
|
148
|
+
type: 'BigWigAdapter',
|
|
149
|
+
bigWigLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
150
|
+
} });
|
|
223
151
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
152
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/VCFTabix') {
|
|
153
|
+
var adapter = {
|
|
154
|
+
type: 'VcfTabixAdapter',
|
|
155
|
+
vcfGzLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
156
|
+
};
|
|
157
|
+
if (jb1TrackConfig.tbiUrlTemplate) {
|
|
158
|
+
adapter.index = {
|
|
159
|
+
location: {
|
|
160
|
+
uri: resolveUrlTemplate(jb1TrackConfig.tbiUrlTemplate),
|
|
161
|
+
locationType: 'UriLocation',
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
else if (jb1TrackConfig.csiUrlTemplate) {
|
|
166
|
+
adapter.index = {
|
|
167
|
+
location: {
|
|
168
|
+
uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),
|
|
169
|
+
locationType: 'UriLocation',
|
|
170
|
+
},
|
|
171
|
+
indexType: 'CSI',
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
adapter.index = {
|
|
176
|
+
location: { uri: "".concat(urlTemplate, ".tbi"), locationType: 'UriLocation' },
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'VariantTrack', adapter: adapter });
|
|
233
180
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if (jb1TrackConfig.tbiUrlTemplate) {
|
|
237
|
-
_adapter3.index = {
|
|
238
|
-
location: {
|
|
239
|
-
uri: resolveUrlTemplate(jb1TrackConfig.tbiUrlTemplate),
|
|
240
|
-
locationType: 'UriLocation'
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
} else if (jb1TrackConfig.csiUrlTemplate) {
|
|
244
|
-
_adapter3.index = {
|
|
245
|
-
location: {
|
|
246
|
-
uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),
|
|
247
|
-
locationType: 'UriLocation'
|
|
248
|
-
},
|
|
249
|
-
indexType: 'CSI'
|
|
250
|
-
};
|
|
251
|
-
} else {
|
|
252
|
-
_adapter3.index = {
|
|
253
|
-
location: {
|
|
254
|
-
uri: "".concat(urlTemplate, ".tbi"),
|
|
255
|
-
locationType: 'UriLocation'
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return _objectSpread(_objectSpread({}, jb2TrackConfig), {}, {
|
|
261
|
-
type: 'FeatureTrack',
|
|
262
|
-
adapter: _adapter3
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (storeClass === 'JBrowse/Store/SeqFeature/BED') {
|
|
267
|
-
return (0, _tracks.generateUnsupportedTrackConf)(jb2TrackConfig.name, "BED (".concat(urlTemplate, ")"), jb2TrackConfig.category);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
if (storeClass === 'JBrowse/Store/SeqFeature/BEDTabix') {
|
|
271
|
-
var _adapter4 = {
|
|
272
|
-
type: 'BedTabixAdapter',
|
|
273
|
-
bedGzLocation: {
|
|
274
|
-
uri: urlTemplate,
|
|
275
|
-
locationType: 'UriLocation'
|
|
181
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/VCFTribble') {
|
|
182
|
+
return (0, tracks_1.generateUnsupportedTrackConf)(jb2TrackConfig.name, "VCFTribble (".concat(urlTemplate, ")"), jb2TrackConfig.category);
|
|
276
183
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
184
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/GFF3') {
|
|
185
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'FeatureTrack', adapter: {
|
|
186
|
+
type: 'Gff3Adapter',
|
|
187
|
+
gffLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
188
|
+
} });
|
|
189
|
+
}
|
|
190
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/BigBed') {
|
|
191
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'FeatureTrack', adapter: {
|
|
192
|
+
type: 'BigBedAdapter',
|
|
193
|
+
bigBedLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
194
|
+
} });
|
|
195
|
+
}
|
|
196
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/GFF3Tabix') {
|
|
197
|
+
var adapter = {
|
|
198
|
+
type: 'Gff3TabixAdapter',
|
|
199
|
+
gffGzLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
200
|
+
};
|
|
201
|
+
if (jb1TrackConfig.tbiUrlTemplate) {
|
|
202
|
+
adapter.index = {
|
|
203
|
+
location: {
|
|
204
|
+
uri: resolveUrlTemplate(jb1TrackConfig.tbiUrlTemplate),
|
|
205
|
+
locationType: 'UriLocation',
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
else if (jb1TrackConfig.csiUrlTemplate) {
|
|
210
|
+
adapter.index = {
|
|
211
|
+
location: {
|
|
212
|
+
uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),
|
|
213
|
+
locationType: 'UriLocation',
|
|
214
|
+
},
|
|
215
|
+
indexType: 'CSI',
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
adapter.index = {
|
|
220
|
+
location: { uri: "".concat(urlTemplate, ".tbi"), locationType: 'UriLocation' },
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'FeatureTrack', adapter: adapter });
|
|
224
|
+
}
|
|
225
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/BED') {
|
|
226
|
+
return (0, tracks_1.generateUnsupportedTrackConf)(jb2TrackConfig.name, "BED (".concat(urlTemplate, ")"), jb2TrackConfig.category);
|
|
227
|
+
}
|
|
228
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/BEDTabix') {
|
|
229
|
+
var adapter = {
|
|
230
|
+
type: 'BedTabixAdapter',
|
|
231
|
+
bedGzLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
232
|
+
};
|
|
233
|
+
if (jb1TrackConfig.tbiUrlTemplate) {
|
|
234
|
+
adapter.index = {
|
|
235
|
+
location: {
|
|
236
|
+
uri: resolveUrlTemplate(jb1TrackConfig.tbiUrlTemplate),
|
|
237
|
+
locationType: 'UriLocation',
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
else if (jb1TrackConfig.csiUrlTemplate) {
|
|
242
|
+
adapter.index = {
|
|
243
|
+
location: {
|
|
244
|
+
uri: resolveUrlTemplate(jb1TrackConfig.csiUrlTemplate),
|
|
245
|
+
locationType: 'UriLocation',
|
|
246
|
+
},
|
|
247
|
+
indexType: 'CSI',
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
adapter.index = {
|
|
252
|
+
location: { uri: "".concat(urlTemplate, ".tbi"), locationType: 'UriLocation' },
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'FeatureTrack', adapter: adapter });
|
|
256
|
+
}
|
|
257
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/GTF') {
|
|
258
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'FeatureTrack', adapter: {
|
|
259
|
+
type: 'GtfAdapter',
|
|
260
|
+
gtfLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
261
|
+
} });
|
|
262
|
+
}
|
|
263
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/StaticChunked' ||
|
|
264
|
+
storeClass === 'JBrowse/Store/Sequence/StaticChunked') {
|
|
265
|
+
return (0, tracks_1.generateUnsupportedTrackConf)(jb2TrackConfig.name, "StaticChunked (".concat(urlTemplate, ")"), jb2TrackConfig.category);
|
|
266
|
+
}
|
|
267
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/UnindexedFasta') {
|
|
268
|
+
return (0, tracks_1.generateUnsupportedTrackConf)(jb2TrackConfig.name, "UnindexedFasta (".concat(urlTemplate, ")"), jb2TrackConfig.category);
|
|
269
|
+
}
|
|
270
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/IndexedFasta') {
|
|
271
|
+
var adapter = {
|
|
272
|
+
type: 'IndexedFastaAdapter',
|
|
273
|
+
fastaLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
274
|
+
};
|
|
275
|
+
if (jb1TrackConfig.faiUrlTemplate) {
|
|
276
|
+
adapter.faiLocation = {
|
|
277
|
+
uri: resolveUrlTemplate(jb1TrackConfig.faiUrlTemplate),
|
|
278
|
+
locationType: 'UriLocation',
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
adapter.faiLocation = {
|
|
283
|
+
uri: "".concat(urlTemplate, ".fai"),
|
|
284
|
+
locationType: 'UriLocation',
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'SequenceTrack', adapter: adapter });
|
|
288
|
+
}
|
|
289
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/BgzipIndexedFasta') {
|
|
290
|
+
var adapter = {
|
|
291
|
+
type: 'BgzipFastaAdapter',
|
|
292
|
+
fastaLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
293
|
+
};
|
|
294
|
+
if (jb1TrackConfig.faiUrlTemplate) {
|
|
295
|
+
adapter.faiLocation = {
|
|
296
|
+
uri: resolveUrlTemplate(jb1TrackConfig.faiUrlTemplate),
|
|
297
|
+
locationType: 'UriLocation',
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
adapter.faiLocation = {
|
|
302
|
+
uri: "".concat(urlTemplate, ".fai"),
|
|
303
|
+
locationType: 'UriLocation',
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
if (jb1TrackConfig.gziUrlTemplate) {
|
|
307
|
+
adapter.gziLocation = {
|
|
308
|
+
uri: resolveUrlTemplate(jb1TrackConfig.gziUrlTemplate),
|
|
309
|
+
locationType: 'UriLocation',
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
adapter.gziLocation = {
|
|
314
|
+
uri: "".concat(urlTemplate, ".gzi"),
|
|
315
|
+
locationType: 'UriLocation',
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'ReferenceSequenceTrack', adapter: adapter });
|
|
319
|
+
}
|
|
320
|
+
if (storeClass === 'JBrowse/Store/SeqFeature/TwoBit') {
|
|
321
|
+
return __assign(__assign({}, jb2TrackConfig), { type: 'ReferenceSequenceTrack', adapter: {
|
|
322
|
+
type: 'TwoBitAdapter',
|
|
323
|
+
twoBitLocation: { uri: urlTemplate, locationType: 'UriLocation' },
|
|
324
|
+
} });
|
|
318
325
|
}
|
|
319
|
-
});
|
|
320
326
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
327
|
+
// If we don't recogize the store class, make a best effort to guess by file type
|
|
328
|
+
jb2TrackConfig.adapter = (0, tracks_1.guessAdapter)({ uri: urlTemplate, locationType: 'UriLocation' }, undefined, urlTemplate);
|
|
329
|
+
if (!jb2TrackConfig.adapter) {
|
|
330
|
+
throw new Error('Could not determine adapter');
|
|
324
331
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return (0, _tracks.generateUnsupportedTrackConf)(jb2TrackConfig.name, "UnindexedFasta (".concat(urlTemplate, ")"), jb2TrackConfig.category);
|
|
332
|
+
if (jb2TrackConfig.adapter.type === tracks_1.UNSUPPORTED) {
|
|
333
|
+
return (0, tracks_1.generateUnsupportedTrackConf)(jb2TrackConfig.name, urlTemplate, jb2TrackConfig.category);
|
|
328
334
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
var _adapter5 = {
|
|
332
|
-
type: 'IndexedFastaAdapter',
|
|
333
|
-
fastaLocation: {
|
|
334
|
-
uri: urlTemplate,
|
|
335
|
-
locationType: 'UriLocation'
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
if (jb1TrackConfig.faiUrlTemplate) {
|
|
340
|
-
_adapter5.faiLocation = {
|
|
341
|
-
uri: resolveUrlTemplate(jb1TrackConfig.faiUrlTemplate),
|
|
342
|
-
locationType: 'UriLocation'
|
|
343
|
-
};
|
|
344
|
-
} else {
|
|
345
|
-
_adapter5.faiLocation = {
|
|
346
|
-
uri: "".concat(urlTemplate, ".fai"),
|
|
347
|
-
locationType: 'UriLocation'
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
return _objectSpread(_objectSpread({}, jb2TrackConfig), {}, {
|
|
352
|
-
type: 'SequenceTrack',
|
|
353
|
-
adapter: _adapter5
|
|
354
|
-
});
|
|
335
|
+
if (jb2TrackConfig.adapter.type === tracks_1.UNKNOWN) {
|
|
336
|
+
return (0, tracks_1.generateUnknownTrackConf)(jb2TrackConfig.name, urlTemplate, jb2TrackConfig.category);
|
|
355
337
|
}
|
|
356
|
-
|
|
357
|
-
if (
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
fastaLocation: {
|
|
361
|
-
uri: urlTemplate,
|
|
362
|
-
locationType: 'UriLocation'
|
|
338
|
+
jb2TrackConfig.type = (0, tracks_1.guessTrackType)(jb2TrackConfig.adapter.type);
|
|
339
|
+
if (jb2TrackConfig.type === 'QuantitativeTrack') {
|
|
340
|
+
if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('XYPlot')) {
|
|
341
|
+
jb2TrackConfig.defaultRendering = 'xyplot';
|
|
363
342
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
if (jb1TrackConfig.faiUrlTemplate) {
|
|
367
|
-
_adapter6.faiLocation = {
|
|
368
|
-
uri: resolveUrlTemplate(jb1TrackConfig.faiUrlTemplate),
|
|
369
|
-
locationType: 'UriLocation'
|
|
370
|
-
};
|
|
371
|
-
} else {
|
|
372
|
-
_adapter6.faiLocation = {
|
|
373
|
-
uri: "".concat(urlTemplate, ".fai"),
|
|
374
|
-
locationType: 'UriLocation'
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
if (jb1TrackConfig.gziUrlTemplate) {
|
|
379
|
-
_adapter6.gziLocation = {
|
|
380
|
-
uri: resolveUrlTemplate(jb1TrackConfig.gziUrlTemplate),
|
|
381
|
-
locationType: 'UriLocation'
|
|
382
|
-
};
|
|
383
|
-
} else {
|
|
384
|
-
_adapter6.gziLocation = {
|
|
385
|
-
uri: "".concat(urlTemplate, ".gzi"),
|
|
386
|
-
locationType: 'UriLocation'
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
return _objectSpread(_objectSpread({}, jb2TrackConfig), {}, {
|
|
391
|
-
type: 'ReferenceSequenceTrack',
|
|
392
|
-
adapter: _adapter6
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
if (storeClass === 'JBrowse/Store/SeqFeature/TwoBit') {
|
|
397
|
-
return _objectSpread(_objectSpread({}, jb2TrackConfig), {}, {
|
|
398
|
-
type: 'ReferenceSequenceTrack',
|
|
399
|
-
adapter: {
|
|
400
|
-
type: 'TwoBitAdapter',
|
|
401
|
-
twoBitLocation: {
|
|
402
|
-
uri: urlTemplate,
|
|
403
|
-
locationType: 'UriLocation'
|
|
404
|
-
}
|
|
343
|
+
else if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('Density')) {
|
|
344
|
+
jb2TrackConfig.defaultRendering = 'density';
|
|
405
345
|
}
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
} // If we don't recogize the store class, make a best effort to guess by file type
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
jb2TrackConfig.adapter = (0, _tracks.guessAdapter)({
|
|
412
|
-
uri: urlTemplate,
|
|
413
|
-
locationType: 'UriLocation'
|
|
414
|
-
}, undefined, urlTemplate);
|
|
415
|
-
|
|
416
|
-
if (!jb2TrackConfig.adapter) {
|
|
417
|
-
throw new Error('Could not determine adapter');
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
if (jb2TrackConfig.adapter.type === _tracks.UNSUPPORTED) {
|
|
421
|
-
return (0, _tracks.generateUnsupportedTrackConf)(jb2TrackConfig.name, urlTemplate, jb2TrackConfig.category);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
if (jb2TrackConfig.adapter.type === _tracks.UNKNOWN) {
|
|
425
|
-
return (0, _tracks.generateUnknownTrackConf)(jb2TrackConfig.name, urlTemplate, jb2TrackConfig.category);
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
jb2TrackConfig.type = (0, _tracks.guessTrackType)(jb2TrackConfig.adapter.type);
|
|
429
|
-
|
|
430
|
-
if (jb2TrackConfig.type === 'QuantitativeTrack') {
|
|
431
|
-
if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('XYPlot')) {
|
|
432
|
-
jb2TrackConfig.defaultRendering = 'xyplot';
|
|
433
|
-
} else if (jb1TrackConfig.type && jb1TrackConfig.type.endsWith('Density')) {
|
|
434
|
-
jb2TrackConfig.defaultRendering = 'density';
|
|
435
346
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
return jb2TrackConfig;
|
|
347
|
+
return jb2TrackConfig;
|
|
439
348
|
}
|
|
440
|
-
|
|
349
|
+
exports.convertTrackConfig = convertTrackConfig;
|
|
441
350
|
function generateFromConfigTrackConfig(jb1TrackConfig, jb2TrackConfig) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
function createRefSeqsAdapter(_x) {
|
|
458
|
-
return _createRefSeqsAdapter.apply(this, arguments);
|
|
351
|
+
var jb1Features = jb1TrackConfig.features || [];
|
|
352
|
+
var jb2Features = jb1Features.map(function (feature) {
|
|
353
|
+
var jb2Feature = JSON.parse(JSON.stringify(feature));
|
|
354
|
+
jb2Feature.refName = feature.seq_id;
|
|
355
|
+
jb2Feature.uniqueId = "".concat(feature.seq_id, ":").concat(feature.start, "-").concat(feature.end, ":").concat(feature.name || '');
|
|
356
|
+
return jb2Feature;
|
|
357
|
+
});
|
|
358
|
+
jb2TrackConfig.adapter = {
|
|
359
|
+
type: 'FromConfigAdapter',
|
|
360
|
+
features: jb2Features,
|
|
361
|
+
};
|
|
362
|
+
jb2TrackConfig.type = 'FeatureTrack';
|
|
363
|
+
return jb2TrackConfig;
|
|
459
364
|
}
|
|
460
|
-
|
|
461
|
-
function
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
365
|
+
function createRefSeqsAdapter(refSeqs) {
|
|
366
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
367
|
+
var refSeqsJson, refSeqsData;
|
|
368
|
+
return __generator(this, function (_a) {
|
|
369
|
+
switch (_a.label) {
|
|
370
|
+
case 0:
|
|
371
|
+
if (typeof refSeqs === 'string') {
|
|
372
|
+
// assume refSeqs is a url if it is string
|
|
373
|
+
refSeqs = {
|
|
374
|
+
url: refSeqs,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
if (!refSeqs.url) return [3 /*break*/, 2];
|
|
378
|
+
if (refSeqs.url.match(/.fai$/)) {
|
|
379
|
+
return [2 /*return*/, {
|
|
380
|
+
type: 'IndexedFastaAdapter',
|
|
381
|
+
fastaLocation: {
|
|
382
|
+
uri: refSeqs.url.slice(0, -4),
|
|
383
|
+
locationType: 'UriLocation',
|
|
384
|
+
},
|
|
385
|
+
faiLocation: {
|
|
386
|
+
uri: refSeqs.url,
|
|
387
|
+
locationType: 'UriLocation',
|
|
388
|
+
},
|
|
389
|
+
}];
|
|
390
|
+
}
|
|
391
|
+
if (refSeqs.url.match(/.2bit$/)) {
|
|
392
|
+
return [2 /*return*/, {
|
|
393
|
+
type: 'TwoBitAdapter',
|
|
394
|
+
twoBitLocation: { uri: refSeqs.url, locationType: 'UriLocation' },
|
|
395
|
+
}];
|
|
396
|
+
}
|
|
397
|
+
if (refSeqs.url.match(/.fa$/)) {
|
|
398
|
+
throw new Error('Unindexed FASTA adapter not available');
|
|
399
|
+
}
|
|
400
|
+
if (refSeqs.url.match(/.sizes/)) {
|
|
401
|
+
throw new Error('chromosome SIZES adapter not available');
|
|
402
|
+
}
|
|
403
|
+
return [4 /*yield*/, (0, io_1.openLocation)({
|
|
404
|
+
uri: refSeqs.url,
|
|
405
|
+
locationType: 'UriLocation',
|
|
406
|
+
}).readFile('utf8')];
|
|
407
|
+
case 1:
|
|
408
|
+
refSeqsJson = _a.sent();
|
|
409
|
+
refSeqsData = JSON.parse(refSeqsJson);
|
|
410
|
+
return [2 /*return*/, refSeqAdapterFromConfig(refSeqsData)];
|
|
411
|
+
case 2:
|
|
412
|
+
if ('data' in refSeqs) {
|
|
413
|
+
return [2 /*return*/, refSeqAdapterFromConfig(refSeqs.data || [])];
|
|
414
|
+
}
|
|
415
|
+
throw new Error("Could not determine adapter for JBrowse1 refSeqs: ".concat(refSeqs.url || JSON.stringify(refSeqs)));
|
|
484
416
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
type: 'IndexedFastaAdapter',
|
|
488
|
-
fastaLocation: {
|
|
489
|
-
uri: refSeqs.url.slice(0, -4),
|
|
490
|
-
locationType: 'UriLocation'
|
|
491
|
-
},
|
|
492
|
-
faiLocation: {
|
|
493
|
-
uri: refSeqs.url,
|
|
494
|
-
locationType: 'UriLocation'
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
case 4:
|
|
499
|
-
if (!refSeqs.url.match(/.2bit$/)) {
|
|
500
|
-
_context.next = 6;
|
|
501
|
-
break;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
return _context.abrupt("return", {
|
|
505
|
-
type: 'TwoBitAdapter',
|
|
506
|
-
twoBitLocation: {
|
|
507
|
-
uri: refSeqs.url,
|
|
508
|
-
locationType: 'UriLocation'
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
case 6:
|
|
513
|
-
if (!refSeqs.url.match(/.fa$/)) {
|
|
514
|
-
_context.next = 8;
|
|
515
|
-
break;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
throw new Error('Unindexed FASTA adapter not available');
|
|
519
|
-
|
|
520
|
-
case 8:
|
|
521
|
-
if (!refSeqs.url.match(/.sizes/)) {
|
|
522
|
-
_context.next = 10;
|
|
523
|
-
break;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
throw new Error('chromosome SIZES adapter not available');
|
|
527
|
-
|
|
528
|
-
case 10:
|
|
529
|
-
_context.next = 12;
|
|
530
|
-
return (0, _io.openLocation)({
|
|
531
|
-
uri: refSeqs.url,
|
|
532
|
-
locationType: 'UriLocation'
|
|
533
|
-
}).readFile('utf8');
|
|
534
|
-
|
|
535
|
-
case 12:
|
|
536
|
-
refSeqsJson = _context.sent;
|
|
537
|
-
refSeqsData = JSON.parse(refSeqsJson);
|
|
538
|
-
return _context.abrupt("return", refSeqAdapterFromConfig(refSeqsData));
|
|
539
|
-
|
|
540
|
-
case 15:
|
|
541
|
-
if (!('data' in refSeqs)) {
|
|
542
|
-
_context.next = 17;
|
|
543
|
-
break;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
return _context.abrupt("return", refSeqAdapterFromConfig(refSeqs.data || []));
|
|
547
|
-
|
|
548
|
-
case 17:
|
|
549
|
-
throw new Error("Could not determine adapter for JBrowse1 refSeqs: ".concat(refSeqs.url || JSON.stringify(refSeqs)));
|
|
550
|
-
|
|
551
|
-
case 18:
|
|
552
|
-
case "end":
|
|
553
|
-
return _context.stop();
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}, _callee);
|
|
557
|
-
}));
|
|
558
|
-
return _createRefSeqsAdapter.apply(this, arguments);
|
|
417
|
+
});
|
|
418
|
+
});
|
|
559
419
|
}
|
|
560
|
-
|
|
420
|
+
exports.createRefSeqsAdapter = createRefSeqsAdapter;
|
|
561
421
|
function refSeqAdapterFromConfig(refSeqsData) {
|
|
562
|
-
|
|
422
|
+
var features = refSeqsData.map(function (refSeq) { return ({
|
|
423
|
+
refName: refSeq.name,
|
|
424
|
+
uniqueId: refSeq.name,
|
|
425
|
+
start: refSeq.start,
|
|
426
|
+
end: refSeq.end,
|
|
427
|
+
}); });
|
|
563
428
|
return {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
start: refSeq.start,
|
|
567
|
-
end: refSeq.end
|
|
429
|
+
type: 'FromConfigAdapter',
|
|
430
|
+
features: features,
|
|
568
431
|
};
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
type: 'FromConfigAdapter',
|
|
572
|
-
features: features
|
|
573
|
-
};
|
|
574
|
-
}
|
|
432
|
+
}
|
|
433
|
+
//# sourceMappingURL=jb1ToJb2.js.map
|