igv 2.12.1 → 2.12.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/igv.js CHANGED
@@ -20413,6 +20413,12 @@
20413
20413
  complement[t1[i].toLowerCase()] = t2[i].toLowerCase();
20414
20414
  }
20415
20415
 
20416
+ const DEFAULT_HEIGHT = 25;
20417
+ const TRANSLATED_HEIGHT = 115;
20418
+ const SEQUENCE_HEIGHT = 15;
20419
+ const FRAME_HEIGHT = 25;
20420
+ const FRAME_BORDER = 5;
20421
+
20416
20422
  class SequenceTrack {
20417
20423
  constructor(config, browser) {
20418
20424
  this.type = "sequence";
@@ -20423,12 +20429,12 @@
20423
20429
  this.id = "sequence";
20424
20430
  this.sequenceType = config.sequenceType || "dna"; // dna | rna | prot
20425
20431
 
20426
- this.height = 25;
20427
20432
  this.disableButtons = false;
20428
20433
  this.order = config.order || defaultSequenceTrackOrder;
20429
20434
  this.ignoreTrackMenu = false;
20430
- this.reversed = false;
20431
- this.frameTranslate = false;
20435
+ this.reversed = config.reversed === true;
20436
+ this.frameTranslate = config.frameTranslate === true;
20437
+ this.height = this.frameTranslate ? TRANSLATED_HEIGHT : DEFAULT_HEIGHT;
20432
20438
  }
20433
20439
 
20434
20440
  menuItemList() {
@@ -20445,16 +20451,16 @@
20445
20451
 
20446
20452
  if (this.frameTranslate) {
20447
20453
  for (let vp of this.trackView.viewports) {
20448
- vp.setContentHeight(115);
20454
+ vp.setContentHeight(TRANSLATED_HEIGHT);
20449
20455
  }
20450
20456
 
20451
- this.trackView.setTrackHeight(115);
20457
+ this.trackView.setTrackHeight(TRANSLATED_HEIGHT);
20452
20458
  } else {
20453
20459
  for (let vp of this.trackView.viewports) {
20454
- vp.setContentHeight(25);
20460
+ vp.setContentHeight(DEFAULT_HEIGHT);
20455
20461
  }
20456
20462
 
20457
- this.trackView.setTrackHeight(25);
20463
+ this.trackView.setTrackHeight(DEFAULT_HEIGHT);
20458
20464
  }
20459
20465
 
20460
20466
  this.trackView.repaintViews();
@@ -20537,6 +20543,9 @@
20537
20543
  }
20538
20544
 
20539
20545
  async getFeatures(chr, start, end, bpPerPixel) {
20546
+ start = Math.floor(start);
20547
+ end = Math.floor(end);
20548
+
20540
20549
  if (bpPerPixel && bpPerPixel > 1) {
20541
20550
  return null;
20542
20551
  } else {
@@ -20552,33 +20561,35 @@
20552
20561
  const ctx = options.context;
20553
20562
 
20554
20563
  if (options.features) {
20555
- const sequence = options.features.sequence;
20556
- const sequenceBpStart = options.features.bpStart;
20557
- const bpEnd = 1 + options.bpStart + options.pixelWidth * options.bpPerPixel;
20558
- let height = 15;
20564
+ let sequence = options.features.sequence;
20565
+
20566
+ if (this.reversed) {
20567
+ sequence = sequence.split('').map(function (cv) {
20568
+ return complement[cv];
20569
+ }).join('');
20570
+ }
20559
20571
 
20560
- for (let bp = sequenceBpStart; bp <= bpEnd; bp++) {
20561
- let seqOffsetBp = Math.floor(bp - sequenceBpStart);
20572
+ const sequenceBpStart = options.features.bpStart; // genomic position at start of sequence
20562
20573
 
20563
- if (seqOffsetBp < sequence.length) {
20564
- let letter = sequence[seqOffsetBp];
20574
+ const bpEnd = 1 + options.bpStart + options.pixelWidth * options.bpPerPixel;
20565
20575
 
20566
- if (this.reversed) {
20567
- letter = complement[letter] || "";
20568
- }
20576
+ for (let bp = Math.floor(options.bpStart); bp <= bpEnd; bp++) {
20577
+ const seqIdx = Math.floor(bp - sequenceBpStart);
20569
20578
 
20570
- let offsetBP = bp - options.bpStart;
20571
- let aPixel = offsetBP / options.bpPerPixel;
20572
- let bPixel = (offsetBP + 1) / options.bpPerPixel;
20573
- let color = this.fillColor(letter); // IGVGraphics.fillRect(ctx, aPixel, 5, bPixel - aPixel, height - 5, { fillStyle: randomRGBConstantAlpha(150, 255, 0.75) });
20579
+ if (seqIdx >= 0 && seqIdx < sequence.length) {
20580
+ const baseLetter = sequence[seqIdx];
20581
+ const offsetBP = bp - options.bpStart;
20582
+ const aPixel = offsetBP / options.bpPerPixel;
20583
+ const pixelWidth = 1 / options.bpPerPixel;
20584
+ const color = this.fillColor(baseLetter);
20574
20585
 
20575
20586
  if (options.bpPerPixel > 1 / 10) {
20576
- IGVGraphics.fillRect(ctx, aPixel, 5, bPixel - aPixel, height - 5, {
20587
+ IGVGraphics.fillRect(ctx, aPixel, 5, pixelWidth, SEQUENCE_HEIGHT - 5, {
20577
20588
  fillStyle: color
20578
20589
  });
20579
20590
  } else {
20580
- let xPixel = 0.5 * (aPixel + bPixel - ctx.measureText(letter).width);
20581
- IGVGraphics.strokeText(ctx, letter, xPixel, height, {
20591
+ let textPixel = aPixel + 0.5 * (pixelWidth - ctx.measureText(baseLetter).width);
20592
+ IGVGraphics.strokeText(ctx, baseLetter, textPixel, SEQUENCE_HEIGHT, {
20582
20593
  strokeStyle: color
20583
20594
  });
20584
20595
  }
@@ -20586,55 +20597,48 @@
20586
20597
  }
20587
20598
 
20588
20599
  if (this.frameTranslate) {
20589
- let transSeq;
20600
+ let y = SEQUENCE_HEIGHT + 2 * FRAME_BORDER;
20601
+ const translatedSequence = this.translateSequence(sequence);
20590
20602
 
20591
- if (this.reversed) {
20592
- transSeq = sequence.split('').map(function (cv) {
20593
- return complement[cv];
20594
- });
20595
- transSeq = transSeq.join('');
20596
- } else {
20597
- transSeq = sequence;
20598
- }
20603
+ for (let fNum = 0; fNum < translatedSequence.length; fNum++) {
20604
+ // == 3, 1 for each frame
20605
+ const aaSequence = translatedSequence[fNum]; // AA sequence for this frame
20599
20606
 
20600
- let y = height;
20601
- let translatedSequence = this.translateSequence(transSeq);
20602
-
20603
- for (let arr of translatedSequence) {
20604
- let i = translatedSequence.indexOf(arr);
20605
- let fNum = i;
20606
- let h = 25;
20607
- y = i === 0 ? y + 10 : y + 30; //Little less room at first.
20608
-
20609
- for (let cv of arr) {
20610
- let aaS;
20611
- let idx = arr.indexOf(cv);
20612
- let xSeed = idx + fNum + 2 * idx;
20607
+ for (let idx = 0; idx < aaSequence.length; idx++) {
20613
20608
  let color = 0 === idx % 2 ? 'rgb(160,160,160)' : 'rgb(224,224,224)';
20614
- let p0 = Math.floor(xSeed / options.bpPerPixel);
20615
- let p1 = Math.floor((xSeed + 3) / options.bpPerPixel);
20616
- let pc = Math.round((p0 + p1) / 2);
20609
+ const cv = aaSequence[idx];
20610
+ const bpPos = sequenceBpStart + fNum + idx * 3;
20611
+ const bpOffset = bpPos - options.bpStart;
20612
+ const p0 = Math.floor(bpOffset / options.bpPerPixel);
20613
+ const p1 = Math.floor((bpOffset + 3) / options.bpPerPixel);
20614
+ const pc = Math.round((p0 + p1) / 2);
20615
+
20616
+ if (p1 < 0) {
20617
+ continue; // off left edge
20618
+ } else if (p0 > options.pixelWidth) {
20619
+ break; // off right edge
20620
+ }
20621
+
20622
+ let aaLabel = cv.aminoA;
20617
20623
 
20618
20624
  if (cv.aminoA.indexOf('STOP') > -1) {
20619
20625
  color = 'rgb(255, 0, 0)';
20620
- aaS = 'STOP'; //Color blind accessible
20621
- } else {
20622
- aaS = cv.aminoA;
20623
- }
20624
-
20625
- if (cv.aminoA === 'M') {
20626
+ aaLabel = 'STOP'; //Color blind accessible
20627
+ } else if (cv.aminoA === 'M') {
20626
20628
  color = 'rgb(0, 153, 0)';
20627
- aaS = 'START'; //Color blind accessible
20629
+ aaLabel = 'START'; //Color blind accessible
20628
20630
  }
20629
20631
 
20630
- IGVGraphics.fillRect(ctx, p0, y, p1 - p0, h, {
20632
+ IGVGraphics.fillRect(ctx, p0, y, p1 - p0, FRAME_HEIGHT, {
20631
20633
  fillStyle: color
20632
20634
  });
20633
20635
 
20634
20636
  if (options.bpPerPixel <= 1 / 10) {
20635
- IGVGraphics.strokeText(ctx, aaS, pc - ctx.measureText(aaS).width / 2, y + 15);
20637
+ IGVGraphics.strokeText(ctx, aaLabel, pc - ctx.measureText(aaLabel).width / 2, y + 15);
20636
20638
  }
20637
20639
  }
20640
+
20641
+ y += FRAME_HEIGHT + FRAME_BORDER;
20638
20642
  }
20639
20643
  }
20640
20644
  }
@@ -20645,6 +20649,7 @@
20645
20649
  }
20646
20650
 
20647
20651
  computePixelHeight(ignore) {
20652
+ this.height = this.frameTranslate ? TRANSLATED_HEIGHT : DEFAULT_HEIGHT;
20648
20653
  return this.height;
20649
20654
  }
20650
20655
 
@@ -20657,6 +20662,28 @@
20657
20662
  return 'rgb(0, 0, 150)';
20658
20663
  }
20659
20664
  }
20665
+ /**
20666
+ * Return the current state of the track. Used to create sessions and bookmarks.
20667
+ *
20668
+ * @returns {*|{}}
20669
+ */
20670
+
20671
+
20672
+ getState() {
20673
+ const config = {
20674
+ type: "sequence"
20675
+ };
20676
+
20677
+ if (this.order !== defaultSequenceTrackOrder) {
20678
+ config.order = this.order;
20679
+ }
20680
+
20681
+ if (this.reversed) {
20682
+ config.revealed = true;
20683
+ }
20684
+
20685
+ return config;
20686
+ }
20660
20687
 
20661
20688
  }
20662
20689
 
@@ -22623,7 +22650,9 @@
22623
22650
  }
22624
22651
 
22625
22652
  async getSequence(chr, start, end) {
22626
- if (!(this.interval && this.interval.contains(chr, start, end))) {
22653
+ const hasCachedSquence = this.interval && this.interval.contains(chr, start, end);
22654
+
22655
+ if (!hasCachedSquence) {
22627
22656
  // Expand query, to minimum of 50kb
22628
22657
  let qstart = start;
22629
22658
  let qend = end;
@@ -23093,7 +23122,7 @@
23093
23122
  }
23094
23123
  };
23095
23124
 
23096
- const _version = "2.12.1";
23125
+ const _version = "2.12.4";
23097
23126
 
23098
23127
  function version$1() {
23099
23128
  return _version;
@@ -23748,6 +23777,19 @@
23748
23777
  this.stopSpinner();
23749
23778
  }
23750
23779
  }
23780
+
23781
+ repaintDimensions() {
23782
+ const isWGV = GenomeUtils.isWholeGenomeView(this.referenceFrame.chr);
23783
+ const pixelWidth = isWGV ? this.$viewport.width() : 3 * this.$viewport.width();
23784
+ const bpPerPixel = this.referenceFrame.bpPerPixel;
23785
+ const startBP = this.referenceFrame.start - (isWGV ? 0 : pixelWidth / 3 * bpPerPixel);
23786
+ const endBP = this.referenceFrame.end + (isWGV ? 0 : pixelWidth / 3 * bpPerPixel);
23787
+ return {
23788
+ startBP,
23789
+ endBP,
23790
+ pixelWidth
23791
+ };
23792
+ }
23751
23793
  /**
23752
23794
  * Repaint the canvas using the cached features
23753
23795
  *
@@ -23765,10 +23807,14 @@
23765
23807
  } = this.featureCache; //this.tile.bpPerPixel = this.referenceFrame.bpPerPixel
23766
23808
  // const isWGV = GenomeUtils.isWholeGenomeView(this.browser.referenceFrameList[0].chr)
23767
23809
 
23768
- const isWGV = GenomeUtils.isWholeGenomeView(this.referenceFrame.chr); // Canvas dimensions. There is no left-right panning for WGV so canvas width is viewport width.
23810
+ GenomeUtils.isWholeGenomeView(this.referenceFrame.chr); // Canvas dimensions. There is no left-right panning for WGV so canvas width is viewport width.
23769
23811
  // For deep tracks we paint a canvas == 3*viewportHeight centered on the current vertical scroll position
23770
23812
 
23771
- const pixelWidth = isWGV ? this.$viewport.width() : 3 * this.$viewport.width();
23813
+ const {
23814
+ startBP,
23815
+ endBP,
23816
+ pixelWidth
23817
+ } = this.repaintDimensions();
23772
23818
  const viewportHeight = this.$viewport.height();
23773
23819
  const contentHeight = this.getContentHeight();
23774
23820
  const minHeight = roiFeatures ? Math.max(contentHeight, viewportHeight) : contentHeight; // Need to fill viewport for ROIs.
@@ -23784,9 +23830,9 @@
23784
23830
  }
23785
23831
 
23786
23832
  const canvasTop = Math.max(0, -this.$content.position().top - viewportHeight);
23787
- const bpPerPixel = this.referenceFrame.bpPerPixel;
23788
- const startBP = this.referenceFrame.start - (isWGV ? 0 : pixelWidth / 3 * bpPerPixel);
23789
- const endBP = this.referenceFrame.end + (isWGV ? 0 : pixelWidth / 3 * bpPerPixel);
23833
+ const bpPerPixel = this.referenceFrame.bpPerPixel; //const startBP = this.referenceFrame.start - (isWGV ? 0 : pixelWidth / 3 * bpPerPixel)
23834
+ //const endBP = this.referenceFrame.end + (isWGV ? 0 : pixelWidth / 3 * bpPerPixel)
23835
+
23790
23836
  const pixelXOffset = Math.round((startBP - this.referenceFrame.start) / bpPerPixel);
23791
23837
  const newCanvas = $$1('<canvas class="igv-canvas">').get(0);
23792
23838
  newCanvas.style.width = pixelWidth + "px";
@@ -24027,10 +24073,12 @@
24027
24073
  if (!this.featureCache) return true;
24028
24074
  const referenceFrame = this.referenceFrame;
24029
24075
  const chr = this.referenceFrame.chr;
24030
- const start = referenceFrame.start;
24031
- const end = start + referenceFrame.toBP($$1(this.contentDiv).width());
24032
24076
  const bpPerPixel = referenceFrame.bpPerPixel;
24033
- return !this.featureCache.containsRange(chr, start, end, bpPerPixel);
24077
+ const {
24078
+ startBP,
24079
+ endBP
24080
+ } = this.repaintDimensions();
24081
+ return !this.featureCache.containsRange(chr, startBP, endBP, bpPerPixel);
24034
24082
  }
24035
24083
 
24036
24084
  createZoomInNotice($parent) {
@@ -24496,7 +24544,7 @@
24496
24544
  }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
24497
24545
 
24498
24546
 
24499
- var global$1 = // eslint-disable-next-line es/no-global-this -- safe
24547
+ var global$1 = // eslint-disable-next-line es-x/no-global-this -- safe
24500
24548
  check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe
24501
24549
  check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback
24502
24550
  function () {
@@ -24512,6 +24560,7 @@
24512
24560
  };
24513
24561
 
24514
24562
  var functionBindNative = !fails(function () {
24563
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
24515
24564
  var test = function () {
24516
24565
  /* empty */
24517
24566
  }.bind(); // eslint-disable-next-line no-prototype-builtins -- safe
@@ -24525,11 +24574,11 @@
24525
24574
  return call$2.apply(call$2, arguments);
24526
24575
  };
24527
24576
 
24528
- // eslint-disable-next-line es/no-typed-arrays -- safe
24577
+ // eslint-disable-next-line es-x/no-typed-arrays -- safe
24529
24578
  var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
24530
24579
 
24531
24580
  var descriptors = !fails(function () {
24532
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
24581
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
24533
24582
  return Object.defineProperty({}, 1, {
24534
24583
  get: function () {
24535
24584
  return 7;
@@ -24576,6 +24625,7 @@
24576
24625
 
24577
24626
  var hasOwnProperty = functionUncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation
24578
24627
  // https://tc39.es/ecma262/#sec-hasownproperty
24628
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
24579
24629
 
24580
24630
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
24581
24631
  return hasOwnProperty(toObject(it), key);
@@ -24605,10 +24655,10 @@
24605
24655
  (module.exports = function (key, value) {
24606
24656
  return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
24607
24657
  })('versions', []).push({
24608
- version: '3.21.1',
24658
+ version: '3.22.2',
24609
24659
  mode: 'global',
24610
24660
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
24611
- license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
24661
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.2/LICENSE',
24612
24662
  source: 'https://github.com/zloirock/core-js'
24613
24663
  });
24614
24664
  });
@@ -24657,7 +24707,7 @@
24657
24707
 
24658
24708
  var engineV8Version = version;
24659
24709
 
24660
- /* eslint-disable es/no-symbol -- required for testing */
24710
+ /* eslint-disable es-x/no-symbol -- required for testing */
24661
24711
 
24662
24712
  var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
24663
24713
  var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion
@@ -24667,7 +24717,7 @@
24667
24717
  !Symbol.sham && engineV8Version && engineV8Version < 41;
24668
24718
  });
24669
24719
 
24670
- /* eslint-disable es/no-symbol -- required for testing */
24720
+ /* eslint-disable es-x/no-symbol -- required for testing */
24671
24721
  var useSymbolAsUid = nativeSymbol && !Symbol.sham && typeof Symbol.iterator == 'symbol';
24672
24722
 
24673
24723
  var WellKnownSymbolsStore = shared('wks');
@@ -24746,7 +24796,7 @@
24746
24796
  };
24747
24797
 
24748
24798
  var ie8DomDefine = !descriptors && !fails(function () {
24749
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
24799
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
24750
24800
  return Object.defineProperty(documentCreateElement('div'), 'a', {
24751
24801
  get: function () {
24752
24802
  return 7;
@@ -24757,7 +24807,7 @@
24757
24807
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
24758
24808
 
24759
24809
  var v8PrototypeDefineBug = descriptors && fails(function () {
24760
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
24810
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
24761
24811
  return Object.defineProperty(function () {
24762
24812
  /* empty */
24763
24813
  }, 'prototype', {
@@ -24836,9 +24886,9 @@
24836
24886
  return isSymbol(key) ? key : key + '';
24837
24887
  };
24838
24888
 
24839
- var TypeError$5 = global$1.TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe
24889
+ var TypeError$5 = global$1.TypeError; // eslint-disable-next-line es-x/no-object-defineproperty -- safe
24840
24890
 
24841
- var $defineProperty = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
24891
+ var $defineProperty = Object.defineProperty; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
24842
24892
 
24843
24893
  var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
24844
24894
  var ENUMERABLE = 'enumerable';
@@ -24988,7 +25038,7 @@
24988
25038
  getterFor: getterFor
24989
25039
  };
24990
25040
 
24991
- var FunctionPrototype$1 = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
25041
+ var FunctionPrototype$1 = Function.prototype; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
24992
25042
 
24993
25043
  var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
24994
25044
  var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name'); // additional protection from minified / mangled / dropped function names
@@ -25052,7 +25102,7 @@
25052
25102
  /* empty */
25053
25103
  }
25054
25104
 
25055
- F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
25105
+ F.prototype.constructor = null; // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
25056
25106
 
25057
25107
  return Object.getPrototypeOf(new F()) !== F.prototype;
25058
25108
  });
@@ -25085,7 +25135,7 @@
25085
25135
  /* eslint-disable no-proto -- safe */
25086
25136
  // https://tc39.es/ecma262/#sec-object.setprototypeof
25087
25137
  // Works with __proto__ only. Old v8 can't work with null proto objects.
25088
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
25138
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
25089
25139
 
25090
25140
  var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
25091
25141
  var CORRECT_SETTER = false;
@@ -25093,7 +25143,7 @@
25093
25143
  var setter;
25094
25144
 
25095
25145
  try {
25096
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
25146
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
25097
25147
  setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
25098
25148
  setter(test, []);
25099
25149
  CORRECT_SETTER = test instanceof Array;
@@ -25326,7 +25376,7 @@
25326
25376
  var aTypedArray = arrayBufferViewCore.aTypedArray;
25327
25377
  var exportTypedArrayMethod = arrayBufferViewCore.exportTypedArrayMethod;
25328
25378
  var WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS = !fails(function () {
25329
- // eslint-disable-next-line es/no-typed-arrays -- required for testing
25379
+ // eslint-disable-next-line es-x/no-typed-arrays -- required for testing
25330
25380
  var array = new Uint8ClampedArray(2);
25331
25381
  functionCall($set, array, {
25332
25382
  length: 1,
@@ -25481,6 +25531,10 @@
25481
25531
  }
25482
25532
  }
25483
25533
 
25534
+ hasTag(str) {
25535
+ return this.firstAlignment.hasTag(str) || this.secondAlignment && this.secondAlignment.hasTag(str);
25536
+ }
25537
+
25484
25538
  }
25485
25539
 
25486
25540
  /*
@@ -28869,7 +28923,7 @@
28869
28923
 
28870
28924
  }
28871
28925
 
28872
- var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
28926
+ var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
28873
28927
 
28874
28928
  var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug
28875
28929
 
@@ -28980,7 +29034,7 @@
28980
29034
 
28981
29035
  var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method
28982
29036
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
28983
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
29037
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
28984
29038
 
28985
29039
  var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
28986
29040
  return objectKeysInternal(O, hiddenKeys);
@@ -28990,7 +29044,7 @@
28990
29044
  f: f$1
28991
29045
  };
28992
29046
 
28993
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
29047
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
28994
29048
  var f = Object.getOwnPropertySymbols;
28995
29049
  var objectGetOwnPropertySymbols = {
28996
29050
  f: f
@@ -29092,7 +29146,7 @@
29092
29146
 
29093
29147
  var FunctionPrototype = Function.prototype;
29094
29148
  var apply = FunctionPrototype.apply;
29095
- var call = FunctionPrototype.call; // eslint-disable-next-line es/no-reflect -- safe
29149
+ var call = FunctionPrototype.call; // eslint-disable-next-line es-x/no-reflect -- safe
29096
29150
 
29097
29151
  var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () {
29098
29152
  return call.apply(apply, arguments);
@@ -29226,20 +29280,28 @@
29226
29280
  clear: clear
29227
29281
  };
29228
29282
 
29229
- var FORCED = !global$1.setImmediate || !global$1.clearImmediate; // http://w3c.github.io/setImmediate/
29283
+ var clearImmediate = task.clear; // `clearImmediate` method
29284
+ // http://w3c.github.io/setImmediate/#si-clearImmediate
29230
29285
 
29231
29286
  _export({
29232
29287
  global: true,
29233
29288
  bind: true,
29234
29289
  enumerable: true,
29235
- forced: FORCED
29290
+ forced: global$1.clearImmediate !== clearImmediate
29236
29291
  }, {
29237
- // `setImmediate` method
29238
- // http://w3c.github.io/setImmediate/#si-setImmediate
29239
- setImmediate: task.set,
29240
- // `clearImmediate` method
29241
- // http://w3c.github.io/setImmediate/#si-clearImmediate
29242
- clearImmediate: task.clear
29292
+ clearImmediate: clearImmediate
29293
+ });
29294
+
29295
+ var setImmediate = task.set; // `setImmediate` method
29296
+ // http://w3c.github.io/setImmediate/#si-setImmediate
29297
+
29298
+ _export({
29299
+ global: true,
29300
+ bind: true,
29301
+ enumerable: true,
29302
+ forced: global$1.setImmediate !== setImmediate
29303
+ }, {
29304
+ setImmediate: setImmediate
29243
29305
  });
29244
29306
 
29245
29307
  const eval2 = eval;
@@ -45592,7 +45654,7 @@
45592
45654
  }
45593
45655
 
45594
45656
  get supportsWholeGenome() {
45595
- return false;
45657
+ return this.config.supportsWholeGenome === true;
45596
45658
  }
45597
45659
  /**
45598
45660
  * Does the track support sample names. Current sample aware tracks include VCF (with genotypes), MUT, MAF, and SEG
@@ -48271,20 +48333,36 @@
48271
48333
  const chords = [];
48272
48334
 
48273
48335
  for (let a of alignments) {
48274
- const mate = a.mate;
48275
-
48276
- if (mate && mate.chr && mate.position) {
48277
- chords.push({
48278
- uniqueId: a.readName,
48279
- refName: shortChrName(a.chr),
48280
- start: a.start,
48281
- end: a.end,
48282
- mate: {
48283
- refName: shortChrName(mate.chr),
48284
- start: mate.position - 1,
48285
- end: mate.position
48286
- }
48287
- });
48336
+ if (a.paired) {
48337
+ if (a.firstAlignment && a.secondAlignment) {
48338
+ chords.push({
48339
+ uniqueId: a.readName,
48340
+ refName: shortChrName(a.firstAlignment.chr),
48341
+ start: a.firstAlignment.start,
48342
+ end: a.firstAlignment.end,
48343
+ mate: {
48344
+ refName: shortChrName(a.secondAlignment.chr),
48345
+ start: a.secondAlignment.start,
48346
+ end: a.secondAlignment.end
48347
+ }
48348
+ });
48349
+ }
48350
+ } else {
48351
+ const mate = a.mate;
48352
+
48353
+ if (mate && mate.chr && mate.position) {
48354
+ chords.push({
48355
+ uniqueId: a.readName,
48356
+ refName: shortChrName(a.chr),
48357
+ start: a.start,
48358
+ end: a.end,
48359
+ mate: {
48360
+ refName: shortChrName(mate.chr),
48361
+ start: mate.position - 1,
48362
+ end: mate.position
48363
+ }
48364
+ });
48365
+ }
48288
48366
  }
48289
48367
  }
48290
48368
 
@@ -48292,9 +48370,7 @@
48292
48370
  };
48293
48371
 
48294
48372
  const makeSupplementalAlignmentChords = alignments => {
48295
- const chords = [];
48296
-
48297
- for (let a of alignments) {
48373
+ const makeChords = a => {
48298
48374
  const sa = a.tags()['SA'];
48299
48375
  const supAl = createSupplementaryAlignments(sa);
48300
48376
  let n = 0;
@@ -48314,6 +48390,20 @@
48314
48390
  });
48315
48391
  }
48316
48392
  }
48393
+ };
48394
+
48395
+ const chords = [];
48396
+
48397
+ for (let a of alignments) {
48398
+ if (a.paired) {
48399
+ makeChords(a.firstAlignment);
48400
+
48401
+ if (a.secondAlignment) {
48402
+ makeChords(a.secondAlignment);
48403
+ }
48404
+ } else {
48405
+ makeChords(a);
48406
+ }
48317
48407
  }
48318
48408
 
48319
48409
  return chords;
@@ -49040,8 +49130,16 @@
49040
49130
  const refFrame = viewport.referenceFrame;
49041
49131
 
49042
49132
  for (let a of viewport.cachedFeatures.allAlignments()) {
49043
- if (a.end >= refFrame.start && a.start <= refFrame.end && a.mate && a.mate.chr && (a.mate.chr !== a.chr || Math.max(a.fragmentLength) > maxTemplateLength)) {
49044
- inView.push(a);
49133
+ if (a.end >= refFrame.start && a.start <= refFrame.end) {
49134
+ if (a.paired) {
49135
+ if (a.end - a.start > maxTemplateLength) {
49136
+ inView.push(a);
49137
+ }
49138
+ } else {
49139
+ if (a.mate && a.mate.chr && (a.mate.chr !== a.chr || Math.max(a.fragmentLength) > maxTemplateLength)) {
49140
+ inView.push(a);
49141
+ }
49142
+ }
49045
49143
  }
49046
49144
  }
49047
49145
 
@@ -50566,7 +50664,7 @@
50566
50664
  sampleNameViewport.setWidth(this.browser.sampleNameViewportWidth);
50567
50665
  }
50568
50666
 
50569
- this.browser.resize();
50667
+ this.browser.layoutChange();
50570
50668
  }
50571
50669
  };
50572
50670
  this.browser.inputDialog.present(config, event);
@@ -56093,7 +56191,7 @@
56093
56191
  const len = Math.min(rows.length, maxRows);
56094
56192
 
56095
56193
  for (r = 0; r < len; r++) {
56096
- if (feature.start > rows[r]) {
56194
+ if (feature.start >= rows[r]) {
56097
56195
  feature.row = r;
56098
56196
  rows[r] = feature.end;
56099
56197
  break;
@@ -57566,7 +57664,7 @@
57566
57664
  }
57567
57665
 
57568
57666
  supportsWholeGenome() {
57569
- return this.reader.type === "bigwig" || this.defaultVisibilityWindow() <= 0;
57667
+ return this.reader.type === "bigwig";
57570
57668
  }
57571
57669
 
57572
57670
  async trackType() {
@@ -58824,7 +58922,15 @@
58824
58922
  }
58825
58923
 
58826
58924
  get supportsWholeGenome() {
58827
- return (this.config.indexed === false || !this.config.indexURL) && this.config.supportsWholeGenome !== false;
58925
+ if (this.config.supportsWholeGenome !== undefined) {
58926
+ return this.config.supportsWholeGenome;
58927
+ } else if (this.featureSource && typeof this.featureSource.supportsWholeGenome === 'function') {
58928
+ return this.featureSource.supportsWholeGenome();
58929
+ } else {
58930
+ if (this.visibilityWindow === undefined && (this.config.indexed === false || !this.config.indexURL)) {
58931
+ return true;
58932
+ }
58933
+ }
58828
58934
  }
58829
58935
 
58830
58936
  async getFeatures(chr, start, end, bpPerPixel) {
@@ -61391,9 +61497,9 @@
61391
61497
  'fillStyle': "rgb(255, 255, 255)"
61392
61498
  });
61393
61499
  const vGap = "SQUISHED" === this.displayMode ? this.squishedVGap : this.expandedVGap;
61394
- const rc = "COLLAPSED" === this.displayMode ? 1 : this.nVariantRows;
61500
+ const rowCount = "COLLAPSED" === this.displayMode ? 1 : this.nVariantRows;
61395
61501
  const variantHeight = "SQUISHED" === this.displayMode ? this.squishedVariantHeight : this.expandedVariantHeight;
61396
- this.variantBandHeight = TOP_MARGIN + rc * (variantHeight + vGap);
61502
+ this.variantBandHeight = TOP_MARGIN + rowCount * (variantHeight + vGap);
61397
61503
  const callSets = this.callSets;
61398
61504
  const nCalls = this.getCallsetsLength();
61399
61505
 
@@ -61535,7 +61641,10 @@
61535
61641
  // Variant
61536
61642
  const variantHeight = "SQUISHED" === this.displayMode ? this.squishedVariantHeight : this.expandedVariantHeight;
61537
61643
  const variantRow = Math.floor((yOffset - TOP_MARGIN) / (variantHeight + vGap));
61538
- featureList = featureList.filter(f => f.row === variantRow);
61644
+
61645
+ if ("COLLAPSED" !== this.displayMode) {
61646
+ featureList = featureList.filter(f => f.row === variantRow);
61647
+ }
61539
61648
  } else if (this.callSets) {
61540
61649
  const callSets = this.callSets;
61541
61650
  const sampleY = yOffset - this.variantBandHeight;
@@ -61543,7 +61652,7 @@
61543
61652
 
61544
61653
  if (sampleRow >= 0 && sampleRow < callSets.length) {
61545
61654
  const variantRow = Math.floor((sampleY - sampleRow * this.sampleHeight) / callHeight);
61546
- const variants = featureList.filter(f => f.row === variantRow);
61655
+ const variants = "COLLAPSED" === this.displayMode ? featureList : featureList.filter(f => f.row === variantRow);
61547
61656
  const cs = callSets[sampleRow];
61548
61657
  featureList = variants.map(v => {
61549
61658
  const call = v.calls[cs.id];
@@ -65409,7 +65518,7 @@
65409
65518
  }
65410
65519
  }
65411
65520
 
65412
- browser.resize();
65521
+ browser.layoutChange();
65413
65522
  });
65414
65523
  }
65415
65524
 
@@ -67032,8 +67141,18 @@
67032
67141
  trackView.setTrackHeight(newHeight);
67033
67142
  });
67034
67143
  }
67144
+ /**
67145
+ * API function to signal that this browser visibility has changed, e.g. from hiding/showing in a tab interface.
67146
+ *
67147
+ * @returns {Promise<void>}
67148
+ */
67149
+
67035
67150
 
67036
67151
  async visibilityChange() {
67152
+ this.layoutChange();
67153
+ }
67154
+
67155
+ async layoutChange() {
67037
67156
  const status = this.referenceFrameList.find(referenceFrame => referenceFrame.bpPerPixel < 0);
67038
67157
 
67039
67158
  if (status) {