igv 2.13.8 → 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 +10 -10
- package/dist/igv.esm.js +80 -63
- package/dist/igv.esm.min.js +4 -4
- package/dist/igv.esm.min.js.map +1 -1
- package/dist/igv.js +77 -51
- package/dist/igv.min.js +4 -4
- package/dist/igv.min.js.map +1 -1
- package/package.json +1 -1
package/dist/igv.js
CHANGED
|
@@ -16829,10 +16829,7 @@
|
|
|
16829
16829
|
var rgb = this.hsvToRgb(this.hue, saturation, value);
|
|
16830
16830
|
return "#" + this.padHex(rgb[0].toString(16)) + this.padHex(rgb[1].toString(16)) + this.padHex(rgb[2].toString(16));
|
|
16831
16831
|
};
|
|
16832
|
-
|
|
16833
|
-
function randomColor() {
|
|
16834
|
-
return randomColorGenerator.get();
|
|
16835
|
-
}
|
|
16832
|
+
new RandomColorGenerator();
|
|
16836
16833
|
function randomRGB$1(min, max) {
|
|
16837
16834
|
min = IGVMath.clamp(min, 0, 255);
|
|
16838
16835
|
max = IGVMath.clamp(max, 0, 255);
|
|
@@ -21939,7 +21936,7 @@
|
|
|
21939
21936
|
}
|
|
21940
21937
|
};
|
|
21941
21938
|
|
|
21942
|
-
const _version = "2.13.
|
|
21939
|
+
const _version = "2.13.10";
|
|
21943
21940
|
function version$1() {
|
|
21944
21941
|
return _version;
|
|
21945
21942
|
}
|
|
@@ -27263,12 +27260,15 @@
|
|
|
27263
27260
|
/**
|
|
27264
27261
|
* Return inflated data from startBlock through endBlock as an UInt8Array
|
|
27265
27262
|
*
|
|
27266
|
-
* @param
|
|
27267
|
-
* @param
|
|
27263
|
+
* @param minv minimum virtual pointer {block, offset}
|
|
27264
|
+
* @param maxv maximum virtual pointer {block, offset}
|
|
27268
27265
|
* @returns {Promise<Uint8Array>}
|
|
27269
27266
|
*/
|
|
27270
|
-
async getData(
|
|
27271
|
-
const
|
|
27267
|
+
async getData(minv, maxv) {
|
|
27268
|
+
const startBlock = minv.block;
|
|
27269
|
+
const endBlock = maxv.block;
|
|
27270
|
+
const skipEnd = maxv.offset === 0;
|
|
27271
|
+
const blocks = await this.getInflatedBlocks(startBlock, endBlock, skipEnd);
|
|
27272
27272
|
if (blocks.length === 1) {
|
|
27273
27273
|
return blocks[0];
|
|
27274
27274
|
}
|
|
@@ -27292,14 +27292,16 @@
|
|
|
27292
27292
|
* @param endBlock
|
|
27293
27293
|
* @returns {Promise<*[Uint8Array]>}
|
|
27294
27294
|
*/
|
|
27295
|
-
async getInflatedBlocks(startBlock, endBlock) {
|
|
27295
|
+
async getInflatedBlocks(startBlock, endBlock, skipEnd) {
|
|
27296
27296
|
if (!this.cacheBlocks) {
|
|
27297
|
-
const buffer = await this.loadBLockData(startBlock, endBlock
|
|
27297
|
+
const buffer = await this.loadBLockData(startBlock, endBlock, {
|
|
27298
|
+
skipEnd
|
|
27299
|
+
});
|
|
27298
27300
|
return inflateBlocks(buffer);
|
|
27299
27301
|
} else {
|
|
27300
27302
|
const c = this.cache;
|
|
27301
|
-
if (c && c.startBlock <= startBlock && c.endBlock >= endBlock) {
|
|
27302
|
-
|
|
27303
|
+
if (c && c.startBlock <= startBlock && (c.endBlock >= endBlock || skipEnd && c.nextEndBlock === endBlock)) {
|
|
27304
|
+
console.log("Complete overlap");
|
|
27303
27305
|
const startOffset = startBlock - c.startBlock;
|
|
27304
27306
|
const endOffset = endBlock - c.startBlock;
|
|
27305
27307
|
return inflateBlocks(c.buffer, startOffset, endOffset);
|
|
@@ -27308,7 +27310,9 @@
|
|
|
27308
27310
|
let buffer;
|
|
27309
27311
|
if (!c || c.startBlock > endBlock || c.endBlock < startBlock) {
|
|
27310
27312
|
// no overlap with cache
|
|
27311
|
-
buffer = await this.loadBLockData(startBlock, endBlock
|
|
27313
|
+
buffer = await this.loadBLockData(startBlock, endBlock, {
|
|
27314
|
+
skipEnd
|
|
27315
|
+
});
|
|
27312
27316
|
} else {
|
|
27313
27317
|
//console.log("Some overlap")
|
|
27314
27318
|
const arrayBuffers = [];
|
|
@@ -27350,15 +27354,24 @@
|
|
|
27350
27354
|
// Load end blocks, if any
|
|
27351
27355
|
if (endBlock > c.endBlock) {
|
|
27352
27356
|
const endBuffer = await this.loadBLockData(c.endBlock, endBlock, {
|
|
27353
|
-
skipStart: true
|
|
27357
|
+
skipStart: true,
|
|
27358
|
+
skipEnd
|
|
27354
27359
|
});
|
|
27355
27360
|
arrayBuffers.push(endBuffer);
|
|
27356
27361
|
}
|
|
27357
27362
|
buffer = concatenateArrayBuffers(arrayBuffers);
|
|
27358
27363
|
}
|
|
27364
|
+
|
|
27365
|
+
// If skipEnd === true we need to find boundary of last block in cache
|
|
27366
|
+
let nextEndBlock = endBlock;
|
|
27367
|
+
if (skipEnd) {
|
|
27368
|
+
const boundaries = findBlockBoundaries(buffer);
|
|
27369
|
+
endBlock = boundaries[boundaries.length - 1];
|
|
27370
|
+
}
|
|
27359
27371
|
this.cache = {
|
|
27360
27372
|
startBlock,
|
|
27361
27373
|
endBlock,
|
|
27374
|
+
nextEndBlock,
|
|
27362
27375
|
buffer
|
|
27363
27376
|
};
|
|
27364
27377
|
return inflateBlocks(buffer);
|
|
@@ -27650,7 +27663,7 @@
|
|
|
27650
27663
|
for (let chunk of chunks) {
|
|
27651
27664
|
let inflated;
|
|
27652
27665
|
if (tabix) {
|
|
27653
|
-
inflated = await this._blockLoader.getData(chunk.minv
|
|
27666
|
+
inflated = await this._blockLoader.getData(chunk.minv, chunk.maxv);
|
|
27654
27667
|
} else {
|
|
27655
27668
|
const options = buildOptions(config, {
|
|
27656
27669
|
range: {
|
|
@@ -33598,7 +33611,7 @@
|
|
|
33598
33611
|
return alignmentContainer;
|
|
33599
33612
|
}
|
|
33600
33613
|
for (let c of chunks) {
|
|
33601
|
-
const ba = await this._blockLoader.getData(c.minv
|
|
33614
|
+
const ba = await this._blockLoader.getData(c.minv, c.maxv);
|
|
33602
33615
|
const done = BamUtils.decodeBamRecords(ba, c.minv.offset, alignmentContainer, this.indexToChr, chrId, bpStart, bpEnd, this.filter);
|
|
33603
33616
|
if (done) {
|
|
33604
33617
|
break;
|
|
@@ -52976,7 +52989,14 @@
|
|
|
52976
52989
|
value: max
|
|
52977
52990
|
}];
|
|
52978
52991
|
} else {
|
|
52979
|
-
|
|
52992
|
+
const viewFeatures = FeatureUtils.findOverlapping(visibleViewport.featureCache.features, start, end);
|
|
52993
|
+
if (!allFeatures) {
|
|
52994
|
+
allFeatures = viewFeatures;
|
|
52995
|
+
} else {
|
|
52996
|
+
for (let f of viewFeatures) {
|
|
52997
|
+
allFeatures.push(f);
|
|
52998
|
+
}
|
|
52999
|
+
}
|
|
52980
53000
|
}
|
|
52981
53001
|
}
|
|
52982
53002
|
}
|
|
@@ -56892,21 +56912,16 @@
|
|
|
56892
56912
|
* Colors used for coding omosomes
|
|
56893
56913
|
*/
|
|
56894
56914
|
|
|
56895
|
-
const
|
|
56915
|
+
const GWASColors = {
|
|
56896
56916
|
"X": "rgb(204, 153, 0)",
|
|
56897
56917
|
"Y": "rgb(153, 204, 0)",
|
|
56898
56918
|
"Un": "darkGray)",
|
|
56899
56919
|
"1": "rgb(80, 80, 255)",
|
|
56900
|
-
//"1": Color.red);
|
|
56901
|
-
"I": "rgb(139, 155, 187)",
|
|
56902
56920
|
"2": "rgb(206, 61, 50)",
|
|
56903
|
-
"II": "rgb(206, 61, 50)",
|
|
56904
56921
|
"2a": "rgb(210, 65, 55)",
|
|
56905
56922
|
"2b": "rgb(215, 70, 60)",
|
|
56906
56923
|
"3": "rgb(116, 155, 88)",
|
|
56907
|
-
"III": "rgb(116, 155, 88)",
|
|
56908
56924
|
"4": "rgb(240, 230, 133)",
|
|
56909
|
-
"IV": "rgb(240, 230, 133)",
|
|
56910
56925
|
"5": "rgb(70, 105, 131)",
|
|
56911
56926
|
"6": "rgb(186, 99, 56)",
|
|
56912
56927
|
"7": "rgb(93, 177, 221)",
|
|
@@ -56954,9 +56969,25 @@
|
|
|
56954
56969
|
};
|
|
56955
56970
|
|
|
56956
56971
|
// aliasing
|
|
56957
|
-
for (let key of Object.keys(
|
|
56972
|
+
for (let key of Object.keys(GWASColors)) {
|
|
56958
56973
|
const altName = "chr" + key;
|
|
56959
|
-
|
|
56974
|
+
GWASColors[altName] = GWASColors[key];
|
|
56975
|
+
}
|
|
56976
|
+
|
|
56977
|
+
// romanizing
|
|
56978
|
+
for (let a = 1; a <= 48; a++) {
|
|
56979
|
+
if (a === 10) continue; // Don't overide "X"
|
|
56980
|
+
const roman = romanize(a);
|
|
56981
|
+
GWASColors[roman] = GWASColors[a.toString()];
|
|
56982
|
+
}
|
|
56983
|
+
function romanize(num) {
|
|
56984
|
+
if (!+num) return false;
|
|
56985
|
+
var digits = String(+num).split('');
|
|
56986
|
+
var key = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
|
|
56987
|
+
var roman = '',
|
|
56988
|
+
i = 3;
|
|
56989
|
+
while (i--) roman = (key[+digits.pop() + i * 10] || '') + roman;
|
|
56990
|
+
return Array(+digits.join('') + 1).join('M') + roman;
|
|
56960
56991
|
}
|
|
56961
56992
|
|
|
56962
56993
|
/*
|
|
@@ -57004,12 +57035,18 @@
|
|
|
57004
57035
|
this.divider = config.divider || "rgb(225,225,225)";
|
|
57005
57036
|
this.dotSize = config.dotSize || 3;
|
|
57006
57037
|
this.popoverWindow = config.popoverWindow === undefined ? DEFAULT_POPOVER_WINDOW : config.popoverWindow;
|
|
57007
|
-
|
|
57008
|
-
|
|
57038
|
+
|
|
57039
|
+
// Color settings
|
|
57040
|
+
if (this.useChrColors) {
|
|
57041
|
+
this.colorScale = new ColorTable(config.colorTable || GWASColors);
|
|
57042
|
+
} else if (config.color) {
|
|
57043
|
+
this.colorScale = new ConstantColorScale(config.color);
|
|
57044
|
+
} else {
|
|
57045
|
+
this.colorScale = new BinnedColorScale(config.colorScale || {
|
|
57009
57046
|
thresholds: [5e-8, 5e-4, 0.5],
|
|
57010
57047
|
colors: ["rgb(255,50,50)", "rgb(251,100,100)", "rgb(251,170,170)", "rgb(227,238,249)"]
|
|
57011
|
-
})
|
|
57012
|
-
}
|
|
57048
|
+
});
|
|
57049
|
+
}
|
|
57013
57050
|
this.featureSource = FeatureSource(config, this.browser.genome);
|
|
57014
57051
|
}
|
|
57015
57052
|
async postInit() {
|
|
@@ -57072,18 +57109,16 @@
|
|
|
57072
57109
|
const pos = variant.start;
|
|
57073
57110
|
if (pos < bpStart) continue;
|
|
57074
57111
|
if (pos > bpEnd) break;
|
|
57075
|
-
const colorScale = this.getColorScale(variant._f ? variant._f.chr : variant.chr);
|
|
57076
|
-
let color;
|
|
57077
57112
|
let val;
|
|
57078
57113
|
if (this.posteriorProbability) {
|
|
57079
57114
|
val = variant[this.valueProperty];
|
|
57080
|
-
color = colorScale.getColor(val);
|
|
57081
57115
|
} else {
|
|
57082
57116
|
const pvalue = variant[this.valueProperty];
|
|
57083
57117
|
if (!pvalue) continue;
|
|
57084
57118
|
val = -Math.log10(pvalue);
|
|
57085
|
-
color = colorScale.getColor(val);
|
|
57086
57119
|
}
|
|
57120
|
+
const colorKey = this.useChrColors ? variant._f ? variant._f.chr : variant.chr : val;
|
|
57121
|
+
const color = this.colorScale.getColor(colorKey);
|
|
57087
57122
|
const yScale = (this.dataRange.max - this.dataRange.min) / pixelHeight;
|
|
57088
57123
|
const px = Math.round((pos - bpStart) / bpPerPixel);
|
|
57089
57124
|
const py = Math.max(this.dotSize, pixelHeight - Math.round((val - this.dataRange.min) / yScale));
|
|
@@ -57099,19 +57134,6 @@
|
|
|
57099
57134
|
}
|
|
57100
57135
|
}
|
|
57101
57136
|
}
|
|
57102
|
-
getColorScale(chr) {
|
|
57103
|
-
if (this.useChrColors) {
|
|
57104
|
-
let cs = this.colorScales[chr];
|
|
57105
|
-
if (!cs) {
|
|
57106
|
-
const color = Colors[chr] || randomColor();
|
|
57107
|
-
cs = new ConstantColorScale(color);
|
|
57108
|
-
this.colorScales[chr] = cs;
|
|
57109
|
-
}
|
|
57110
|
-
return cs;
|
|
57111
|
-
} else {
|
|
57112
|
-
return this.colorScales("*");
|
|
57113
|
-
}
|
|
57114
|
-
}
|
|
57115
57137
|
paintAxis(ctx, pixelWidth, pixelHeight) {
|
|
57116
57138
|
IGVGraphics.fillRect(ctx, 0, 0, pixelWidth, pixelHeight, {
|
|
57117
57139
|
'fillStyle': "rgb(255, 255, 255)"
|
|
@@ -57224,11 +57246,15 @@
|
|
|
57224
57246
|
} else {
|
|
57225
57247
|
// No features -- pick something reasonable for PPAs and p-values
|
|
57226
57248
|
if (this.posteriorProbability) {
|
|
57227
|
-
this.dataRange
|
|
57228
|
-
|
|
57249
|
+
this.dataRange = {
|
|
57250
|
+
min: this.config.min || 0,
|
|
57251
|
+
max: this.config.max || 1
|
|
57252
|
+
};
|
|
57229
57253
|
} else {
|
|
57230
|
-
this.dataRange
|
|
57231
|
-
|
|
57254
|
+
this.dataRange = {
|
|
57255
|
+
min: this.config.max || 25,
|
|
57256
|
+
max: this.config.min || 0
|
|
57257
|
+
};
|
|
57232
57258
|
}
|
|
57233
57259
|
}
|
|
57234
57260
|
return this.dataRange;
|