igv 2.12.3 → 2.12.6
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 +10 -10
- package/dist/igv.esm.js +106 -95
- package/dist/igv.esm.min.js +6 -6
- package/dist/igv.esm.min.js.map +1 -1
- package/dist/igv.js +1045 -937
- package/dist/igv.min.js +7 -7
- package/dist/igv.min.js.map +1 -1
- package/package.json +2 -2
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.12.
|
|
15
|
+
***[Alignments](https://igv.org/web/release/2.12.6/examples/cram-vcf.html)***
|
|
16
16
|
|
|
17
|
-
***[Interactions](https://igv.org/web/release/2.12.
|
|
17
|
+
***[Interactions](https://igv.org/web/release/2.12.6/examples/interact.html)***
|
|
18
18
|
|
|
19
|
-
***[Copy number](https://igv.org/web/release/2.12.
|
|
19
|
+
***[Copy number](https://igv.org/web/release/2.12.6/examples/copyNumber.html)***
|
|
20
20
|
|
|
21
|
-
***[Multiple regions](https://igv.org/web/release/2.12.
|
|
21
|
+
***[Multiple regions](https://igv.org/web/release/2.12.6/examples/multi-locus.html)***
|
|
22
22
|
|
|
23
|
-
***[Mutation Annotation Format (MAF)](https://igv.org/web/release/2.12.
|
|
23
|
+
***[Mutation Annotation Format (MAF)](https://igv.org/web/release/2.12.6/examples/maf-tcga.html)***
|
|
24
24
|
|
|
25
|
-
***[Variant color options](https://igv.org/web/release/2.12.
|
|
25
|
+
***[Variant color options](https://igv.org/web/release/2.12.6/examples/variant-colors.html)***
|
|
26
26
|
|
|
27
|
-
***[More](https://igv.org/web/release/2.12.
|
|
27
|
+
***[More](https://igv.org/web/release/2.12.6/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.12.
|
|
36
|
+
can be downloaded from [https://cdn.jsdelivr.net/npm/igv@2.12.6/dist/](https://cdn.jsdelivr.net/npm/igv@2.12.6/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.12.
|
|
41
|
+
import igv from "https://cdn.jsdelivr.net/npm/igv@2.12.6/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.12.
|
|
47
|
+
<script src="https://cdn.jsdelivr.net/npm/igv@2.12.6/dist/igv.min.js"></script>
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Alternatively you can install with npm
|
package/dist/igv.esm.js
CHANGED
|
@@ -16468,8 +16468,12 @@ const IGVColor = {
|
|
|
16468
16468
|
|
|
16469
16469
|
let dragData$1; // Its assumed we are only dragging one element at a time.
|
|
16470
16470
|
|
|
16471
|
+
let bbox = undefined;
|
|
16471
16472
|
|
|
16472
|
-
function makeDraggable$1(target, handle) {
|
|
16473
|
+
function makeDraggable$1(target, handle, constraint) {
|
|
16474
|
+
if (constraint) {
|
|
16475
|
+
bbox = Object.assign({}, constraint);
|
|
16476
|
+
}
|
|
16473
16477
|
handle.addEventListener('mousedown', dragStart$1.bind(target));
|
|
16474
16478
|
}
|
|
16475
16479
|
|
|
@@ -16512,8 +16516,13 @@ function drag$1(event) {
|
|
|
16512
16516
|
event.preventDefault();
|
|
16513
16517
|
const dx = event.screenX - dragData$1.screenX;
|
|
16514
16518
|
const dy = event.screenY - dragData$1.screenY;
|
|
16515
|
-
|
|
16516
|
-
|
|
16519
|
+
|
|
16520
|
+
// const left = bbox ? Math.max(bbox.minX, dragData.left + dx) : dragData.left + dx
|
|
16521
|
+
const left = dragData$1.left + dx;
|
|
16522
|
+
const top = bbox ? Math.max(bbox.minY, dragData$1.top + dy) : dragData$1.top + dy;
|
|
16523
|
+
|
|
16524
|
+
this.style.left = `${ left }px`;
|
|
16525
|
+
this.style.top = `${ top }px`;
|
|
16517
16526
|
}
|
|
16518
16527
|
|
|
16519
16528
|
function dragEnd$1(event) {
|
|
@@ -16801,9 +16810,9 @@ const igvxhr = {
|
|
|
16801
16810
|
options.responseType = "arraybuffer";
|
|
16802
16811
|
}
|
|
16803
16812
|
if (isFile(url)) {
|
|
16804
|
-
return loadFileSlice(url, options)
|
|
16813
|
+
return loadFileSlice(url, options)
|
|
16805
16814
|
} else {
|
|
16806
|
-
return load(url, options)
|
|
16815
|
+
return load(url, options)
|
|
16807
16816
|
}
|
|
16808
16817
|
},
|
|
16809
16818
|
|
|
@@ -16815,18 +16824,18 @@ const igvxhr = {
|
|
|
16815
16824
|
}
|
|
16816
16825
|
const result = await this.loadString(url, options);
|
|
16817
16826
|
if (result) {
|
|
16818
|
-
return JSON.parse(result)
|
|
16827
|
+
return JSON.parse(result)
|
|
16819
16828
|
} else {
|
|
16820
|
-
return result
|
|
16829
|
+
return result
|
|
16821
16830
|
}
|
|
16822
16831
|
},
|
|
16823
16832
|
|
|
16824
16833
|
loadString: async function (path, options) {
|
|
16825
16834
|
options = options || {};
|
|
16826
16835
|
if (path instanceof File) {
|
|
16827
|
-
return loadStringFromFile(path, options)
|
|
16836
|
+
return loadStringFromFile(path, options)
|
|
16828
16837
|
} else {
|
|
16829
|
-
return loadStringFromUrl(path, options)
|
|
16838
|
+
return loadStringFromUrl(path, options)
|
|
16830
16839
|
}
|
|
16831
16840
|
}
|
|
16832
16841
|
};
|
|
@@ -16840,15 +16849,15 @@ async function load(url, options) {
|
|
|
16840
16849
|
url = await (typeof url === 'function' ? url() : url);
|
|
16841
16850
|
|
|
16842
16851
|
if (isFile(url)) {
|
|
16843
|
-
return loadFileSlice(url, options)
|
|
16852
|
+
return loadFileSlice(url, options)
|
|
16844
16853
|
} else if (typeof url.startsWith === 'function') { // Test for string
|
|
16845
16854
|
if (url.startsWith("data:")) {
|
|
16846
16855
|
const buffer = decodeDataURI$1(url).buffer;
|
|
16847
|
-
if(options.range) {
|
|
16856
|
+
if (options.range) {
|
|
16848
16857
|
const rangeEnd = options.range.size ? options.range.start + options.range.size : buffer.byteLength;
|
|
16849
|
-
return buffer.slice(options.range.start, rangeEnd)
|
|
16858
|
+
return buffer.slice(options.range.start, rangeEnd)
|
|
16850
16859
|
} else {
|
|
16851
|
-
return buffer
|
|
16860
|
+
return buffer
|
|
16852
16861
|
}
|
|
16853
16862
|
} else {
|
|
16854
16863
|
if (url.startsWith("https://drive.google.com")) {
|
|
@@ -16859,11 +16868,11 @@ async function load(url, options) {
|
|
|
16859
16868
|
return loadURL(url, options)
|
|
16860
16869
|
})
|
|
16861
16870
|
} else {
|
|
16862
|
-
return loadURL(url, options)
|
|
16871
|
+
return loadURL(url, options)
|
|
16863
16872
|
}
|
|
16864
16873
|
}
|
|
16865
16874
|
} else {
|
|
16866
|
-
throw Error(`url must be either a 'File', 'string', 'function', or 'Promise'. Actual type: ${urlType}`)
|
|
16875
|
+
throw Error(`url must be either a 'File', 'string', 'function', or 'Promise'. Actual type: ${urlType}`)
|
|
16867
16876
|
}
|
|
16868
16877
|
}
|
|
16869
16878
|
|
|
@@ -16882,7 +16891,7 @@ async function loadURL(url, options) {
|
|
|
16882
16891
|
return new Promise(function (resolve, reject) {
|
|
16883
16892
|
|
|
16884
16893
|
// Various Google tansformations
|
|
16885
|
-
if (isGoogleURL(url)) {
|
|
16894
|
+
if (isGoogleURL(url) && !isGoogleStorageSigned(url)) {
|
|
16886
16895
|
if (isGoogleStorageURL(url)) {
|
|
16887
16896
|
url = translateGoogleCloudURL(url);
|
|
16888
16897
|
}
|
|
@@ -16906,7 +16915,7 @@ async function loadURL(url, options) {
|
|
|
16906
16915
|
const isChrome = navigator.userAgent.indexOf('Chrome') > -1;
|
|
16907
16916
|
navigator.vendor.indexOf("Apple") === 0 && /\sSafari\//.test(navigator.userAgent);
|
|
16908
16917
|
|
|
16909
|
-
if (range && isChrome && !isAmazonV4Signed(url)) {
|
|
16918
|
+
if (range && isChrome && !isAmazonV4Signed(url) && !isGoogleStorageSigned(url)) {
|
|
16910
16919
|
// Hack to prevent caching for byte-ranges. Attempt to fix net:err-cache errors in Chrome
|
|
16911
16920
|
url += url.includes("?") ? "&" : "?";
|
|
16912
16921
|
url += "someRandomSeed=" + Math.random().toString(36);
|
|
@@ -17011,7 +17020,7 @@ async function loadURL(url, options) {
|
|
|
17011
17020
|
if (reject) {
|
|
17012
17021
|
reject(error);
|
|
17013
17022
|
} else {
|
|
17014
|
-
throw error
|
|
17023
|
+
throw error
|
|
17015
17024
|
}
|
|
17016
17025
|
}
|
|
17017
17026
|
|
|
@@ -17043,60 +17052,38 @@ async function loadFileSlice(localfile, options) {
|
|
|
17043
17052
|
localfile.slice(options.range.start, options.range.start + options.range.size) :
|
|
17044
17053
|
localfile;
|
|
17045
17054
|
|
|
17055
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
17056
|
+
|
|
17046
17057
|
if ("arraybuffer" === options.responseType) {
|
|
17047
|
-
return
|
|
17058
|
+
return arrayBuffer
|
|
17048
17059
|
} else {
|
|
17049
|
-
|
|
17050
|
-
return new Promise(function (resolve, reject) {
|
|
17051
|
-
const fileReader = new FileReader();
|
|
17052
|
-
fileReader.onload = function (e) {
|
|
17053
|
-
resolve(fileReader.result);
|
|
17054
|
-
};
|
|
17055
|
-
fileReader.onerror = function (e) {
|
|
17056
|
-
console.error("reject uploading local file " + localfile.name);
|
|
17057
|
-
reject(null, fileReader);
|
|
17058
|
-
};
|
|
17059
|
-
fileReader.readAsBinaryString(blob);
|
|
17060
|
-
console.warn("Deprecated method used: readAsBinaryString");
|
|
17061
|
-
})
|
|
17060
|
+
return arrayBufferToString(arrayBuffer)
|
|
17062
17061
|
}
|
|
17063
17062
|
}
|
|
17064
17063
|
|
|
17065
17064
|
async function loadStringFromFile(localfile, options) {
|
|
17066
17065
|
|
|
17067
17066
|
const blob = options.range ? localfile.slice(options.range.start, options.range.start + options.range.size) : localfile;
|
|
17068
|
-
const arrayBuffer = await
|
|
17069
|
-
return arrayBufferToString(arrayBuffer)
|
|
17067
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
17068
|
+
return arrayBufferToString(arrayBuffer)
|
|
17070
17069
|
}
|
|
17071
17070
|
|
|
17072
|
-
async function blobToArrayBuffer(blob) {
|
|
17073
|
-
if (typeof blob.arrayBuffer === 'function') {
|
|
17074
|
-
return blob.arrayBuffer();
|
|
17075
|
-
}
|
|
17076
|
-
return new Promise(function (resolve, reject) {
|
|
17077
|
-
const fileReader = new FileReader();
|
|
17078
|
-
fileReader.onload = function (e) {
|
|
17079
|
-
resolve(fileReader.result);
|
|
17080
|
-
};
|
|
17081
|
-
fileReader.onerror = function (e) {
|
|
17082
|
-
console.error("reject uploading local file " + localfile.name);
|
|
17083
|
-
reject(null, fileReader);
|
|
17084
|
-
};
|
|
17085
|
-
fileReader.readAsArrayBuffer(blob);
|
|
17086
|
-
})
|
|
17087
|
-
}
|
|
17088
17071
|
|
|
17089
17072
|
async function loadStringFromUrl(url, options) {
|
|
17090
17073
|
|
|
17091
17074
|
options = options || {};
|
|
17092
17075
|
options.responseType = "arraybuffer";
|
|
17093
17076
|
const data = await igvxhr.load(url, options);
|
|
17094
|
-
return arrayBufferToString(data)
|
|
17077
|
+
return arrayBufferToString(data)
|
|
17095
17078
|
}
|
|
17096
17079
|
|
|
17097
17080
|
|
|
17098
17081
|
function isAmazonV4Signed(url) {
|
|
17099
|
-
return url.indexOf("X-Amz-Signature") > -1
|
|
17082
|
+
return url.indexOf("X-Amz-Signature") > -1
|
|
17083
|
+
}
|
|
17084
|
+
|
|
17085
|
+
function isGoogleStorageSigned(url) {
|
|
17086
|
+
return url.indexOf("X-Goog-Signature") > -1
|
|
17100
17087
|
}
|
|
17101
17088
|
|
|
17102
17089
|
function getOauthToken(url) {
|
|
@@ -17107,11 +17094,11 @@ function getOauthToken(url) {
|
|
|
17107
17094
|
parseUri(url).host;
|
|
17108
17095
|
let token = oauth.getToken(host);
|
|
17109
17096
|
if (token) {
|
|
17110
|
-
return token
|
|
17097
|
+
return token
|
|
17111
17098
|
} else if (host === undefined) {
|
|
17112
17099
|
const googleToken = getCurrentGoogleAccessToken();
|
|
17113
17100
|
if (googleToken && googleToken.expires_at > Date.now()) {
|
|
17114
|
-
return googleToken.access_token
|
|
17101
|
+
return googleToken.access_token
|
|
17115
17102
|
}
|
|
17116
17103
|
}
|
|
17117
17104
|
}
|
|
@@ -17127,7 +17114,7 @@ async function fetchGoogleAccessToken(url) {
|
|
|
17127
17114
|
if (isInitialized()) {
|
|
17128
17115
|
const scope = getScopeForURL(url);
|
|
17129
17116
|
const googleToken = await getAccessToken(scope);
|
|
17130
|
-
return googleToken ? googleToken.access_token : undefined
|
|
17117
|
+
return googleToken ? googleToken.access_token : undefined
|
|
17131
17118
|
} else {
|
|
17132
17119
|
throw Error(
|
|
17133
17120
|
`Authorization is required, but Google oAuth has not been initalized. Contact your site administrator for assistance.`)
|
|
@@ -17141,9 +17128,9 @@ async function fetchGoogleAccessToken(url) {
|
|
|
17141
17128
|
function getCurrentGoogleAccessToken() {
|
|
17142
17129
|
if (isInitialized()) {
|
|
17143
17130
|
const googleToken = getCurrentAccessToken();
|
|
17144
|
-
return googleToken ? googleToken.access_token : undefined
|
|
17131
|
+
return googleToken ? googleToken.access_token : undefined
|
|
17145
17132
|
} else {
|
|
17146
|
-
return undefined
|
|
17133
|
+
return undefined
|
|
17147
17134
|
}
|
|
17148
17135
|
}
|
|
17149
17136
|
|
|
@@ -17152,7 +17139,7 @@ function addOauthHeaders(headers, acToken) {
|
|
|
17152
17139
|
headers["Cache-Control"] = "no-cache";
|
|
17153
17140
|
headers["Authorization"] = "Bearer " + acToken;
|
|
17154
17141
|
}
|
|
17155
|
-
return headers
|
|
17142
|
+
return headers
|
|
17156
17143
|
}
|
|
17157
17144
|
|
|
17158
17145
|
|
|
@@ -17165,12 +17152,12 @@ function addApiKey(url) {
|
|
|
17165
17152
|
const paramSeparator = url.includes("?") ? "&" : "?";
|
|
17166
17153
|
url = url + paramSeparator + "key=" + apiKey;
|
|
17167
17154
|
}
|
|
17168
|
-
return url
|
|
17155
|
+
return url
|
|
17169
17156
|
}
|
|
17170
17157
|
|
|
17171
17158
|
function addTeamDrive(url) {
|
|
17172
17159
|
if (url.includes("supportsTeamDrive")) {
|
|
17173
|
-
return url
|
|
17160
|
+
return url
|
|
17174
17161
|
} else {
|
|
17175
17162
|
const paramSeparator = url.includes("?") ? "&" : "?";
|
|
17176
17163
|
url = url + paramSeparator + "supportsTeamDrive=true";
|
|
@@ -17184,17 +17171,17 @@ function addTeamDrive(url) {
|
|
|
17184
17171
|
function mapUrl(url) {
|
|
17185
17172
|
|
|
17186
17173
|
if (url.includes("//www.dropbox.com")) {
|
|
17187
|
-
return url.replace("//www.dropbox.com", "//dl.dropboxusercontent.com")
|
|
17174
|
+
return url.replace("//www.dropbox.com", "//dl.dropboxusercontent.com")
|
|
17188
17175
|
} else if (url.includes("//drive.google.com")) {
|
|
17189
|
-
return driveDownloadURL(url)
|
|
17176
|
+
return driveDownloadURL(url)
|
|
17190
17177
|
} else if (url.includes("//www.broadinstitute.org/igvdata")) {
|
|
17191
|
-
return url.replace("//www.broadinstitute.org/igvdata", "//data.broadinstitute.org/igvdata")
|
|
17178
|
+
return url.replace("//www.broadinstitute.org/igvdata", "//data.broadinstitute.org/igvdata")
|
|
17192
17179
|
} else if (url.includes("//igvdata.broadinstitute.org")) {
|
|
17193
17180
|
return url.replace("//igvdata.broadinstitute.org", "https://dn7ywbm9isq8j.cloudfront.net")
|
|
17194
17181
|
} else if (url.startsWith("ftp://ftp.ncbi.nlm.nih.gov/geo")) {
|
|
17195
17182
|
return url.replace("ftp://", "https://")
|
|
17196
17183
|
} else {
|
|
17197
|
-
return url
|
|
17184
|
+
return url
|
|
17198
17185
|
}
|
|
17199
17186
|
}
|
|
17200
17187
|
|
|
@@ -17209,9 +17196,9 @@ function arrayBufferToString(arraybuffer) {
|
|
|
17209
17196
|
}
|
|
17210
17197
|
|
|
17211
17198
|
if ('TextDecoder' in getGlobalObject()) {
|
|
17212
|
-
return new TextDecoder().decode(plain)
|
|
17199
|
+
return new TextDecoder().decode(plain)
|
|
17213
17200
|
} else {
|
|
17214
|
-
return decodeUTF8(plain)
|
|
17201
|
+
return decodeUTF8(plain)
|
|
17215
17202
|
}
|
|
17216
17203
|
}
|
|
17217
17204
|
|
|
@@ -17263,12 +17250,12 @@ function decodeUTF8(octets) {
|
|
|
17263
17250
|
|
|
17264
17251
|
function getGlobalObject() {
|
|
17265
17252
|
if (typeof self !== 'undefined') {
|
|
17266
|
-
return self
|
|
17253
|
+
return self
|
|
17267
17254
|
}
|
|
17268
17255
|
if (typeof global !== 'undefined') {
|
|
17269
|
-
return global
|
|
17256
|
+
return global
|
|
17270
17257
|
} else {
|
|
17271
|
-
return window
|
|
17258
|
+
return window
|
|
17272
17259
|
}
|
|
17273
17260
|
}
|
|
17274
17261
|
|
|
@@ -20506,10 +20493,15 @@ class SequenceTrack {
|
|
|
20506
20493
|
* @returns {*|{}}
|
|
20507
20494
|
*/
|
|
20508
20495
|
getState() {
|
|
20509
|
-
|
|
20510
|
-
|
|
20511
|
-
|
|
20512
|
-
if (this.
|
|
20496
|
+
const config = {
|
|
20497
|
+
type: "sequence"
|
|
20498
|
+
};
|
|
20499
|
+
if (this.order !== defaultSequenceTrackOrder) {
|
|
20500
|
+
config.order = this.order;
|
|
20501
|
+
}
|
|
20502
|
+
if (this.reversed) {
|
|
20503
|
+
config.revealed = true;
|
|
20504
|
+
}
|
|
20513
20505
|
return config
|
|
20514
20506
|
}
|
|
20515
20507
|
|
|
@@ -22809,7 +22801,7 @@ const Cytoband = function (start, end, name, typestain) {
|
|
|
22809
22801
|
}
|
|
22810
22802
|
};
|
|
22811
22803
|
|
|
22812
|
-
const _version = "2.12.
|
|
22804
|
+
const _version = "2.12.6";
|
|
22813
22805
|
function version() {
|
|
22814
22806
|
return _version
|
|
22815
22807
|
}
|
|
@@ -23873,7 +23865,7 @@ class TrackViewport extends Viewport {
|
|
|
23873
23865
|
menuItems.push({label: $$1('<HR>')});
|
|
23874
23866
|
}
|
|
23875
23867
|
|
|
23876
|
-
menuItems.push({label: 'Save Image (PNG)', click: () => this.
|
|
23868
|
+
menuItems.push({label: 'Save Image (PNG)', click: () => this.savePNG()});
|
|
23877
23869
|
menuItems.push({label: 'Save Image (SVG)', click: () => this.saveSVG()});
|
|
23878
23870
|
|
|
23879
23871
|
this.browser.menuPopup.presentTrackContextMenu(event, menuItems);
|
|
@@ -29048,8 +29040,12 @@ class BamSource {
|
|
|
29048
29040
|
*/
|
|
29049
29041
|
|
|
29050
29042
|
const fixColor = (colorString) => {
|
|
29051
|
-
|
|
29052
|
-
|
|
29043
|
+
if(isString$3(colorString)) {
|
|
29044
|
+
return (colorString.indexOf(",") > 0 && !colorString.startsWith("rgb(")) ?
|
|
29045
|
+
`rgb(${colorString})` : colorString
|
|
29046
|
+
} else {
|
|
29047
|
+
return colorString;
|
|
29048
|
+
}
|
|
29053
29049
|
};
|
|
29054
29050
|
|
|
29055
29051
|
/**
|
|
@@ -29203,7 +29199,7 @@ class TrackBase {
|
|
|
29203
29199
|
}
|
|
29204
29200
|
|
|
29205
29201
|
get supportsWholeGenome() {
|
|
29206
|
-
return
|
|
29202
|
+
return this.config.supportsWholeGenome === true
|
|
29207
29203
|
}
|
|
29208
29204
|
|
|
29209
29205
|
/**
|
|
@@ -39459,7 +39455,7 @@ function pack(featureList, maxRows) {
|
|
|
39459
39455
|
let r = 0;
|
|
39460
39456
|
const len = Math.min(rows.length, maxRows);
|
|
39461
39457
|
for (r = 0; r < len; r++) {
|
|
39462
|
-
if (feature.start
|
|
39458
|
+
if (feature.start >= rows[r]) {
|
|
39463
39459
|
feature.row = r;
|
|
39464
39460
|
rows[r] = feature.end;
|
|
39465
39461
|
break
|
|
@@ -40976,7 +40972,7 @@ class BWSource {
|
|
|
40976
40972
|
}
|
|
40977
40973
|
|
|
40978
40974
|
supportsWholeGenome() {
|
|
40979
|
-
return this.reader.type === "bigwig"
|
|
40975
|
+
return this.reader.type === "bigwig"
|
|
40980
40976
|
}
|
|
40981
40977
|
|
|
40982
40978
|
async trackType() {
|
|
@@ -42211,7 +42207,15 @@ class FeatureTrack extends TrackBase {
|
|
|
42211
42207
|
}
|
|
42212
42208
|
|
|
42213
42209
|
get supportsWholeGenome() {
|
|
42214
|
-
|
|
42210
|
+
if (this.config.supportsWholeGenome !== undefined) {
|
|
42211
|
+
return this.config.supportsWholeGenome
|
|
42212
|
+
} else if (this.featureSource && typeof this.featureSource.supportsWholeGenome === 'function') {
|
|
42213
|
+
return this.featureSource.supportsWholeGenome()
|
|
42214
|
+
} else {
|
|
42215
|
+
if (this.visibilityWindow === undefined && (this.config.indexed === false || !this.config.indexURL)) {
|
|
42216
|
+
return true
|
|
42217
|
+
}
|
|
42218
|
+
}
|
|
42215
42219
|
}
|
|
42216
42220
|
|
|
42217
42221
|
async getFeatures(chr, start, end, bpPerPixel) {
|
|
@@ -42268,7 +42272,7 @@ class FeatureTrack extends TrackBase {
|
|
|
42268
42272
|
options.rowLastX = [];
|
|
42269
42273
|
options.rowLastLabelX = [];
|
|
42270
42274
|
for (let feature of featureList) {
|
|
42271
|
-
if(feature.start > bpStart && feature.end < bpEnd) {
|
|
42275
|
+
if (feature.start > bpStart && feature.end < bpEnd) {
|
|
42272
42276
|
const row = this.displayMode === "COLLAPSED" ? 0 : feature.row || 0;
|
|
42273
42277
|
if (rowFeatureCount[row] === undefined) {
|
|
42274
42278
|
rowFeatureCount[row] = 1;
|
|
@@ -44532,6 +44536,8 @@ const isString = isString$3;
|
|
|
44532
44536
|
|
|
44533
44537
|
const DEFAULT_VISIBILITY_WINDOW = 1000000;
|
|
44534
44538
|
const TOP_MARGIN = 10;
|
|
44539
|
+
const STANDARD_FIELDS = new Map([["REF", "referenceBases"], ["ALT", "alternateBases"], ["QUAL", "quality"], ["FILTER", "filter"]]);
|
|
44540
|
+
|
|
44535
44541
|
|
|
44536
44542
|
class VariantTrack extends TrackBase {
|
|
44537
44543
|
|
|
@@ -44573,7 +44579,6 @@ class VariantTrack extends TrackBase {
|
|
|
44573
44579
|
this.colorTables = new Map();
|
|
44574
44580
|
this.colorTables.set(config.colorBy, new ColorTable(config.colorTable));
|
|
44575
44581
|
}
|
|
44576
|
-
this._color = config.color;
|
|
44577
44582
|
|
|
44578
44583
|
this.showGenotypes = config.showGenotypes === undefined ? true : config.showGenotypes;
|
|
44579
44584
|
|
|
@@ -44682,9 +44687,9 @@ class VariantTrack extends TrackBase {
|
|
|
44682
44687
|
IGVGraphics.fillRect(context, 0, pixelTop, pixelWidth, pixelHeight, {'fillStyle': "rgb(255, 255, 255)"});
|
|
44683
44688
|
|
|
44684
44689
|
const vGap = ("SQUISHED" === this.displayMode) ? this.squishedVGap : this.expandedVGap;
|
|
44685
|
-
const
|
|
44690
|
+
const rowCount = ("COLLAPSED" === this.displayMode) ? 1 : this.nVariantRows;
|
|
44686
44691
|
const variantHeight = ("SQUISHED" === this.displayMode) ? this.squishedVariantHeight : this.expandedVariantHeight;
|
|
44687
|
-
this.variantBandHeight = TOP_MARGIN +
|
|
44692
|
+
this.variantBandHeight = TOP_MARGIN + rowCount * (variantHeight + vGap);
|
|
44688
44693
|
|
|
44689
44694
|
const callSets = this.callSets;
|
|
44690
44695
|
const nCalls = this.getCallsetsLength();
|
|
@@ -44784,14 +44789,21 @@ class VariantTrack extends TrackBase {
|
|
|
44784
44789
|
let variantColor;
|
|
44785
44790
|
|
|
44786
44791
|
if (this.colorBy) {
|
|
44787
|
-
const
|
|
44788
|
-
|
|
44792
|
+
const colorBy = this.colorBy;
|
|
44793
|
+
let value;
|
|
44794
|
+
if (v.info.hasOwnProperty(colorBy)) {
|
|
44795
|
+
value = v.info[colorBy];
|
|
44796
|
+
} else if (STANDARD_FIELDS.has(colorBy)) {
|
|
44797
|
+
const key = STANDARD_FIELDS.get(colorBy);
|
|
44798
|
+
value = v[key];
|
|
44799
|
+
}
|
|
44800
|
+
variantColor = this.getVariantColorTable(colorBy).getColor(value);
|
|
44789
44801
|
if (!variantColor) {
|
|
44790
44802
|
variantColor = "gray";
|
|
44791
44803
|
}
|
|
44792
44804
|
|
|
44793
44805
|
} else if (this._color) {
|
|
44794
|
-
variantColor = this.
|
|
44806
|
+
variantColor = (typeof this._color === "function") ? this._color(variant) : this._color;
|
|
44795
44807
|
} else if ("NONVARIANT" === v.type) {
|
|
44796
44808
|
variantColor = this.nonRefColor;
|
|
44797
44809
|
} else if ("MIXED" === v.type) {
|
|
@@ -44802,9 +44814,6 @@ class VariantTrack extends TrackBase {
|
|
|
44802
44814
|
return variantColor
|
|
44803
44815
|
}
|
|
44804
44816
|
|
|
44805
|
-
get color() {
|
|
44806
|
-
return this._color ? ((typeof this._color === "function") ? this._color(v) : this._color) : this.defaultColor
|
|
44807
|
-
}
|
|
44808
44817
|
|
|
44809
44818
|
clickedFeatures(clickState, features) {
|
|
44810
44819
|
|
|
@@ -44817,15 +44826,17 @@ class VariantTrack extends TrackBase {
|
|
|
44817
44826
|
if (yOffset <= this.variantBandHeight) {
|
|
44818
44827
|
// Variant
|
|
44819
44828
|
const variantHeight = ("SQUISHED" === this.displayMode) ? this.squishedVariantHeight : this.expandedVariantHeight;
|
|
44820
|
-
const variantRow =
|
|
44821
|
-
|
|
44829
|
+
const variantRow = Math.floor((yOffset - TOP_MARGIN) / (variantHeight + vGap));
|
|
44830
|
+
if ("COLLAPSED" !== this.displayMode) {
|
|
44831
|
+
featureList = featureList.filter(f => f.row === variantRow);
|
|
44832
|
+
}
|
|
44822
44833
|
} else if (this.callSets) {
|
|
44823
44834
|
const callSets = this.callSets;
|
|
44824
44835
|
const sampleY = yOffset - this.variantBandHeight;
|
|
44825
44836
|
const sampleRow = Math.floor(sampleY / this.sampleHeight);
|
|
44826
44837
|
if (sampleRow >= 0 && sampleRow < callSets.length) {
|
|
44827
44838
|
const variantRow = Math.floor((sampleY - sampleRow * this.sampleHeight) / callHeight);
|
|
44828
|
-
const variants = featureList.filter(f => f.row === variantRow);
|
|
44839
|
+
const variants = "COLLAPSED" === this.displayMode ? featureList : featureList.filter(f => f.row === variantRow);
|
|
44829
44840
|
const cs = callSets[sampleRow];
|
|
44830
44841
|
featureList = variants.map(v => {
|
|
44831
44842
|
const call = v.calls[cs.id];
|
|
@@ -45039,7 +45050,7 @@ class VariantTrack extends TrackBase {
|
|
|
45039
45050
|
label: 'Add SVs to circular view',
|
|
45040
45051
|
click: () => {
|
|
45041
45052
|
for (let viewport of this.trackView.viewports) {
|
|
45042
|
-
|
|
45053
|
+
this.sendChordsForViewport(viewport);
|
|
45043
45054
|
}
|
|
45044
45055
|
}
|
|
45045
45056
|
});
|