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/README.md CHANGED
@@ -18,19 +18,19 @@ Below are examples and a quickstart guide. See the [developer documentation](ht
18
18
 
19
19
  # Examples
20
20
 
21
- ***[Alignments](https://igv.org/web/release/3.3.0/examples/cram-vcf.html)***
21
+ ***[Alignments](https://igv.org/web/release/3.4.1/examples/cram-vcf.html)***
22
22
 
23
- ***[Interactions](https://igv.org/web/release/3.3.0/examples/interact.html)***
23
+ ***[Interactions](https://igv.org/web/release/3.4.1/examples/interact.html)***
24
24
 
25
- ***[Copy number](https://igv.org/web/release/3.3.0/examples/copyNumber.html)***
25
+ ***[Copy number](https://igv.org/web/release/3.4.1/examples/copyNumber.html)***
26
26
 
27
- ***[Multiple regions](https://igv.org/web/release/3.3.0/examples/multi-locus.html)***
27
+ ***[Multiple regions](https://igv.org/web/release/3.4.1/examples/multi-locus.html)***
28
28
 
29
- ***[Mutation Annotation Format (MAF)](https://igv.org/web/release/3.3.0/examples/maf-tcga.html)***
29
+ ***[Mutation Annotation Format (MAF)](https://igv.org/web/release/3.4.1/examples/maf-tcga.html)***
30
30
 
31
- ***[Variant color options](https://igv.org/web/release/3.3.0/examples/variant-colors.html)***
31
+ ***[Variant color options](https://igv.org/web/release/3.4.1/examples/variant-colors.html)***
32
32
 
33
- ***[More](https://igv.org/web/release/3.3.0/examples/)***
33
+ ***[More](https://igv.org/web/release/3.4.1/examples/)***
34
34
 
35
35
 
36
36
  # Quickstart
@@ -39,18 +39,18 @@ Below are examples and a quickstart guide. See the [developer documentation](ht
39
39
  igv.js consists of a single javascript file with no external dependencies.
40
40
 
41
41
  Pre-built files for script include, AMD, or CJS module systems (igv.min.js) and an ES6 module (igv.esm.min.js)
42
- can be downloaded from [https://cdn.jsdelivr.net/npm/igv@3.3.0/dist/](https://cdn.jsdelivr.net/npm/igv@3.3.0/dist/).
42
+ can be downloaded from [https://cdn.jsdelivr.net/npm/igv@3.4.1/dist/](https://cdn.jsdelivr.net/npm/igv@3.4.1/dist/).
43
43
 
44
44
  To import igv as an ES6 module
45
45
 
46
46
  ```javascript
47
- import igv from "https://cdn.jsdelivr.net/npm/igv@3.3.0/dist/igv.esm.min.js"
47
+ import igv from "https://cdn.jsdelivr.net/npm/igv@3.4.1/dist/igv.esm.min.js"
48
48
  ```
49
49
 
50
50
  Or as a script include (defines the "igv" global)
51
51
 
52
52
  ```html
53
- <script src="https://cdn.jsdelivr.net/npm/igv@3.3.0/dist/igv.min.js"></script>
53
+ <script src="https://cdn.jsdelivr.net/npm/igv@3.4.1/dist/igv.min.js"></script>
54
54
  ```
55
55
 
56
56
  Alternatively you can install with npm
package/dist/igv.esm.js CHANGED
@@ -22342,7 +22342,7 @@ function overlaps(item, chrIdx1, startBase, chrIdx2, endBase) {
22342
22342
  }
22343
22343
 
22344
22344
  function getDecoder(definedFieldCount, fieldCount, autoSql, format) {
22345
-
22345
+ //biggenepred
22346
22346
  if ("biginteract" === format || (autoSql && ('chromatinInteract' === autoSql.table || 'interact' === autoSql.table))) {
22347
22347
  return decodeInteract
22348
22348
  } else {
@@ -22389,9 +22389,20 @@ function getDecoder(definedFieldCount, fieldCount, autoSql, format) {
22389
22389
  const extraStart = definedFieldCount;
22390
22390
  for (let i = extraStart; i < fieldCount; i++) {
22391
22391
  if (i < autoSql.fields.length) {
22392
+
22392
22393
  const name = autoSql.fields[i].name;
22393
- const value = tokens[i - 3];
22394
- feature[name] = value;
22394
+
22395
+ if (name === "exonFrames") {
22396
+ const frameOffsets = tokens[i - 3].replace(/,$/, '').split(',');
22397
+ for (let i = 0; i < feature.exons.length; i++) {
22398
+ const exon = feature.exons[i];
22399
+ const fo = parseInt(frameOffsets[i]);
22400
+ if (fo != -1) exon.readingFrame = fo;
22401
+ }
22402
+ } else {
22403
+ const value = tokens[i - 3];
22404
+ feature[name] = value;
22405
+ }
22395
22406
  }
22396
22407
  }
22397
22408
  }
@@ -22437,6 +22448,7 @@ function getDecoder(definedFieldCount, fieldCount, autoSql, format) {
22437
22448
 
22438
22449
  return feature
22439
22450
  }
22451
+
22440
22452
  }
22441
22453
 
22442
22454
  function findUTRs(exons, cdStart, cdEnd) {
@@ -23031,7 +23043,7 @@ class BWReader {
23031
23043
  return false
23032
23044
  });
23033
23045
  if (matching.length > 0) {
23034
- return matching.reduce((l, f) => (l.end - l.start) > (f.end - f.start) ? l : f, features[0])
23046
+ return matching.reduce((l, f) => (l.end - l.start) > (f.end - f.start) ? l : f, matching[0])
23035
23047
  } else {
23036
23048
  return undefined
23037
23049
  }
@@ -26925,7 +26937,7 @@ function renderAminoAcidSequence(ctx, strand, leftExon, exon, riteExon, bpStart,
26925
26937
  let aaLetter;
26926
26938
  if (undefined === aminoAcidLetter) {
26927
26939
 
26928
- if(sequenceInterval.hasSequence(start, end)) {
26940
+ if (sequenceInterval.hasSequence(start, end)) {
26929
26941
 
26930
26942
  const sequence = sequenceInterval.getSequence(start, end);
26931
26943
  if (sequence && 3 === sequence.length) {
@@ -27061,7 +27073,8 @@ function renderFeatureLabel(ctx, feature, featureX, featureX1, featureY, referen
27061
27073
  try {
27062
27074
  ctx.save();
27063
27075
 
27064
- let name = feature.name;
27076
+ const labelField = this.config.labelField ? this.config.labelField : 'name';
27077
+ let name = feature[labelField];
27065
27078
  if (name === undefined && feature.gene) name = feature.gene.name;
27066
27079
  if (name === undefined) name = feature.id || feature.ID;
27067
27080
  if (!name || name === '.') return
@@ -27094,20 +27107,13 @@ function renderFeatureLabel(ctx, feature, featureX, featureX1, featureY, referen
27094
27107
  if (options.labelAllFeatures || xleft > lastLabelX || selected) {
27095
27108
  options.rowLastLabelX[feature.row] = xright;
27096
27109
 
27097
- if ('y' === options.axis) {
27098
- // TODO -- is this ever used?
27099
- ctx.save();
27100
- IGVGraphics.labelTransformWithContext(ctx, centerX);
27101
- IGVGraphics.fillText(ctx, name, centerX, labelY, geneFontStyle, transform);
27102
- ctx.restore();
27103
- } else {
27104
- ctx.clearRect(
27105
- centerX - textMetrics.width / 2 - 1,
27106
- labelY - textMetrics.actualBoundingBoxAscent - 1,
27107
- textMetrics.width + 2,
27108
- textMetrics.actualBoundingBoxAscent + textMetrics.actualBoundingBoxDescent + 2);
27109
- IGVGraphics.fillText(ctx, name, centerX, labelY, geneFontStyle, transform);
27110
- }
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
+
27111
27117
  }
27112
27118
 
27113
27119
  } finally {
@@ -27521,7 +27527,11 @@ class FeatureTrack extends TrackBase {
27521
27527
  // If drawing amino acids fetch cached sequence interval. It is not needed if track does not support AA, but
27522
27528
  // costs nothing since only a reference to a cached object is fetched.
27523
27529
  if (bpPerPixel < aminoAcidSequenceRenderThreshold) {
27524
- options.sequenceInterval = this.browser.genome.getSequenceInterval(referenceFrame.chr, bpStart, bpEnd);
27530
+ // Restrict the range requested to the limits: 1-chromosome.bpLength
27531
+ const chromosome = this.browser.genome.getChromosome(referenceFrame.chr);
27532
+ const chromosomeEnd = chromosome.bpLength;
27533
+ options.sequenceInterval = this.browser.genome.getSequenceInterval(referenceFrame.chr,
27534
+ bpStart > 0 ? bpStart : 0, bpEnd > chromosomeEnd ? chromosomeEnd : bpEnd);
27525
27535
  }
27526
27536
 
27527
27537
 
@@ -28626,7 +28636,7 @@ class SequenceTrack {
28626
28636
  }
28627
28637
 
28628
28638
  items.push({
28629
- label: 'BLAT read sequence',
28639
+ label: 'BLAT visible sequence',
28630
28640
  click: async () => {
28631
28641
  let sequence = await this.browser.genome.getSequence(chr, start, end);
28632
28642
  if (sequence) {
@@ -31264,7 +31274,6 @@ isPcr dynablat-01.soe.ucsc.edu 4040 dynamic GCF/000/186/305/GCF_000186305.1
31264
31274
  if (t.hasProperty("searchTrix")) {
31265
31275
  config.trixURL = t.getProperty("searchTrix");
31266
31276
  }
31267
-
31268
31277
  if (t.hasProperty("group")) {
31269
31278
  config._group = t.getProperty("group");
31270
31279
  if (this.groupPriorityMap && this.groupPriorityMap.has(config._group)) {
@@ -31273,6 +31282,12 @@ isPcr dynablat-01.soe.ucsc.edu 4040 dynamic GCF/000/186/305/GCF_000186305.1
31273
31282
  this.groupPriorityMap.set(config._group, nextPriority);
31274
31283
  }
31275
31284
  }
31285
+ const labelFields = t.hasProperty("defaultLabelFields") ?
31286
+ t.getProperty("defaultLabelFields") :
31287
+ t.getProperty("labelFields");
31288
+ if (labelFields) {
31289
+ config.labelField = labelFields.split(",")[0];
31290
+ }
31276
31291
 
31277
31292
  return config
31278
31293
  }
@@ -31413,9 +31428,9 @@ async function loadStanzas(url) {
31413
31428
  }
31414
31429
 
31415
31430
 
31416
- const i = line.indexOf(' ');
31417
- const key = line.substring(0, i).trim();
31418
- let value = line.substring(i + 1).trim();
31431
+ const index = line.indexOf(' ');
31432
+ const key = line.substring(0, index).trim();
31433
+ let value = line.substring(index + 1).trim();
31419
31434
 
31420
31435
  if (key === "type") {
31421
31436
  // The "type" property contains format and sometimes other information. For example, data range
@@ -49377,7 +49392,7 @@ class AlignmentTrack extends TrackBase {
49377
49392
 
49378
49393
  if (seqstring.length < maxSequenceSize$1) {
49379
49394
  list.push({
49380
- label: 'BLAT read sequence',
49395
+ label: 'BLAT visible sequence',
49381
49396
  click: () => {
49382
49397
  const sequence = clickedAlignment.isNegativeStrand() ? reverseComplementSequence(seqstring) : seqstring;
49383
49398
  const name = `${clickedAlignment.readName} - blat`;
@@ -70318,7 +70333,7 @@ function createReferenceFrameList(loci, genome, browserFlanking, minimumBases, v
70318
70333
  })
70319
70334
  }
70320
70335
 
70321
- const _version = "3.4.0";
70336
+ const _version = "3.4.1";
70322
70337
  function version() {
70323
70338
  return _version
70324
70339
  }
@@ -74893,7 +74908,10 @@ class Browser {
74893
74908
 
74894
74909
  const locusFound = await this.search(locus, true);
74895
74910
  if (!locusFound) {
74896
- throw new Error(`Cannot set initial locus ${locus}`)
74911
+ console.error(`Cannot set initial locus ${locus}`);
74912
+ if(locus !== genome.initialLocus) {
74913
+ await this.search(genome.initialLocus);
74914
+ }
74897
74915
  }
74898
74916
 
74899
74917
  if (genomeChange) {