igv 3.4.0 → 3.4.1

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
@@ -22348,7 +22348,7 @@
22348
22348
  }
22349
22349
 
22350
22350
  function getDecoder(definedFieldCount, fieldCount, autoSql, format) {
22351
-
22351
+ //biggenepred
22352
22352
  if ("biginteract" === format || (autoSql && ('chromatinInteract' === autoSql.table || 'interact' === autoSql.table))) {
22353
22353
  return decodeInteract
22354
22354
  } else {
@@ -22395,9 +22395,20 @@
22395
22395
  const extraStart = definedFieldCount;
22396
22396
  for (let i = extraStart; i < fieldCount; i++) {
22397
22397
  if (i < autoSql.fields.length) {
22398
+
22398
22399
  const name = autoSql.fields[i].name;
22399
- const value = tokens[i - 3];
22400
- feature[name] = value;
22400
+
22401
+ if (name === "exonFrames") {
22402
+ const frameOffsets = tokens[i - 3].replace(/,$/, '').split(',');
22403
+ for (let i = 0; i < feature.exons.length; i++) {
22404
+ const exon = feature.exons[i];
22405
+ const fo = parseInt(frameOffsets[i]);
22406
+ if (fo != -1) exon.readingFrame = fo;
22407
+ }
22408
+ } else {
22409
+ const value = tokens[i - 3];
22410
+ feature[name] = value;
22411
+ }
22401
22412
  }
22402
22413
  }
22403
22414
  }
@@ -22443,6 +22454,7 @@
22443
22454
 
22444
22455
  return feature
22445
22456
  }
22457
+
22446
22458
  }
22447
22459
 
22448
22460
  function findUTRs(exons, cdStart, cdEnd) {
@@ -23037,7 +23049,7 @@
23037
23049
  return false
23038
23050
  });
23039
23051
  if (matching.length > 0) {
23040
- return matching.reduce((l, f) => (l.end - l.start) > (f.end - f.start) ? l : f, features[0])
23052
+ return matching.reduce((l, f) => (l.end - l.start) > (f.end - f.start) ? l : f, matching[0])
23041
23053
  } else {
23042
23054
  return undefined
23043
23055
  }
@@ -26931,7 +26943,7 @@
26931
26943
  let aaLetter;
26932
26944
  if (undefined === aminoAcidLetter) {
26933
26945
 
26934
- if(sequenceInterval.hasSequence(start, end)) {
26946
+ if (sequenceInterval.hasSequence(start, end)) {
26935
26947
 
26936
26948
  const sequence = sequenceInterval.getSequence(start, end);
26937
26949
  if (sequence && 3 === sequence.length) {
@@ -27067,7 +27079,8 @@
27067
27079
  try {
27068
27080
  ctx.save();
27069
27081
 
27070
- let name = feature.name;
27082
+ const labelField = this.config.labelField ? this.config.labelField : 'name';
27083
+ let name = feature[labelField];
27071
27084
  if (name === undefined && feature.gene) name = feature.gene.name;
27072
27085
  if (name === undefined) name = feature.id || feature.ID;
27073
27086
  if (!name || name === '.') return
@@ -27100,20 +27113,13 @@
27100
27113
  if (options.labelAllFeatures || xleft > lastLabelX || selected) {
27101
27114
  options.rowLastLabelX[feature.row] = xright;
27102
27115
 
27103
- if ('y' === options.axis) {
27104
- // TODO -- is this ever used?
27105
- ctx.save();
27106
- IGVGraphics.labelTransformWithContext(ctx, centerX);
27107
- IGVGraphics.fillText(ctx, name, centerX, labelY, geneFontStyle, transform);
27108
- ctx.restore();
27109
- } else {
27110
- ctx.clearRect(
27111
- centerX - textMetrics.width / 2 - 1,
27112
- labelY - textMetrics.actualBoundingBoxAscent - 1,
27113
- textMetrics.width + 2,
27114
- textMetrics.actualBoundingBoxAscent + textMetrics.actualBoundingBoxDescent + 2);
27115
- IGVGraphics.fillText(ctx, name, centerX, labelY, geneFontStyle, transform);
27116
- }
27116
+ ctx.clearRect(
27117
+ centerX - textMetrics.width / 2 - 1,
27118
+ labelY - textMetrics.actualBoundingBoxAscent - 1,
27119
+ textMetrics.width + 2,
27120
+ textMetrics.actualBoundingBoxAscent + textMetrics.actualBoundingBoxDescent + 2);
27121
+ IGVGraphics.fillText(ctx, name, centerX, labelY, geneFontStyle, transform);
27122
+
27117
27123
  }
27118
27124
 
27119
27125
  } finally {
@@ -27527,7 +27533,11 @@
27527
27533
  // If drawing amino acids fetch cached sequence interval. It is not needed if track does not support AA, but
27528
27534
  // costs nothing since only a reference to a cached object is fetched.
27529
27535
  if (bpPerPixel < aminoAcidSequenceRenderThreshold) {
27530
- options.sequenceInterval = this.browser.genome.getSequenceInterval(referenceFrame.chr, bpStart, bpEnd);
27536
+ // Restrict the range requested to the limits: 1-chromosome.bpLength
27537
+ const chromosome = this.browser.genome.getChromosome(referenceFrame.chr);
27538
+ const chromosomeEnd = chromosome.bpLength;
27539
+ options.sequenceInterval = this.browser.genome.getSequenceInterval(referenceFrame.chr,
27540
+ bpStart > 0 ? bpStart : 0, bpEnd > chromosomeEnd ? chromosomeEnd : bpEnd);
27531
27541
  }
27532
27542
 
27533
27543
 
@@ -28632,7 +28642,7 @@
28632
28642
  }
28633
28643
 
28634
28644
  items.push({
28635
- label: 'BLAT read sequence',
28645
+ label: 'BLAT visible sequence',
28636
28646
  click: async () => {
28637
28647
  let sequence = await this.browser.genome.getSequence(chr, start, end);
28638
28648
  if (sequence) {
@@ -31270,7 +31280,6 @@
31270
31280
  if (t.hasProperty("searchTrix")) {
31271
31281
  config.trixURL = t.getProperty("searchTrix");
31272
31282
  }
31273
-
31274
31283
  if (t.hasProperty("group")) {
31275
31284
  config._group = t.getProperty("group");
31276
31285
  if (this.groupPriorityMap && this.groupPriorityMap.has(config._group)) {
@@ -31279,6 +31288,12 @@
31279
31288
  this.groupPriorityMap.set(config._group, nextPriority);
31280
31289
  }
31281
31290
  }
31291
+ const labelFields = t.hasProperty("defaultLabelFields") ?
31292
+ t.getProperty("defaultLabelFields") :
31293
+ t.getProperty("labelFields");
31294
+ if (labelFields) {
31295
+ config.labelField = labelFields.split(",")[0];
31296
+ }
31282
31297
 
31283
31298
  return config
31284
31299
  }
@@ -31419,9 +31434,9 @@
31419
31434
  }
31420
31435
 
31421
31436
 
31422
- const i = line.indexOf(' ');
31423
- const key = line.substring(0, i).trim();
31424
- let value = line.substring(i + 1).trim();
31437
+ const index = line.indexOf(' ');
31438
+ const key = line.substring(0, index).trim();
31439
+ let value = line.substring(index + 1).trim();
31425
31440
 
31426
31441
  if (key === "type") {
31427
31442
  // The "type" property contains format and sometimes other information. For example, data range
@@ -49383,7 +49398,7 @@
49383
49398
 
49384
49399
  if (seqstring.length < maxSequenceSize$1) {
49385
49400
  list.push({
49386
- label: 'BLAT read sequence',
49401
+ label: 'BLAT visible sequence',
49387
49402
  click: () => {
49388
49403
  const sequence = clickedAlignment.isNegativeStrand() ? reverseComplementSequence(seqstring) : seqstring;
49389
49404
  const name = `${clickedAlignment.readName} - blat`;
@@ -70324,7 +70339,7 @@ ${indent}columns: ${matrix.columns}
70324
70339
  })
70325
70340
  }
70326
70341
 
70327
- const _version = "3.4.0";
70342
+ const _version = "3.4.1";
70328
70343
  function version() {
70329
70344
  return _version
70330
70345
  }
@@ -74899,7 +74914,10 @@ ${indent}columns: ${matrix.columns}
74899
74914
 
74900
74915
  const locusFound = await this.search(locus, true);
74901
74916
  if (!locusFound) {
74902
- throw new Error(`Cannot set initial locus ${locus}`)
74917
+ console.error(`Cannot set initial locus ${locus}`);
74918
+ if(locus !== genome.initialLocus) {
74919
+ await this.search(genome.initialLocus);
74920
+ }
74903
74921
  }
74904
74922
 
74905
74923
  if (genomeChange) {