@jbrowse/plugin-data-management 1.6.9 → 1.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/dist/AddConnectionWidget/components/AddConnectionWidget.js +178 -0
- package/dist/AddConnectionWidget/components/AddConnectionWidget.test.js +270 -0
- package/dist/AddConnectionWidget/components/ConfigureConnection.js +35 -0
- package/dist/AddConnectionWidget/components/ConnectionTypeSelect.js +70 -0
- package/dist/AddConnectionWidget/index.js +21 -0
- package/dist/AddConnectionWidget/model.js +17 -0
- package/dist/AddTrackWidget/components/AddTrackWidget.js +215 -0
- package/dist/AddTrackWidget/components/AddTrackWidget.test.js +218 -0
- package/dist/AddTrackWidget/components/ConfirmTrack.js +277 -0
- package/dist/AddTrackWidget/components/TrackSourceSelect.js +60 -0
- package/dist/AddTrackWidget/index.js +21 -0
- package/dist/AddTrackWidget/index.test.js +291 -0
- package/dist/AddTrackWidget/model.js +167 -0
- package/dist/AssemblyManager/AssemblyAddForm.js +299 -0
- package/dist/AssemblyManager/AssemblyEditor.js +25 -0
- package/dist/AssemblyManager/AssemblyManager.js +144 -0
- package/dist/AssemblyManager/AssemblyManager.test.js +113 -0
- package/dist/AssemblyManager/AssemblyTable.js +92 -0
- package/dist/AssemblyManager/index.js +15 -0
- package/dist/HierarchicalTrackSelectorWidget/components/CloseConnectionDialog.js +55 -0
- package/dist/HierarchicalTrackSelectorWidget/components/DeleteConnectionDialog.js +46 -0
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.js +648 -0
- package/dist/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.test.js +191 -0
- package/dist/HierarchicalTrackSelectorWidget/components/ManageConnectionsDialog.js +80 -0
- package/dist/HierarchicalTrackSelectorWidget/components/ToggleConnectionsDialog.js +98 -0
- package/dist/HierarchicalTrackSelectorWidget/index.js +21 -0
- package/dist/HierarchicalTrackSelectorWidget/model.js +306 -0
- package/dist/HierarchicalTrackSelectorWidget/model.test.js +28 -0
- package/dist/PluginStoreWidget/components/CustomPluginForm.js +217 -0
- package/dist/PluginStoreWidget/components/InstalledPlugin.js +138 -0
- package/dist/PluginStoreWidget/components/InstalledPluginsList.js +47 -0
- package/dist/PluginStoreWidget/components/PluginCard.js +121 -0
- package/dist/PluginStoreWidget/components/PluginStoreWidget.js +240 -0
- package/dist/PluginStoreWidget/components/PluginStoreWidget.test.js +201 -0
- package/dist/PluginStoreWidget/index.js +29 -0
- package/dist/PluginStoreWidget/model.js +28 -0
- package/dist/PluginStoreWidget/model.test.js +17 -0
- package/dist/SetDefaultSession/SetDefaultSession.js +64 -0
- package/dist/SetDefaultSession/SetDefaultSession.test.js +75 -0
- package/dist/SetDefaultSession/index.js +15 -0
- package/dist/index.js +159 -6
- package/dist/index.test.js +56 -0
- package/dist/ucsc-trackhub/configSchema.js +30 -0
- package/dist/ucsc-trackhub/index.js +23 -0
- package/dist/ucsc-trackhub/model.js +130 -0
- package/dist/ucsc-trackhub/ucscAssemblies.js +13 -0
- package/dist/ucsc-trackhub/ucscTrackHub.js +503 -0
- package/package.json +3 -6
- package/src/AddConnectionWidget/components/AddConnectionWidget.test.js +1 -0
- package/src/AddTrackWidget/components/AddTrackWidget.test.js +1 -0
- package/src/AddTrackWidget/components/AddTrackWidget.tsx +1 -1
- package/src/HierarchicalTrackSelectorWidget/components/HierarchicalTrackSelector.test.js +1 -0
- package/src/PluginStoreWidget/components/CustomPluginForm.tsx +1 -1
- package/src/PluginStoreWidget/components/InstalledPlugin.tsx +4 -2
- package/src/PluginStoreWidget/components/PluginCard.tsx +4 -2
- package/src/PluginStoreWidget/components/PluginStoreWidget.test.js +1 -0
- package/src/PluginStoreWidget/model.test.js +1 -0
- package/src/SetDefaultSession/SetDefaultSession.tsx +4 -3
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.fetchGenomesFile = fetchGenomesFile;
|
|
11
|
+
exports.fetchHubFile = fetchHubFile;
|
|
12
|
+
exports.fetchTrackDbFile = fetchTrackDbFile;
|
|
13
|
+
exports.generateTracks = generateTracks;
|
|
14
|
+
Object.defineProperty(exports, "ucscAssemblies", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _ucscAssemblies["default"];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
22
|
+
|
|
23
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
24
|
+
|
|
25
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
26
|
+
|
|
27
|
+
var _util = require("@jbrowse/core/util");
|
|
28
|
+
|
|
29
|
+
var _io = require("@jbrowse/core/util/io");
|
|
30
|
+
|
|
31
|
+
var _tracks = require("@jbrowse/core/util/tracks");
|
|
32
|
+
|
|
33
|
+
var _ucscAssemblies = _interopRequireDefault(require("./ucscAssemblies"));
|
|
34
|
+
|
|
35
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
36
|
+
|
|
37
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
38
|
+
|
|
39
|
+
function fetchHubFile(_x) {
|
|
40
|
+
return _fetchHubFile.apply(this, arguments);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function _fetchHubFile() {
|
|
44
|
+
_fetchHubFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(hubFileLocation) {
|
|
45
|
+
var hubFileText, _yield$import, HubFile;
|
|
46
|
+
|
|
47
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
48
|
+
while (1) {
|
|
49
|
+
switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
_context.prev = 0;
|
|
52
|
+
_context.next = 3;
|
|
53
|
+
return (0, _io.openLocation)(hubFileLocation).readFile('utf8');
|
|
54
|
+
|
|
55
|
+
case 3:
|
|
56
|
+
hubFileText = _context.sent;
|
|
57
|
+
_context.next = 6;
|
|
58
|
+
return Promise.resolve().then(function () {
|
|
59
|
+
return _interopRequireWildcard(require('@gmod/ucsc-hub'));
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
case 6:
|
|
63
|
+
_yield$import = _context.sent;
|
|
64
|
+
HubFile = _yield$import.HubFile;
|
|
65
|
+
return _context.abrupt("return", new HubFile(hubFileText));
|
|
66
|
+
|
|
67
|
+
case 11:
|
|
68
|
+
_context.prev = 11;
|
|
69
|
+
_context.t0 = _context["catch"](0);
|
|
70
|
+
throw new Error("Not a valid hub.txt file, got error: '".concat(_context.t0, "'"));
|
|
71
|
+
|
|
72
|
+
case 14:
|
|
73
|
+
case "end":
|
|
74
|
+
return _context.stop();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}, _callee, null, [[0, 11]]);
|
|
78
|
+
}));
|
|
79
|
+
return _fetchHubFile.apply(this, arguments);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function fetchGenomesFile(_x2) {
|
|
83
|
+
return _fetchGenomesFile.apply(this, arguments);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function _fetchGenomesFile() {
|
|
87
|
+
_fetchGenomesFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(genomesFileLocation) {
|
|
88
|
+
var genomesFileText, _yield$import2, GenomesFile;
|
|
89
|
+
|
|
90
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
91
|
+
while (1) {
|
|
92
|
+
switch (_context2.prev = _context2.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
_context2.next = 2;
|
|
95
|
+
return (0, _io.openLocation)(genomesFileLocation).readFile('utf8');
|
|
96
|
+
|
|
97
|
+
case 2:
|
|
98
|
+
genomesFileText = _context2.sent;
|
|
99
|
+
_context2.next = 5;
|
|
100
|
+
return Promise.resolve().then(function () {
|
|
101
|
+
return _interopRequireWildcard(require('@gmod/ucsc-hub'));
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
case 5:
|
|
105
|
+
_yield$import2 = _context2.sent;
|
|
106
|
+
GenomesFile = _yield$import2.GenomesFile;
|
|
107
|
+
return _context2.abrupt("return", new GenomesFile(genomesFileText));
|
|
108
|
+
|
|
109
|
+
case 8:
|
|
110
|
+
case "end":
|
|
111
|
+
return _context2.stop();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, _callee2);
|
|
115
|
+
}));
|
|
116
|
+
return _fetchGenomesFile.apply(this, arguments);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function fetchTrackDbFile(_x3) {
|
|
120
|
+
return _fetchTrackDbFile.apply(this, arguments);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function _fetchTrackDbFile() {
|
|
124
|
+
_fetchTrackDbFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(trackDbFileLocation) {
|
|
125
|
+
var text, _yield$import3, TrackDbFile;
|
|
126
|
+
|
|
127
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
128
|
+
while (1) {
|
|
129
|
+
switch (_context3.prev = _context3.next) {
|
|
130
|
+
case 0:
|
|
131
|
+
_context3.next = 2;
|
|
132
|
+
return (0, _io.openLocation)(trackDbFileLocation).readFile('utf8');
|
|
133
|
+
|
|
134
|
+
case 2:
|
|
135
|
+
text = _context3.sent;
|
|
136
|
+
_context3.next = 5;
|
|
137
|
+
return Promise.resolve().then(function () {
|
|
138
|
+
return _interopRequireWildcard(require('@gmod/ucsc-hub'));
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
case 5:
|
|
142
|
+
_yield$import3 = _context3.sent;
|
|
143
|
+
TrackDbFile = _yield$import3.TrackDbFile;
|
|
144
|
+
return _context3.abrupt("return", new TrackDbFile(text));
|
|
145
|
+
|
|
146
|
+
case 8:
|
|
147
|
+
case "end":
|
|
148
|
+
return _context3.stop();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, _callee3);
|
|
152
|
+
}));
|
|
153
|
+
return _fetchTrackDbFile.apply(this, arguments);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function generateTracks(trackDb, trackDbFileLocation, assemblyName, sequenceAdapter) {
|
|
157
|
+
var tracks = [];
|
|
158
|
+
trackDb.forEach(function (track, trackName) {
|
|
159
|
+
var trackKeys = Array.from(track.keys());
|
|
160
|
+
var parentTrackKeys = ['superTrack', 'compositeTrack', 'container', 'view'];
|
|
161
|
+
|
|
162
|
+
if (trackKeys.some(function (key) {
|
|
163
|
+
return parentTrackKeys.includes(key);
|
|
164
|
+
})) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
var parentTracks = [];
|
|
169
|
+
var currentTrackName = trackName;
|
|
170
|
+
|
|
171
|
+
do {
|
|
172
|
+
currentTrackName = trackDb.get(currentTrackName).get('parent');
|
|
173
|
+
|
|
174
|
+
if (currentTrackName) {
|
|
175
|
+
;
|
|
176
|
+
|
|
177
|
+
var _currentTrackName$spl = currentTrackName.split(' ');
|
|
178
|
+
|
|
179
|
+
var _currentTrackName$spl2 = (0, _slicedToArray2["default"])(_currentTrackName$spl, 1);
|
|
180
|
+
|
|
181
|
+
currentTrackName = _currentTrackName$spl2[0];
|
|
182
|
+
parentTracks.push(trackDb.get(currentTrackName));
|
|
183
|
+
}
|
|
184
|
+
} while (currentTrackName);
|
|
185
|
+
|
|
186
|
+
parentTracks.reverse();
|
|
187
|
+
var categories = parentTracks.map(function (parentTrack) {
|
|
188
|
+
return parentTrack.get('shortLabel');
|
|
189
|
+
});
|
|
190
|
+
var res = makeTrackConfig(track, categories, trackDbFileLocation, trackDb, sequenceAdapter);
|
|
191
|
+
res.trackId = "ucsc-trackhub-".concat((0, _util.objectHash)(res));
|
|
192
|
+
res.assemblyNames = [assemblyName];
|
|
193
|
+
tracks.push(res);
|
|
194
|
+
});
|
|
195
|
+
return tracks;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function makeTrackConfig(track, categories, trackDbFileLocation, trackDb, sequenceAdapter) {
|
|
199
|
+
var trackType = track.get('type');
|
|
200
|
+
|
|
201
|
+
if (!trackType) {
|
|
202
|
+
trackType = trackDb.get(track.get('parent')).get('type');
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
var baseTrackType = trackType.split(' ')[0];
|
|
206
|
+
|
|
207
|
+
if (baseTrackType === 'bam' && track.get('bigDataUrl').toLowerCase().endsWith('cram')) {
|
|
208
|
+
baseTrackType = 'cram';
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var bigDataLocation;
|
|
212
|
+
|
|
213
|
+
if (trackDbFileLocation.uri) {
|
|
214
|
+
bigDataLocation = {
|
|
215
|
+
uri: new URL(track.get('bigDataUrl'), trackDbFileLocation.uri).href,
|
|
216
|
+
locationType: 'UriLocation'
|
|
217
|
+
};
|
|
218
|
+
} else {
|
|
219
|
+
bigDataLocation = {
|
|
220
|
+
localPath: track.get('bigDataUrl'),
|
|
221
|
+
locationType: 'LocalPathLocation'
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
var bigDataIndexLocation;
|
|
226
|
+
|
|
227
|
+
switch (baseTrackType) {
|
|
228
|
+
case 'bam':
|
|
229
|
+
if (trackDbFileLocation.uri) {
|
|
230
|
+
bigDataIndexLocation = track.get('bigDataIndex') ? {
|
|
231
|
+
uri: new URL(track.get('bigDataIndex'), trackDbFileLocation.uri).href,
|
|
232
|
+
locationType: 'UriLocation'
|
|
233
|
+
} : {
|
|
234
|
+
uri: new URL("".concat(track.get('bigDataUrl'), ".bai"), trackDbFileLocation.uri).href,
|
|
235
|
+
locationType: 'UriLocation'
|
|
236
|
+
};
|
|
237
|
+
} else {
|
|
238
|
+
bigDataIndexLocation = track.get('bigDataIndex') ? {
|
|
239
|
+
localPath: track.get('bigDataIndex'),
|
|
240
|
+
locationType: 'LocalPathLocation'
|
|
241
|
+
} : {
|
|
242
|
+
localPath: "".concat(track.get('bigDataUrl'), ".bai"),
|
|
243
|
+
locationType: 'LocalPathLocation'
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return {
|
|
248
|
+
type: 'AlignmentsTrack',
|
|
249
|
+
name: track.get('shortLabel'),
|
|
250
|
+
description: track.get('longLabel'),
|
|
251
|
+
category: categories,
|
|
252
|
+
adapter: {
|
|
253
|
+
type: 'BamAdapter',
|
|
254
|
+
bamLocation: bigDataLocation,
|
|
255
|
+
index: {
|
|
256
|
+
location: bigDataIndexLocation
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
case 'bed':
|
|
262
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
263
|
+
|
|
264
|
+
case 'bed5FloatScore':
|
|
265
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
266
|
+
|
|
267
|
+
case 'bedGraph':
|
|
268
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
269
|
+
|
|
270
|
+
case 'bedRnaElements':
|
|
271
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
272
|
+
|
|
273
|
+
case 'bigBarChart':
|
|
274
|
+
return {
|
|
275
|
+
type: 'FeatureTrack',
|
|
276
|
+
name: track.get('shortLabel'),
|
|
277
|
+
description: track.get('longLabel'),
|
|
278
|
+
category: categories,
|
|
279
|
+
adapter: {
|
|
280
|
+
type: 'BigBedAdapter',
|
|
281
|
+
bigBedLocation: bigDataLocation
|
|
282
|
+
},
|
|
283
|
+
renderer: {
|
|
284
|
+
type: 'SvgFeatureRenderer'
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
case 'bigBed':
|
|
289
|
+
return {
|
|
290
|
+
type: 'FeatureTrack',
|
|
291
|
+
name: track.get('shortLabel'),
|
|
292
|
+
description: track.get('longLabel'),
|
|
293
|
+
category: categories,
|
|
294
|
+
adapter: {
|
|
295
|
+
type: 'BigBedAdapter',
|
|
296
|
+
bigBedLocation: bigDataLocation
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
case 'bigGenePred':
|
|
301
|
+
return {
|
|
302
|
+
type: 'FeatureTrack',
|
|
303
|
+
name: track.get('shortLabel'),
|
|
304
|
+
description: track.get('longLabel'),
|
|
305
|
+
category: categories,
|
|
306
|
+
adapter: {
|
|
307
|
+
type: 'BigBedAdapter',
|
|
308
|
+
bigBedLocation: bigDataLocation
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
case 'bigChain':
|
|
313
|
+
return {
|
|
314
|
+
type: 'FeatureTrack',
|
|
315
|
+
name: track.get('shortLabel'),
|
|
316
|
+
description: track.get('longLabel'),
|
|
317
|
+
category: categories,
|
|
318
|
+
adapter: {
|
|
319
|
+
type: 'BigBedAdapter',
|
|
320
|
+
bigBedLocation: bigDataLocation
|
|
321
|
+
},
|
|
322
|
+
renderer: {
|
|
323
|
+
type: 'SvgFeatureRenderer'
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
case 'bigInteract':
|
|
328
|
+
return {
|
|
329
|
+
type: 'FeatureTrack',
|
|
330
|
+
name: track.get('shortLabel'),
|
|
331
|
+
description: track.get('longLabel'),
|
|
332
|
+
category: categories,
|
|
333
|
+
adapter: {
|
|
334
|
+
type: 'BigBedAdapter',
|
|
335
|
+
bigBedLocation: bigDataLocation
|
|
336
|
+
},
|
|
337
|
+
renderer: {
|
|
338
|
+
type: 'SvgFeatureRenderer'
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
case 'bigMaf':
|
|
343
|
+
return {
|
|
344
|
+
type: 'FeatureTrack',
|
|
345
|
+
name: track.get('shortLabel'),
|
|
346
|
+
description: track.get('longLabel'),
|
|
347
|
+
category: categories,
|
|
348
|
+
adapter: {
|
|
349
|
+
type: 'BigBedAdapter',
|
|
350
|
+
bigBedLocation: bigDataLocation
|
|
351
|
+
},
|
|
352
|
+
renderer: {
|
|
353
|
+
type: 'SvgFeatureRenderer'
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
case 'bigPsl':
|
|
358
|
+
return {
|
|
359
|
+
type: 'FeatureTrack',
|
|
360
|
+
name: track.get('shortLabel'),
|
|
361
|
+
description: track.get('longLabel'),
|
|
362
|
+
category: categories,
|
|
363
|
+
adapter: {
|
|
364
|
+
type: 'BigBedAdapter',
|
|
365
|
+
bigBedLocation: bigDataLocation
|
|
366
|
+
},
|
|
367
|
+
renderer: {
|
|
368
|
+
type: 'SvgFeatureRenderer'
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
case 'bigWig':
|
|
373
|
+
return {
|
|
374
|
+
type: 'QuantitativeTrack',
|
|
375
|
+
name: track.get('shortLabel'),
|
|
376
|
+
description: track.get('longLabel'),
|
|
377
|
+
category: categories,
|
|
378
|
+
adapter: {
|
|
379
|
+
type: 'BigWigAdapter',
|
|
380
|
+
bigWigLocation: bigDataLocation
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
case 'broadPeak':
|
|
385
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
386
|
+
|
|
387
|
+
case 'coloredExon':
|
|
388
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
389
|
+
|
|
390
|
+
case 'cram':
|
|
391
|
+
if (trackDbFileLocation.uri) {
|
|
392
|
+
bigDataIndexLocation = track.get('bigDataIndex') ? {
|
|
393
|
+
uri: new URL(track.get('bigDataIndex'), trackDbFileLocation.uri).href,
|
|
394
|
+
locationType: 'UriLocation'
|
|
395
|
+
} : {
|
|
396
|
+
uri: new URL("".concat(track.get('bigDataUrl'), ".crai"), trackDbFileLocation.uri).href,
|
|
397
|
+
locationType: 'UriLocation'
|
|
398
|
+
};
|
|
399
|
+
} else {
|
|
400
|
+
bigDataIndexLocation = track.get('bigDataIndex') ? {
|
|
401
|
+
localPath: track.get('bigDataIndex'),
|
|
402
|
+
locationType: 'LocalPathLocation'
|
|
403
|
+
} : {
|
|
404
|
+
localPath: "".concat(track.get('bigDataUrl'), ".crai"),
|
|
405
|
+
locationType: 'LocalPathLocation'
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return {
|
|
410
|
+
type: 'AlignmentsTrack',
|
|
411
|
+
name: track.get('shortLabel'),
|
|
412
|
+
description: track.get('longLabel'),
|
|
413
|
+
category: categories,
|
|
414
|
+
adapter: {
|
|
415
|
+
type: 'CramAdapter',
|
|
416
|
+
cramLocation: bigDataLocation,
|
|
417
|
+
craiLocation: bigDataIndexLocation,
|
|
418
|
+
sequenceAdapter: sequenceAdapter
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
case 'gvf':
|
|
423
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
424
|
+
|
|
425
|
+
case 'ld2':
|
|
426
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
427
|
+
|
|
428
|
+
case 'narrowPeak':
|
|
429
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
430
|
+
|
|
431
|
+
case 'bigNarrowPeak':
|
|
432
|
+
return {
|
|
433
|
+
type: 'FeatureTrack',
|
|
434
|
+
name: track.get('shortLabel'),
|
|
435
|
+
description: track.get('longLabel'),
|
|
436
|
+
category: categories,
|
|
437
|
+
adapter: {
|
|
438
|
+
type: 'BigBedAdapter',
|
|
439
|
+
bigBedLocation: bigDataLocation
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
case 'peptideMapping':
|
|
444
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
445
|
+
|
|
446
|
+
case 'vcfTabix':
|
|
447
|
+
if (trackDbFileLocation.uri) {
|
|
448
|
+
bigDataIndexLocation = track.get('bigDataIndex') ? {
|
|
449
|
+
uri: new URL(track.get('bigDataIndex'), trackDbFileLocation.uri).href,
|
|
450
|
+
locationType: 'UriLocation'
|
|
451
|
+
} : {
|
|
452
|
+
uri: new URL("".concat(track.get('bigDataUrl'), ".tbi"), trackDbFileLocation.uri).href,
|
|
453
|
+
locationType: 'UriLocation'
|
|
454
|
+
};
|
|
455
|
+
} else {
|
|
456
|
+
bigDataIndexLocation = track.get('bigDataIndex') ? {
|
|
457
|
+
localPath: track.get('bigDataIndex'),
|
|
458
|
+
locationType: 'LocalPathLocation'
|
|
459
|
+
} : {
|
|
460
|
+
localPath: "".concat(track.get('bigDataUrl'), ".tbi"),
|
|
461
|
+
locationType: 'LocalPathLocation'
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return {
|
|
466
|
+
type: 'VariantTrack',
|
|
467
|
+
name: track.get('shortLabel'),
|
|
468
|
+
description: track.get('longLabel'),
|
|
469
|
+
category: categories,
|
|
470
|
+
adapter: {
|
|
471
|
+
type: 'VcfTabixAdapter',
|
|
472
|
+
vcfGzLocation: bigDataLocation,
|
|
473
|
+
index: {
|
|
474
|
+
location: bigDataIndexLocation
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
case 'wig':
|
|
480
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
481
|
+
|
|
482
|
+
case 'wigMaf':
|
|
483
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
484
|
+
|
|
485
|
+
case 'hic':
|
|
486
|
+
return {
|
|
487
|
+
type: 'HicTrack',
|
|
488
|
+
name: track.get('shortLabel'),
|
|
489
|
+
description: track.get('longLabel'),
|
|
490
|
+
category: categories,
|
|
491
|
+
adapter: {
|
|
492
|
+
type: 'HicAdapter',
|
|
493
|
+
hicLocation: bigDataLocation
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
case 'halSnake':
|
|
498
|
+
return (0, _tracks.generateUnsupportedTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
499
|
+
|
|
500
|
+
default:
|
|
501
|
+
return (0, _tracks.generateUnknownTrackConf)(track.get('shortLabel'), baseTrackType, categories);
|
|
502
|
+
}
|
|
503
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-data-management",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "JBrowse 2 linear genome view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -18,15 +18,12 @@
|
|
|
18
18
|
"distMain": "dist/index.js",
|
|
19
19
|
"srcMain": "src/index.ts",
|
|
20
20
|
"main": "dist/index.js",
|
|
21
|
-
"distModule": "dist/plugin-data-management.esm.js",
|
|
22
|
-
"module": "dist/plugin-data-management.esm.js",
|
|
23
21
|
"files": [
|
|
24
22
|
"dist",
|
|
25
23
|
"src"
|
|
26
24
|
],
|
|
27
25
|
"scripts": {
|
|
28
|
-
"
|
|
29
|
-
"build": "tsdx build",
|
|
26
|
+
"build": "babel src --root-mode upward --out-dir dist --extensions .ts,.js,.tsx,.jsx",
|
|
30
27
|
"test": "cd ../..; jest plugins/data-management",
|
|
31
28
|
"prepublishOnly": "yarn test",
|
|
32
29
|
"prepack": "yarn build; yarn useDist",
|
|
@@ -56,5 +53,5 @@
|
|
|
56
53
|
"publishConfig": {
|
|
57
54
|
"access": "public"
|
|
58
55
|
},
|
|
59
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "cc13844074d11881d211342a6a7eea113561b70b"
|
|
60
57
|
}
|
|
@@ -2,6 +2,7 @@ import { render, cleanup, fireEvent } from '@testing-library/react'
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { createTestSession } from '@jbrowse/web/src/rootModel'
|
|
4
4
|
import AddConnectionWidget from './AddConnectionWidget'
|
|
5
|
+
jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
|
|
5
6
|
|
|
6
7
|
window.fetch = jest.fn(() => new Promise(resolve => resolve()))
|
|
7
8
|
|
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { render, cleanup, fireEvent } from '@testing-library/react'
|
|
3
3
|
import { createTestSession } from '@jbrowse/web/src/rootModel'
|
|
4
4
|
import AddTrackWidget from './AddTrackWidget'
|
|
5
|
+
jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
|
|
5
6
|
|
|
6
7
|
describe('<AddTrackWidget />', () => {
|
|
7
8
|
let session
|
|
@@ -47,7 +47,7 @@ function AddTrackWidget({ model }: { model: AddTrackModel }) {
|
|
|
47
47
|
const classes = useStyles()
|
|
48
48
|
const session = getSession(model)
|
|
49
49
|
const { assembly, trackAdapter, trackData, trackName, trackType } = model
|
|
50
|
-
const [trackErrorMessage, setTrackErrorMessage] = useState<
|
|
50
|
+
const [trackErrorMessage, setTrackErrorMessage] = useState<string>()
|
|
51
51
|
|
|
52
52
|
function getStepContent(step: number) {
|
|
53
53
|
switch (step) {
|
|
@@ -3,6 +3,7 @@ import { createTheme, ThemeProvider } from '@material-ui/core/styles'
|
|
|
3
3
|
import { cleanup, render } from '@testing-library/react'
|
|
4
4
|
import React from 'react'
|
|
5
5
|
import HierarchicalTrackSelector from './HierarchicalTrackSelector'
|
|
6
|
+
jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
|
|
6
7
|
|
|
7
8
|
window.requestIdleCallback = cb => cb()
|
|
8
9
|
window.cancelIdleCallback = () => {}
|
|
@@ -132,7 +132,7 @@ function CustomPluginForm({
|
|
|
132
132
|
<DialogContent className={classes.dialogContent}>
|
|
133
133
|
<DialogContentText>
|
|
134
134
|
Enter the name of the plugin and its URL. The name should match what
|
|
135
|
-
is defined in the plugin
|
|
135
|
+
is defined in the plugin's build.
|
|
136
136
|
</DialogContentText>
|
|
137
137
|
<TextField
|
|
138
138
|
id="umd-name-input"
|
|
@@ -19,8 +19,10 @@ import LockIcon from '@material-ui/icons/Lock'
|
|
|
19
19
|
|
|
20
20
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
21
21
|
import { getSession } from '@jbrowse/core/util'
|
|
22
|
-
import {
|
|
23
|
-
|
|
22
|
+
import {
|
|
23
|
+
BasePlugin,
|
|
24
|
+
isSessionWithSessionPlugins,
|
|
25
|
+
} from '@jbrowse/core/util/types'
|
|
24
26
|
import { PluginStoreModel } from '../model'
|
|
25
27
|
|
|
26
28
|
const useStyles = makeStyles(() => ({
|
|
@@ -3,8 +3,10 @@ import PluginManager from '@jbrowse/core/PluginManager'
|
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
import { getEnv, getParent } from 'mobx-state-tree'
|
|
5
5
|
import { getSession } from '@jbrowse/core/util'
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
JBrowsePlugin,
|
|
8
|
+
isSessionWithSessionPlugins,
|
|
9
|
+
} from '@jbrowse/core/util/types'
|
|
8
10
|
import {
|
|
9
11
|
Card,
|
|
10
12
|
CardActions,
|
|
@@ -4,6 +4,7 @@ import { render, cleanup, fireEvent, waitFor } from '@testing-library/react'
|
|
|
4
4
|
import { createTestSession } from '@jbrowse/web/src/rootModel'
|
|
5
5
|
|
|
6
6
|
import PluginStoreWidget from './PluginStoreWidget'
|
|
7
|
+
jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
|
|
7
8
|
|
|
8
9
|
const plugins = {
|
|
9
10
|
plugins: [
|
|
@@ -32,9 +32,10 @@ const SetDefaultSession = observer(
|
|
|
32
32
|
<DialogTitle>Set default session</DialogTitle>
|
|
33
33
|
<DialogContent>
|
|
34
34
|
<Typography>
|
|
35
|
-
Select
|
|
36
|
-
saved to the config file. You can also hit
|
|
37
|
-
which would remove the default
|
|
35
|
+
Select "Set current session as default" to make your
|
|
36
|
+
current session saved to the config file. You can also hit
|
|
37
|
+
"Clear default session", which would remove the default
|
|
38
|
+
session from the config.
|
|
38
39
|
</Typography>
|
|
39
40
|
</DialogContent>
|
|
40
41
|
<DialogActions>
|