igv 2.15.6 → 2.15.7

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 [Wiki](https://github.com/ig
18
18
 
19
19
  # Examples
20
20
 
21
- ***[Alignments](https://igv.org/web/release/2.15.5/examples/cram-vcf.html)***
21
+ ***[Alignments](https://igv.org/web/release/2.15.7/examples/cram-vcf.html)***
22
22
 
23
- ***[Interactions](https://igv.org/web/release/2.15.5/examples/interact.html)***
23
+ ***[Interactions](https://igv.org/web/release/2.15.7/examples/interact.html)***
24
24
 
25
- ***[Copy number](https://igv.org/web/release/2.15.5/examples/copyNumber.html)***
25
+ ***[Copy number](https://igv.org/web/release/2.15.7/examples/copyNumber.html)***
26
26
 
27
- ***[Multiple regions](https://igv.org/web/release/2.15.5/examples/multi-locus.html)***
27
+ ***[Multiple regions](https://igv.org/web/release/2.15.7/examples/multi-locus.html)***
28
28
 
29
- ***[Mutation Annotation Format (MAF)](https://igv.org/web/release/2.15.5/examples/maf-tcga.html)***
29
+ ***[Mutation Annotation Format (MAF)](https://igv.org/web/release/2.15.7/examples/maf-tcga.html)***
30
30
 
31
- ***[Variant color options](https://igv.org/web/release/2.15.5/examples/variant-colors.html)***
31
+ ***[Variant color options](https://igv.org/web/release/2.15.7/examples/variant-colors.html)***
32
32
 
33
- ***[More](https://igv.org/web/release/2.15.5/examples/)***
33
+ ***[More](https://igv.org/web/release/2.15.7/examples/)***
34
34
 
35
35
 
36
36
  # Quickstart
@@ -39,18 +39,18 @@ Below are examples and a quickstart guide. See the [Wiki](https://github.com/ig
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@2.15.5/dist/](https://cdn.jsdelivr.net/npm/igv@2.15.5/dist/).
42
+ can be downloaded from [https://cdn.jsdelivr.net/npm/igv@2.15.7/dist/](https://cdn.jsdelivr.net/npm/igv@2.15.7/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@2.15.5/dist/igv.esm.min.js"
47
+ import igv from "https://cdn.jsdelivr.net/npm/igv@2.15.7/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@2.15.5/dist/igv.min.js"></script>
53
+ <script src="https://cdn.jsdelivr.net/npm/igv@2.15.7/dist/igv.min.js"></script>
54
54
  ```
55
55
 
56
56
  Alternatively you can install with npm
package/dist/igv.esm.js CHANGED
@@ -23938,7 +23938,7 @@ const Cytoband = function (start, end, name, typestain) {
23938
23938
  }
23939
23939
  };
23940
23940
 
23941
- const _version = "2.15.6";
23941
+ const _version = "2.15.7";
23942
23942
  function version() {
23943
23943
  return _version
23944
23944
  }
@@ -32163,30 +32163,45 @@ class BufferedReader {
32163
32163
  * @param fulfill - function to receive result
32164
32164
  * @param asUint8 - optional flag to return result as an UInt8Array
32165
32165
  */
32166
- async dataViewForRange(requestedRange, asUint8) {
32167
-
32168
- const hasData = (this.data && (this.range.start <= requestedRange.start) &&
32169
- ((this.range.start + this.range.size) >= (requestedRange.start + requestedRange.size)));
32166
+ async dataViewForRange(requestedRange, asUint8, retries = 0) {
32167
+ try {
32168
+ console.log(`buffered reader ${requestedRange}`);
32169
+ const hasData = (this.data && (this.range.start <= requestedRange.start) &&
32170
+ ((this.range.start + this.range.size) >= (requestedRange.start + requestedRange.size)));
32171
+
32172
+ if (!hasData) {
32173
+ let bufferSize;
32174
+ // If requested range size is specified, potentially expand buffer size
32175
+ if (requestedRange.size) {
32176
+ bufferSize = Math.max(this.bufferSize, requestedRange.size);
32177
+ } else {
32178
+ bufferSize = this.bufferSize;
32179
+ }
32180
+ if (this.contentLength) {
32181
+ bufferSize = Math.min(bufferSize, this.contentLength - requestedRange.start);
32182
+ }
32183
+ const loadRange = {start: requestedRange.start, size: bufferSize};
32184
+ const arrayBuffer = await igvxhr.loadArrayBuffer(this.path, buildOptions(this.config, {range: loadRange}));
32185
+ this.data = arrayBuffer;
32186
+ this.range = loadRange;
32187
+ }
32170
32188
 
32171
- if (!hasData) {
32172
- let bufferSize;
32173
- // If requested range size is specified, potentially expand buffer size
32174
- if (requestedRange.size) {
32175
- bufferSize = Math.max(this.bufferSize, requestedRange.size);
32176
- } else {
32177
- bufferSize = this.bufferSize;
32189
+ const len = this.data.byteLength;
32190
+ const bufferStart = requestedRange.start - this.range.start;
32191
+ return asUint8 ?
32192
+ new Uint8Array(this.data, bufferStart, len - bufferStart) :
32193
+ new DataView(this.data, bufferStart, len - bufferStart)
32194
+ } catch (e) {
32195
+ if (retries === 0 && e.message && e.message.startsWith("416")) {
32196
+ try {
32197
+ this.contentLength = await igvxhr.getContentLength(this.path, buildOptions(this.config));
32198
+ return this.dataViewForRange(requestedRange, asUint8, ++retries)
32199
+ } catch (e1) {
32200
+ console.error(e1);
32201
+ }
32202
+ throw e
32178
32203
  }
32179
- const loadRange = {start: requestedRange.start, size: bufferSize};
32180
- const arrayBuffer = await igvxhr.loadArrayBuffer(this.path, buildOptions(this.config, {range: loadRange}));
32181
- this.data = arrayBuffer;
32182
- this.range = loadRange;
32183
32204
  }
32184
-
32185
- const len = this.data.byteLength;
32186
- const bufferStart = requestedRange.start - this.range.start;
32187
- return asUint8 ?
32188
- new Uint8Array(this.data, bufferStart, len - bufferStart) :
32189
- new DataView(this.data, bufferStart, len - bufferStart)
32190
32205
  }
32191
32206
  }
32192
32207