@jbrowse/plugin-variants 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.
@@ -42,14 +42,9 @@ function ownKeys(object, enumerableOnly) {
42
42
 
43
43
  if (Object.getOwnPropertySymbols) {
44
44
  var symbols = Object.getOwnPropertySymbols(object);
45
-
46
- if (enumerableOnly) {
47
- symbols = symbols.filter(function (sym) {
48
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
49
- });
50
- }
51
-
52
- keys.push.apply(keys, symbols);
45
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
46
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
47
+ })), keys.push.apply(keys, symbols);
53
48
  }
54
49
 
55
50
  return keys;
@@ -57,19 +52,12 @@ function ownKeys(object, enumerableOnly) {
57
52
 
58
53
  function _objectSpread2(target) {
59
54
  for (var i = 1; i < arguments.length; i++) {
60
- var source = arguments[i] != null ? arguments[i] : {};
61
-
62
- if (i % 2) {
63
- ownKeys(Object(source), true).forEach(function (key) {
64
- _defineProperty(target, key, source[key]);
65
- });
66
- } else if (Object.getOwnPropertyDescriptors) {
67
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
68
- } else {
69
- ownKeys(Object(source)).forEach(function (key) {
70
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
71
- });
72
- }
55
+ var source = null != arguments[i] ? arguments[i] : {};
56
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
57
+ _defineProperty(target, key, source[key]);
58
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
59
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
60
+ });
73
61
  }
74
62
 
75
63
  return target;
@@ -130,6 +118,9 @@ function _defineProperties(target, props) {
130
118
  function _createClass(Constructor, protoProps, staticProps) {
131
119
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
132
120
  if (staticProps) _defineProperties(Constructor, staticProps);
121
+ Object.defineProperty(Constructor, "prototype", {
122
+ writable: false
123
+ });
133
124
  return Constructor;
134
125
  }
135
126
 
@@ -153,12 +144,15 @@ function _inherits(subClass, superClass) {
153
144
  throw new TypeError("Super expression must either be null or a function");
154
145
  }
155
146
 
156
- subClass.prototype = Object.create(superClass && superClass.prototype, {
157
- constructor: {
158
- value: subClass,
159
- writable: true,
160
- configurable: true
161
- }
147
+ Object.defineProperty(subClass, "prototype", {
148
+ value: Object.create(superClass && superClass.prototype, {
149
+ constructor: {
150
+ value: subClass,
151
+ writable: true,
152
+ configurable: true
153
+ }
154
+ }),
155
+ writable: false
162
156
  });
163
157
  if (superClass) _setPrototypeOf(subClass, superClass);
164
158
  }
@@ -274,7 +268,7 @@ function _superPropBase(object, property) {
274
268
  return object;
275
269
  }
276
270
 
277
- function _get(target, property, receiver) {
271
+ function _get() {
278
272
  if (typeof Reflect !== "undefined" && Reflect.get) {
279
273
  _get = Reflect.get;
280
274
  } else {
@@ -285,14 +279,14 @@ function _get(target, property, receiver) {
285
279
  var desc = Object.getOwnPropertyDescriptor(base, property);
286
280
 
287
281
  if (desc.get) {
288
- return desc.get.call(receiver);
282
+ return desc.get.call(arguments.length < 3 ? target : receiver);
289
283
  }
290
284
 
291
285
  return desc.value;
292
286
  };
293
287
  }
294
288
 
295
- return _get(target, property, receiver || target);
289
+ return _get.apply(this, arguments);
296
290
  }
297
291
 
298
292
  function _slicedToArray(arr, i) {
@@ -1826,6 +1820,36 @@ var VariantsPlugin = /*#__PURE__*/function (_Plugin) {
1826
1820
  }
1827
1821
  });
1828
1822
  });
1823
+ pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', function (adapterGuesser) {
1824
+ return function (file, index, adapterHint) {
1825
+ var regexGuess = /\.vcf\.b?gz$/i;
1826
+ var adapterName = 'VcfTabixAdapter';
1827
+ var fileName = tracks.getFileName(file);
1828
+ var indexName = index && tracks.getFileName(index);
1829
+
1830
+ if (regexGuess.test(fileName) || adapterHint === adapterName) {
1831
+ return {
1832
+ type: adapterName,
1833
+ vcfGzLocation: file,
1834
+ index: {
1835
+ location: index || tracks.makeIndex(file, '.tbi'),
1836
+ indexType: tracks.makeIndexType(indexName, 'CSI', 'TBI')
1837
+ }
1838
+ };
1839
+ }
1840
+
1841
+ return adapterGuesser(file, index, adapterHint);
1842
+ };
1843
+ });
1844
+ pluginManager.addToExtensionPoint('Core-guessTrackTypeForLocation', function (trackTypeGuesser) {
1845
+ return function (adapterName) {
1846
+ if (adapterName === 'VcfTabixAdapter') {
1847
+ return 'VariantTrack';
1848
+ }
1849
+
1850
+ return trackTypeGuesser(adapterName);
1851
+ };
1852
+ });
1829
1853
  pluginManager.addAdapterType(function () {
1830
1854
  return new AdapterType({
1831
1855
  name: 'VcfAdapter',
@@ -1837,6 +1861,22 @@ var VariantsPlugin = /*#__PURE__*/function (_Plugin) {
1837
1861
  }
1838
1862
  });
1839
1863
  });
1864
+ pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', function (adapterGuesser) {
1865
+ return function (file, index, adapterHint) {
1866
+ var regexGuess = /\.vcf$/i;
1867
+ var adapterName = 'VcfAdapter';
1868
+ var fileName = tracks.getFileName(file);
1869
+
1870
+ if (regexGuess.test(fileName) || adapterHint === adapterName) {
1871
+ return {
1872
+ type: adapterName,
1873
+ vcfLocation: file
1874
+ };
1875
+ }
1876
+
1877
+ return adapterGuesser(file, index, adapterHint);
1878
+ };
1879
+ });
1840
1880
  pluginManager.addRendererType(function () {
1841
1881
  return pluginManager.jbrequire(ChordRendererConfigF);
1842
1882
  });
@@ -2244,7 +2284,9 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2244
2284
  }()
2245
2285
  }, {
2246
2286
  key: "freeResources",
2247
- value: function freeResources() {}
2287
+ value: function
2288
+ /* { region } */
2289
+ freeResources() {}
2248
2290
  }]);
2249
2291
 
2250
2292
  return _default;
@@ -2258,12 +2300,9 @@ var VcfTabixAdapter = {
2258
2300
  var readVcf = function readVcf(f) {
2259
2301
  var lines = f.split('\n');
2260
2302
  var header = [];
2261
- var refNames = [];
2262
2303
  var rest = [];
2263
2304
  lines.forEach(function (line) {
2264
- if (line.startsWith('##contig')) {
2265
- refNames.push(line.split('##contig=<ID=')[1].split(',')[0]);
2266
- } else if (line.startsWith('#')) {
2305
+ if (line.startsWith('#')) {
2267
2306
  header.push(line);
2268
2307
  } else if (line) {
2269
2308
  rest.push(line);
@@ -2271,60 +2310,44 @@ var readVcf = function readVcf(f) {
2271
2310
  });
2272
2311
  return {
2273
2312
  header: header.join('\n'),
2274
- lines: rest,
2275
- refNames: refNames
2313
+ lines: rest
2276
2314
  };
2277
2315
  };
2278
2316
 
2317
+ function isGzip(buf) {
2318
+ return buf[0] === 31 && buf[1] === 139 && buf[2] === 8;
2319
+ }
2320
+
2279
2321
  var VcfAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2280
2322
  _inherits(VcfAdapter, _BaseFeatureDataAdapt);
2281
2323
 
2282
2324
  var _super = /*#__PURE__*/_createSuper(VcfAdapter);
2283
2325
 
2284
- function VcfAdapter(config, getSubAdapter, pluginManager) {
2326
+ function VcfAdapter() {
2285
2327
  _classCallCheck(this, VcfAdapter);
2286
2328
 
2287
- return _super.call(this, config, getSubAdapter, pluginManager);
2329
+ return _super.apply(this, arguments);
2288
2330
  }
2289
2331
 
2290
2332
  _createClass(VcfAdapter, [{
2291
- key: "decodeFileContents",
2333
+ key: "getHeader",
2292
2334
  value: function () {
2293
- var _decodeFileContents = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
2294
- var vcfLocation, fileContents;
2335
+ var _getHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
2336
+ var _yield$this$setup, header;
2337
+
2295
2338
  return runtime_1.wrap(function _callee$(_context) {
2296
2339
  while (1) {
2297
2340
  switch (_context.prev = _context.next) {
2298
2341
  case 0:
2299
- vcfLocation = configuration.readConfObject(this.config, 'vcfLocation');
2300
- _context.next = 3;
2301
- return io.openLocation(vcfLocation, this.pluginManager).readFile();
2302
-
2303
- case 3:
2304
- fileContents = _context.sent;
2305
-
2306
- if (!(typeof fileContents[0] === 'number' && fileContents[0] === 31 && typeof fileContents[1] === 'number' && fileContents[1] === 139 && typeof fileContents[2] === 'number' && fileContents[2] === 8)) {
2307
- _context.next = 12;
2308
- break;
2309
- }
2310
-
2311
- _context.t0 = new TextDecoder();
2312
- _context.next = 8;
2313
- return bgzfFilehandle.unzip(fileContents);
2342
+ _context.next = 2;
2343
+ return this.setup();
2314
2344
 
2315
- case 8:
2316
- _context.t1 = _context.sent;
2317
- fileContents = _context.t0.decode.call(_context.t0, _context.t1);
2318
- _context.next = 13;
2319
- break;
2320
-
2321
- case 12:
2322
- fileContents = fileContents.toString();
2323
-
2324
- case 13:
2325
- return _context.abrupt("return", readVcf(fileContents));
2345
+ case 2:
2346
+ _yield$this$setup = _context.sent;
2347
+ header = _yield$this$setup.header;
2348
+ return _context.abrupt("return", header);
2326
2349
 
2327
- case 14:
2350
+ case 5:
2328
2351
  case "end":
2329
2352
  return _context.stop();
2330
2353
  }
@@ -2332,31 +2355,34 @@ var VcfAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2332
2355
  }, _callee, this);
2333
2356
  }));
2334
2357
 
2335
- function decodeFileContents() {
2336
- return _decodeFileContents.apply(this, arguments);
2358
+ function getHeader() {
2359
+ return _getHeader.apply(this, arguments);
2337
2360
  }
2338
2361
 
2339
- return decodeFileContents;
2362
+ return getHeader;
2340
2363
  }()
2341
2364
  }, {
2342
- key: "getHeader",
2365
+ key: "getMetadata",
2343
2366
  value: function () {
2344
- var _getHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
2345
- var _yield$this$decodeFil, header;
2367
+ var _getMetadata = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
2368
+ var _yield$this$setup2, header, parser;
2346
2369
 
2347
2370
  return runtime_1.wrap(function _callee2$(_context2) {
2348
2371
  while (1) {
2349
2372
  switch (_context2.prev = _context2.next) {
2350
2373
  case 0:
2351
2374
  _context2.next = 2;
2352
- return this.decodeFileContents();
2375
+ return this.setup();
2353
2376
 
2354
2377
  case 2:
2355
- _yield$this$decodeFil = _context2.sent;
2356
- header = _yield$this$decodeFil.header;
2357
- return _context2.abrupt("return", header);
2378
+ _yield$this$setup2 = _context2.sent;
2379
+ header = _yield$this$setup2.header;
2380
+ parser = new VCF__default({
2381
+ header: header
2382
+ });
2383
+ return _context2.abrupt("return", parser.getMetadata());
2358
2384
 
2359
- case 5:
2385
+ case 6:
2360
2386
  case "end":
2361
2387
  return _context2.stop();
2362
2388
  }
@@ -2364,122 +2390,131 @@ var VcfAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2364
2390
  }, _callee2, this);
2365
2391
  }));
2366
2392
 
2367
- function getHeader() {
2368
- return _getHeader.apply(this, arguments);
2393
+ function getMetadata() {
2394
+ return _getMetadata.apply(this, arguments);
2369
2395
  }
2370
2396
 
2371
- return getHeader;
2372
- }()
2397
+ return getMetadata;
2398
+ }() // converts lines into an interval tree
2399
+
2373
2400
  }, {
2374
- key: "getMetadata",
2401
+ key: "setupP",
2375
2402
  value: function () {
2376
- var _getMetadata = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
2377
- var _yield$this$decodeFil2, header, parser;
2403
+ var _setupP = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
2404
+ var buffer, buf, str, _readVcf, header, lines, intervalTree;
2378
2405
 
2379
2406
  return runtime_1.wrap(function _callee3$(_context3) {
2380
2407
  while (1) {
2381
2408
  switch (_context3.prev = _context3.next) {
2382
2409
  case 0:
2383
2410
  _context3.next = 2;
2384
- return this.decodeFileContents();
2411
+ return io.openLocation(configuration.readConfObject(this.config, 'vcfLocation'), this.pluginManager).readFile();
2385
2412
 
2386
2413
  case 2:
2387
- _yield$this$decodeFil2 = _context3.sent;
2388
- header = _yield$this$decodeFil2.header;
2389
- parser = new VCF__default({
2390
- header: header
2391
- });
2392
- return _context3.abrupt("return", parser.getMetadata());
2414
+ buffer = _context3.sent;
2415
+
2416
+ if (!isGzip(buffer)) {
2417
+ _context3.next = 9;
2418
+ break;
2419
+ }
2420
+
2421
+ _context3.next = 6;
2422
+ return bgzfFilehandle.unzip(buffer);
2393
2423
 
2394
2424
  case 6:
2395
- case "end":
2396
- return _context3.stop();
2397
- }
2398
- }
2399
- }, _callee3, this);
2400
- }));
2425
+ _context3.t0 = _context3.sent;
2426
+ _context3.next = 10;
2427
+ break;
2401
2428
 
2402
- function getMetadata() {
2403
- return _getMetadata.apply(this, arguments);
2404
- }
2429
+ case 9:
2430
+ _context3.t0 = buffer;
2405
2431
 
2406
- return getMetadata;
2407
- }()
2408
- }, {
2409
- key: "getLines",
2410
- value: function () {
2411
- var _getLines = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
2412
- var _this = this;
2432
+ case 10:
2433
+ buf = _context3.t0;
2413
2434
 
2414
- var _yield$this$decodeFil3, header, lines, parser;
2435
+ if (!(buf.length > 536870888)) {
2436
+ _context3.next = 13;
2437
+ break;
2438
+ }
2415
2439
 
2416
- return runtime_1.wrap(function _callee4$(_context4) {
2417
- while (1) {
2418
- switch (_context4.prev = _context4.next) {
2419
- case 0:
2420
- _context4.next = 2;
2421
- return this.decodeFileContents();
2440
+ throw new Error('Data exceeds maximum string length (512MB)');
2422
2441
 
2423
- case 2:
2424
- _yield$this$decodeFil3 = _context4.sent;
2425
- header = _yield$this$decodeFil3.header;
2426
- lines = _yield$this$decodeFil3.lines;
2427
- parser = new VCF__default({
2428
- header: header
2442
+ case 13:
2443
+ str = new TextDecoder().decode(buf);
2444
+ _readVcf = readVcf(str), header = _readVcf.header, lines = _readVcf.lines;
2445
+ intervalTree = lines.map(function (line, id) {
2446
+ var _info$match;
2447
+
2448
+ var _line$split = line.split('\t'),
2449
+ _line$split2 = _slicedToArray(_line$split, 8),
2450
+ refName = _line$split2[0],
2451
+ startP = _line$split2[1],
2452
+ ref = _line$split2[3],
2453
+ info = _line$split2[7];
2454
+
2455
+ var start = +startP - 1;
2456
+ var end = +(((_info$match = info.match(/END=(\d+)/)) === null || _info$match === void 0 ? void 0 : _info$match[1].trim()) || start + ref.length);
2457
+ return {
2458
+ line: line,
2459
+ refName: refName,
2460
+ start: start,
2461
+ end: end,
2462
+ id: id
2463
+ };
2464
+ }).reduce(function (acc, obj) {
2465
+ var key = obj.refName;
2466
+
2467
+ if (!acc[key]) {
2468
+ acc[key] = new IntervalTree();
2469
+ }
2470
+
2471
+ acc[key].insert([obj.start, obj.end], obj);
2472
+ return acc;
2473
+ }, {});
2474
+ return _context3.abrupt("return", {
2475
+ header: header,
2476
+ intervalTree: intervalTree
2429
2477
  });
2430
- return _context4.abrupt("return", lines.map(function (line, index) {
2431
- return new VCFFeature({
2432
- variant: parser.parseLine(line),
2433
- parser: parser,
2434
- id: "".concat(_this.id, "-vcf-").concat(index)
2435
- });
2436
- }));
2437
2478
 
2438
- case 7:
2479
+ case 17:
2439
2480
  case "end":
2440
- return _context4.stop();
2481
+ return _context3.stop();
2441
2482
  }
2442
2483
  }
2443
- }, _callee4, this);
2484
+ }, _callee3, this);
2444
2485
  }));
2445
2486
 
2446
- function getLines() {
2447
- return _getLines.apply(this, arguments);
2487
+ function setupP() {
2488
+ return _setupP.apply(this, arguments);
2448
2489
  }
2449
2490
 
2450
- return getLines;
2491
+ return setupP;
2451
2492
  }()
2452
2493
  }, {
2453
2494
  key: "setup",
2454
2495
  value: function () {
2455
- var _setup = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
2456
- return runtime_1.wrap(function _callee5$(_context5) {
2496
+ var _setup = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
2497
+ var _this = this;
2498
+
2499
+ return runtime_1.wrap(function _callee4$(_context4) {
2457
2500
  while (1) {
2458
- switch (_context5.prev = _context5.next) {
2501
+ switch (_context4.prev = _context4.next) {
2459
2502
  case 0:
2460
2503
  if (!this.vcfFeatures) {
2461
- this.vcfFeatures = this.getLines().then(function (feats) {
2462
- return feats.reduce(function (acc, obj) {
2463
- var key = obj.get('refName');
2464
-
2465
- if (!acc[key]) {
2466
- acc[key] = new IntervalTree();
2467
- }
2468
-
2469
- acc[key].insert([obj.get('start'), obj.get('end')], obj);
2470
- return acc;
2471
- }, {});
2504
+ this.vcfFeatures = this.setupP()["catch"](function (e) {
2505
+ _this.vcfFeatures = undefined;
2506
+ throw e;
2472
2507
  });
2473
2508
  }
2474
2509
 
2475
- return _context5.abrupt("return", this.vcfFeatures);
2510
+ return _context4.abrupt("return", this.vcfFeatures);
2476
2511
 
2477
2512
  case 2:
2478
2513
  case "end":
2479
- return _context5.stop();
2514
+ return _context4.stop();
2480
2515
  }
2481
2516
  }
2482
- }, _callee5, this);
2517
+ }, _callee4, this);
2483
2518
  }));
2484
2519
 
2485
2520
  function setup() {
@@ -2491,28 +2526,28 @@ var VcfAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2491
2526
  }, {
2492
2527
  key: "getRefNames",
2493
2528
  value: function () {
2494
- var _getRefNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
2495
- var _yield$this$decodeFil4,
2496
- refNames;
2529
+ var _getRefNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
2530
+ var _yield$this$setup3,
2531
+ intervalTree;
2497
2532
 
2498
- return runtime_1.wrap(function _callee6$(_context6) {
2533
+ return runtime_1.wrap(function _callee5$(_context5) {
2499
2534
  while (1) {
2500
- switch (_context6.prev = _context6.next) {
2535
+ switch (_context5.prev = _context5.next) {
2501
2536
  case 0:
2502
- _context6.next = 3;
2503
- return this.decodeFileContents();
2537
+ _context5.next = 3;
2538
+ return this.setup();
2504
2539
 
2505
2540
  case 3:
2506
- _yield$this$decodeFil4 = _context6.sent;
2507
- refNames = _yield$this$decodeFil4.refNames;
2508
- return _context6.abrupt("return", refNames);
2541
+ _yield$this$setup3 = _context5.sent;
2542
+ intervalTree = _yield$this$setup3.intervalTree;
2543
+ return _context5.abrupt("return", Object.keys(intervalTree));
2509
2544
 
2510
2545
  case 6:
2511
2546
  case "end":
2512
- return _context6.stop();
2547
+ return _context5.stop();
2513
2548
  }
2514
2549
  }
2515
- }, _callee6, this);
2550
+ }, _callee5, this);
2516
2551
  }));
2517
2552
 
2518
2553
  function getRefNames() {
@@ -2528,40 +2563,47 @@ var VcfAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
2528
2563
 
2529
2564
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2530
2565
  return rxjs.ObservableCreate( /*#__PURE__*/function () {
2531
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(observer) {
2532
- var start, end, refName, vcfFeatures, tree, feats;
2533
- return runtime_1.wrap(function _callee7$(_context7) {
2566
+ var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(observer) {
2567
+ var _intervalTree$refName, start, end, refName, _yield$_this2$setup, header, intervalTree, parser;
2568
+
2569
+ return runtime_1.wrap(function _callee6$(_context6) {
2534
2570
  while (1) {
2535
- switch (_context7.prev = _context7.next) {
2571
+ switch (_context6.prev = _context6.next) {
2536
2572
  case 0:
2537
- _context7.prev = 0;
2573
+ _context6.prev = 0;
2538
2574
  start = region.start, end = region.end, refName = region.refName;
2539
- _context7.next = 4;
2575
+ _context6.next = 4;
2540
2576
  return _this2.setup();
2541
2577
 
2542
2578
  case 4:
2543
- vcfFeatures = _context7.sent;
2544
- tree = vcfFeatures[refName];
2545
- feats = tree.search([start, end]); // expected array ['val1']
2546
-
2547
- feats.forEach(function (f) {
2548
- observer.next(f);
2579
+ _yield$_this2$setup = _context6.sent;
2580
+ header = _yield$_this2$setup.header;
2581
+ intervalTree = _yield$_this2$setup.intervalTree;
2582
+ parser = new VCF__default({
2583
+ header: header
2584
+ });
2585
+ (_intervalTree$refName = intervalTree[refName]) === null || _intervalTree$refName === void 0 ? void 0 : _intervalTree$refName.search([start, end]).forEach(function (f) {
2586
+ return observer.next(new VCFFeature({
2587
+ variant: parser.parseLine(f.line),
2588
+ parser: parser,
2589
+ id: "".concat(_this2.id, "-").concat(f.id)
2590
+ }));
2549
2591
  });
2550
2592
  observer.complete();
2551
- _context7.next = 14;
2593
+ _context6.next = 15;
2552
2594
  break;
2553
2595
 
2554
- case 11:
2555
- _context7.prev = 11;
2556
- _context7.t0 = _context7["catch"](0);
2557
- observer.error(_context7.t0);
2596
+ case 12:
2597
+ _context6.prev = 12;
2598
+ _context6.t0 = _context6["catch"](0);
2599
+ observer.error(_context6.t0);
2558
2600
 
2559
- case 14:
2601
+ case 15:
2560
2602
  case "end":
2561
- return _context7.stop();
2603
+ return _context6.stop();
2562
2604
  }
2563
2605
  }
2564
- }, _callee7, null, [[0, 11]]);
2606
+ }, _callee6, null, [[0, 12]]);
2565
2607
  }));
2566
2608
 
2567
2609
  return function (_x) {
@@ -2854,7 +2896,9 @@ function VariantFeatureDetails(props) {
2854
2896
  }, props)), /*#__PURE__*/React__default.createElement(core.Divider, null), feat.type === 'breakend' ? /*#__PURE__*/React__default.createElement(BreakendPanel, {
2855
2897
  feature: feat,
2856
2898
  locStrings: feat.ALT.map(function (alt) {
2857
- return VCF.parseBreakend(alt).MatePosition;
2899
+ var _parseBreakend;
2900
+
2901
+ return ((_parseBreakend = VCF.parseBreakend(alt)) === null || _parseBreakend === void 0 ? void 0 : _parseBreakend.MatePosition) || '';
2858
2902
  }),
2859
2903
  model: model
2860
2904
  }) : null, feat.type === 'translocation' ? /*#__PURE__*/React__default.createElement(BreakendPanel, {