igv 2.13.9 → 2.13.10

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
@@ -12,19 +12,19 @@ Below are examples and a quickstart guide. See the [Wiki](https://github.com/ig
12
12
 
13
13
  # Examples
14
14
 
15
- ***[Alignments](https://igv.org/web/release/2.13.9/examples/cram-vcf.html)***
15
+ ***[Alignments](https://igv.org/web/release/2.13.10/examples/cram-vcf.html)***
16
16
 
17
- ***[Interactions](https://igv.org/web/release/2.13.9/examples/interact.html)***
17
+ ***[Interactions](https://igv.org/web/release/2.13.10/examples/interact.html)***
18
18
 
19
- ***[Copy number](https://igv.org/web/release/2.13.9/examples/copyNumber.html)***
19
+ ***[Copy number](https://igv.org/web/release/2.13.10/examples/copyNumber.html)***
20
20
 
21
- ***[Multiple regions](https://igv.org/web/release/2.13.9/examples/multi-locus.html)***
21
+ ***[Multiple regions](https://igv.org/web/release/2.13.10/examples/multi-locus.html)***
22
22
 
23
- ***[Mutation Annotation Format (MAF)](https://igv.org/web/release/2.13.9/examples/maf-tcga.html)***
23
+ ***[Mutation Annotation Format (MAF)](https://igv.org/web/release/2.13.10/examples/maf-tcga.html)***
24
24
 
25
- ***[Variant color options](https://igv.org/web/release/2.13.9/examples/variant-colors.html)***
25
+ ***[Variant color options](https://igv.org/web/release/2.13.10/examples/variant-colors.html)***
26
26
 
27
- ***[More](https://igv.org/web/release/2.13.9/examples/)***
27
+ ***[More](https://igv.org/web/release/2.13.10/examples/)***
28
28
 
29
29
 
30
30
  # Quickstart
@@ -33,18 +33,18 @@ Below are examples and a quickstart guide. See the [Wiki](https://github.com/ig
33
33
  igv.js consists of a single javascript file with no external dependencies.
34
34
 
35
35
  Pre-built files for ES5 (igv.min.js) and ES6 (igv.esm.min.js)
36
- can be downloaded from [https://cdn.jsdelivr.net/npm/igv@2.13.9/dist/](https://cdn.jsdelivr.net/npm/igv@2.13.9/dist/).
36
+ can be downloaded from [https://cdn.jsdelivr.net/npm/igv@2.13.10/dist/](https://cdn.jsdelivr.net/npm/igv@2.13.10/dist/).
37
37
 
38
38
  To import igv as an ES6 module
39
39
 
40
40
  ```javascript
41
- import igv from "https://cdn.jsdelivr.net/npm/igv@2.13.9/dist/igv.esm.min.js"
41
+ import igv from "https://cdn.jsdelivr.net/npm/igv@2.13.10/dist/igv.esm.min.js"
42
42
  ```
43
43
 
44
44
  Or as a script include (defines the "igv" global)
45
45
 
46
46
  ```html
47
- <script src="https://cdn.jsdelivr.net/npm/igv@2.13.9/dist/igv.min.js"></script>
47
+ <script src="https://cdn.jsdelivr.net/npm/igv@2.13.10/dist/igv.min.js"></script>
48
48
  ```
49
49
 
50
50
  Alternatively you can install with npm
package/dist/igv.esm.js CHANGED
@@ -24211,7 +24211,7 @@ const Cytoband = function (start, end, name, typestain) {
24211
24211
  }
24212
24212
  };
24213
24213
 
24214
- const _version = "2.13.9";
24214
+ const _version = "2.13.10";
24215
24215
  function version() {
24216
24216
  return _version
24217
24217
  }
@@ -30100,13 +30100,17 @@ class BGZBlockLoader {
30100
30100
  /**
30101
30101
  * Return inflated data from startBlock through endBlock as an UInt8Array
30102
30102
  *
30103
- * @param startBlock
30104
- * @param endBlock
30103
+ * @param minv minimum virtual pointer {block, offset}
30104
+ * @param maxv maximum virtual pointer {block, offset}
30105
30105
  * @returns {Promise<Uint8Array>}
30106
30106
  */
30107
- async getData(startBlock, endBlock) {
30107
+ async getData(minv, maxv) {
30108
+
30109
+ const startBlock = minv.block;
30110
+ const endBlock = maxv.block;
30111
+ const skipEnd = maxv.offset === 0;
30108
30112
 
30109
- const blocks = await this.getInflatedBlocks(startBlock, endBlock);
30113
+ const blocks = await this.getInflatedBlocks(startBlock, endBlock, skipEnd);
30110
30114
  if (blocks.length === 1) {
30111
30115
  return blocks[0]
30112
30116
  }
@@ -30131,16 +30135,18 @@ class BGZBlockLoader {
30131
30135
  * @param endBlock
30132
30136
  * @returns {Promise<*[Uint8Array]>}
30133
30137
  */
30134
- async getInflatedBlocks(startBlock, endBlock) {
30138
+ async getInflatedBlocks(startBlock, endBlock, skipEnd) {
30135
30139
 
30136
30140
  if (!this.cacheBlocks) {
30137
- const buffer = await this.loadBLockData(startBlock, endBlock);
30141
+ const buffer = await this.loadBLockData(startBlock, endBlock, {skipEnd});
30138
30142
  return inflateBlocks(buffer)
30139
30143
  } else {
30140
30144
 
30141
30145
  const c = this.cache;
30142
- if (c && (c.startBlock <= startBlock && c.endBlock >= endBlock)) {
30143
- //console.log("Complete overlap")
30146
+ if (c &&
30147
+ c.startBlock <= startBlock &&
30148
+ (c.endBlock >= endBlock || skipEnd && c.nextEndBlock === endBlock)) {
30149
+ console.log("Complete overlap");
30144
30150
  const startOffset = startBlock - c.startBlock;
30145
30151
  const endOffset = endBlock - c.startBlock;
30146
30152
  return inflateBlocks(c.buffer, startOffset, endOffset)
@@ -30150,7 +30156,7 @@ class BGZBlockLoader {
30150
30156
  let buffer;
30151
30157
  if (!c || (c.startBlock > endBlock || c.endBlock < startBlock)) {
30152
30158
  // no overlap with cache
30153
- buffer = await this.loadBLockData(startBlock, endBlock);
30159
+ buffer = await this.loadBLockData(startBlock, endBlock, {skipEnd});
30154
30160
  } else {
30155
30161
 
30156
30162
  //console.log("Some overlap")
@@ -30189,14 +30195,21 @@ class BGZBlockLoader {
30189
30195
 
30190
30196
  // Load end blocks, if any
30191
30197
  if (endBlock > c.endBlock) {
30192
- const endBuffer = await this.loadBLockData(c.endBlock, endBlock, {skipStart: true});
30198
+ const endBuffer = await this.loadBLockData(c.endBlock, endBlock, {skipStart: true, skipEnd});
30193
30199
  arrayBuffers.push(endBuffer);
30194
30200
  }
30195
30201
 
30196
30202
  buffer = concatenateArrayBuffers(arrayBuffers);
30197
30203
  }
30198
30204
 
30199
- this.cache = {startBlock, endBlock, buffer};
30205
+ // If skipEnd === true we need to find boundary of last block in cache
30206
+ let nextEndBlock = endBlock;
30207
+ if(skipEnd) {
30208
+ const boundaries = findBlockBoundaries(buffer);
30209
+ endBlock = boundaries[boundaries.length - 1];
30210
+ }
30211
+
30212
+ this.cache = {startBlock, endBlock, nextEndBlock, buffer};
30200
30213
  return inflateBlocks(buffer)
30201
30214
  }
30202
30215
  }
@@ -30514,7 +30527,7 @@ class FeatureFileReader {
30514
30527
 
30515
30528
  let inflated;
30516
30529
  if (tabix) {
30517
- inflated = await this._blockLoader.getData(chunk.minv.block, chunk.maxv.block);
30530
+ inflated = await this._blockLoader.getData(chunk.minv, chunk.maxv);
30518
30531
  } else {
30519
30532
  const options = buildOptions(config, {
30520
30533
  range: {
@@ -36651,7 +36664,7 @@ class BamReader {
36651
36664
  }
36652
36665
 
36653
36666
  for (let c of chunks) {
36654
- const ba = await this._blockLoader.getData(c.minv.block, c.maxv.block);
36667
+ const ba = await this._blockLoader.getData(c.minv, c.maxv);
36655
36668
  const done = BamUtils.decodeBamRecords(ba, c.minv.offset, alignmentContainer, this.indexToChr, chrId, bpStart, bpEnd, this.filter);
36656
36669
  if (done) {
36657
36670
  break