igv 3.0.3 → 3.0.5
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/dist/igv.esm.js +63 -70
- package/dist/igv.esm.min.js +4 -4
- package/dist/igv.esm.min.js.map +1 -1
- package/dist/igv.js +63 -70
- 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
|
@@ -25222,9 +25222,7 @@
|
|
|
25222
25222
|
} else {
|
|
25223
25223
|
combinedFeatures = this.combineFeaturesByType(features);
|
|
25224
25224
|
}
|
|
25225
|
-
|
|
25226
|
-
return a.start - b.start
|
|
25227
|
-
});
|
|
25225
|
+
|
|
25228
25226
|
this.numberExons(combinedFeatures, genomicInterval);
|
|
25229
25227
|
this.nameFeatures(combinedFeatures);
|
|
25230
25228
|
return combinedFeatures
|
|
@@ -29781,20 +29779,30 @@
|
|
|
29781
29779
|
await this.readHeader();
|
|
29782
29780
|
}
|
|
29783
29781
|
|
|
29782
|
+
let allFeatures;
|
|
29784
29783
|
const index = await this.getIndex();
|
|
29785
29784
|
if (index) {
|
|
29786
29785
|
this.indexed = true;
|
|
29787
|
-
|
|
29786
|
+
allFeatures = await this.loadFeaturesWithIndex(chr, start, end);
|
|
29788
29787
|
} else if (this.dataURI) {
|
|
29789
29788
|
this.indexed = false;
|
|
29790
|
-
|
|
29789
|
+
allFeatures = await this.loadFeaturesFromDataURI();
|
|
29791
29790
|
} else if ("service" === this.config.sourceType) {
|
|
29792
|
-
|
|
29791
|
+
allFeatures = await this.loadFeaturesFromService(chr, start, end);
|
|
29793
29792
|
} else {
|
|
29794
29793
|
this.indexed = false;
|
|
29795
|
-
|
|
29794
|
+
allFeatures = await this.loadFeaturesNoIndex();
|
|
29796
29795
|
}
|
|
29797
29796
|
|
|
29797
|
+
allFeatures.sort(function (a, b) {
|
|
29798
|
+
if (a.chr === b.chr) {
|
|
29799
|
+
return a.start - b.start
|
|
29800
|
+
} else {
|
|
29801
|
+
return a.chr.localeCompare(b.chr)
|
|
29802
|
+
}
|
|
29803
|
+
});
|
|
29804
|
+
|
|
29805
|
+
return allFeatures
|
|
29798
29806
|
}
|
|
29799
29807
|
|
|
29800
29808
|
async readHeader() {
|
|
@@ -29966,9 +29974,6 @@
|
|
|
29966
29974
|
await this._parse(allFeatures, dataWrapper, chr, end, start);
|
|
29967
29975
|
|
|
29968
29976
|
}
|
|
29969
|
-
allFeatures.sort(function (a, b) {
|
|
29970
|
-
return a.start - b.start
|
|
29971
|
-
});
|
|
29972
29977
|
|
|
29973
29978
|
return allFeatures
|
|
29974
29979
|
}
|
|
@@ -29998,8 +30003,13 @@
|
|
|
29998
30003
|
|
|
29999
30004
|
let features = await this.parser.parseFeatures(dataWrapper);
|
|
30000
30005
|
|
|
30001
|
-
|
|
30002
|
-
|
|
30006
|
+
features.sort(function (a, b) {
|
|
30007
|
+
if (a.chr === b.chr) {
|
|
30008
|
+
return a.start - b.start
|
|
30009
|
+
} else {
|
|
30010
|
+
return a.chr.localeCompare(b.chr)
|
|
30011
|
+
}
|
|
30012
|
+
});
|
|
30003
30013
|
|
|
30004
30014
|
// Filter features not in requested range.
|
|
30005
30015
|
if (undefined === chr) {
|
|
@@ -30008,26 +30018,21 @@
|
|
|
30008
30018
|
let inInterval = false;
|
|
30009
30019
|
for (let i = 0; i < features.length; i++) {
|
|
30010
30020
|
const f = features[i];
|
|
30011
|
-
if (f.chr
|
|
30012
|
-
if (
|
|
30013
|
-
|
|
30014
|
-
|
|
30015
|
-
break //adjacent chr to the right
|
|
30021
|
+
if (f.chr === chr) {
|
|
30022
|
+
if (f.start > end) {
|
|
30023
|
+
allFeatures.push(f); // First feature beyond interval
|
|
30024
|
+
break
|
|
30016
30025
|
}
|
|
30017
|
-
|
|
30018
|
-
|
|
30019
|
-
|
|
30020
|
-
|
|
30021
|
-
|
|
30022
|
-
|
|
30023
|
-
|
|
30024
|
-
if (!inInterval) {
|
|
30025
|
-
inInterval = true;
|
|
30026
|
-
if (i > 0) {
|
|
30027
|
-
allFeatures.push(features[i - 1]);
|
|
30026
|
+
if (f.end >= start && f.start <= end) {
|
|
30027
|
+
// All this to grab first feature before start of interval. Needed for some track renderers, like line plot
|
|
30028
|
+
if (!inInterval) {
|
|
30029
|
+
inInterval = true;
|
|
30030
|
+
if (i > 0) {
|
|
30031
|
+
allFeatures.push(features[i - 1]);
|
|
30032
|
+
}
|
|
30028
30033
|
}
|
|
30034
|
+
allFeatures.push(f);
|
|
30029
30035
|
}
|
|
30030
|
-
allFeatures.push(f);
|
|
30031
30036
|
}
|
|
30032
30037
|
}
|
|
30033
30038
|
}
|
|
@@ -34501,7 +34506,11 @@
|
|
|
34501
34506
|
if (name === undefined) name = feature.id || feature.ID;
|
|
34502
34507
|
if (!name || name === '.') return
|
|
34503
34508
|
|
|
34504
|
-
let
|
|
34509
|
+
let pixelXOffset = options.pixelXOffset || 0;
|
|
34510
|
+
const t1 = Math.max(featureX, -pixelXOffset);
|
|
34511
|
+
const t2 = Math.min(featureX1, -pixelXOffset + options.viewportWidth);
|
|
34512
|
+
let centerX = (t1 + t2) / 2;
|
|
34513
|
+
//let centerX = (featureX + featureX1) / 2
|
|
34505
34514
|
|
|
34506
34515
|
let transform;
|
|
34507
34516
|
if (this.displayMode === "COLLAPSED" && this.labelDisplayMode === "SLANT") {
|
|
@@ -34780,7 +34789,6 @@
|
|
|
34780
34789
|
displayMode: "EXPANDED", // COLLAPSED | EXPANDED | SQUISHED
|
|
34781
34790
|
margin: 10,
|
|
34782
34791
|
featureHeight: 14,
|
|
34783
|
-
autoHeight: false,
|
|
34784
34792
|
useScore: false
|
|
34785
34793
|
}
|
|
34786
34794
|
|
|
@@ -35312,7 +35320,8 @@
|
|
|
35312
35320
|
|
|
35313
35321
|
function onDragEnd() {
|
|
35314
35322
|
if (track.trackView && track.displayMode !== "SQUISHED") {
|
|
35315
|
-
|
|
35323
|
+
// Repaint views to adjust feature name if center is moved out of view
|
|
35324
|
+
track.trackView.repaintViews();
|
|
35316
35325
|
}
|
|
35317
35326
|
}
|
|
35318
35327
|
|
|
@@ -39602,6 +39611,10 @@
|
|
|
39602
39611
|
if (this.featureMap[chr]) {
|
|
39603
39612
|
const match = `${chr}-${start}-${end}`;
|
|
39604
39613
|
this.featureMap[chr] = this.featureMap[chr].filter(feature => match !== `${feature.chr}-${feature.start}-${feature.end}`);
|
|
39614
|
+
// Check if featureMap for a specific chromosome is empty now and delete it if yes
|
|
39615
|
+
if (this.featureMap[chr].length === 0) {
|
|
39616
|
+
delete this.featureMap[chr];
|
|
39617
|
+
}
|
|
39605
39618
|
}
|
|
39606
39619
|
}
|
|
39607
39620
|
}
|
|
@@ -43049,7 +43062,7 @@
|
|
|
43049
43062
|
const viewportsToRepaint = visibleViewports.filter(vp => vp.needsRepaint()).filter(viewport => viewport.checkZoomIn());
|
|
43050
43063
|
|
|
43051
43064
|
// Get viewports that require a data load
|
|
43052
|
-
const viewportsToReload =
|
|
43065
|
+
const viewportsToReload = visibleViewports.filter(viewport => viewport.checkZoomIn()).filter(viewport => viewport.needsReload());
|
|
43053
43066
|
|
|
43054
43067
|
// Trigger viewport to load features needed to cover current genomic range
|
|
43055
43068
|
// NOTE: these must be loaded synchronously, do not user Promise.all, not all file readers are thread safe
|
|
@@ -67614,8 +67627,6 @@
|
|
|
67614
67627
|
this.trackView.setTrackHeight(this.config.height || CNVPytorTrack.DEFAULT_TRACK_HEIGHT);
|
|
67615
67628
|
this.trackView.checkContentHeight();
|
|
67616
67629
|
this.trackView.updateViews();
|
|
67617
|
-
this.trackView.track.autoHeight = false;
|
|
67618
|
-
|
|
67619
67630
|
|
|
67620
67631
|
} finally {
|
|
67621
67632
|
this.trackView.stopSpinner();
|
|
@@ -68036,13 +68047,8 @@
|
|
|
68036
68047
|
this.divider = config.divider || "rgb(225,225,225)";
|
|
68037
68048
|
this.dotSize = config.dotSize || 2;
|
|
68038
68049
|
this.height = config.height || 100;
|
|
68039
|
-
this.autoHeight = false;
|
|
68040
68050
|
this.disableButtons = config.disableButtons;
|
|
68041
68051
|
|
|
68042
|
-
// Limit visibility window to 2 mb, gtex server gets flaky beyond that
|
|
68043
|
-
//this.visibilityWindow = config.visibilityWindow === undefined ?
|
|
68044
|
-
// 2000000 : config.visibilityWindow >= 0 ? Math.min(2000000, config.visibilityWindow) : 2000000
|
|
68045
|
-
|
|
68046
68052
|
this.featureSource = FeatureSource(config, this.browser.genome);
|
|
68047
68053
|
}
|
|
68048
68054
|
|
|
@@ -70521,7 +70527,7 @@
|
|
|
70521
70527
|
})
|
|
70522
70528
|
}
|
|
70523
70529
|
|
|
70524
|
-
const _version = "3.0.
|
|
70530
|
+
const _version = "3.0.5";
|
|
70525
70531
|
function version() {
|
|
70526
70532
|
return _version
|
|
70527
70533
|
}
|
|
@@ -72071,9 +72077,16 @@
|
|
|
72071
72077
|
'<hr/>',
|
|
72072
72078
|
{
|
|
72073
72079
|
label: 'Delete',
|
|
72074
|
-
click: () => {
|
|
72075
|
-
|
|
72076
|
-
|
|
72080
|
+
click: async () => {
|
|
72081
|
+
roiSet.removeFeature(feature);
|
|
72082
|
+
const userDefinedFeatures = await roiSet.getAllFeatures();
|
|
72083
|
+
|
|
72084
|
+
// Delete user defined ROI Set if it is empty
|
|
72085
|
+
if (Object.keys(userDefinedFeatures).length === 0) {
|
|
72086
|
+
roiManager.deleteUserDefinedROISet();
|
|
72087
|
+
}
|
|
72088
|
+
roiManager.deleteRegionWithKey(regionElement.dataset.region, columnContainer);
|
|
72089
|
+
roiManager.repaintTable();
|
|
72077
72090
|
}
|
|
72078
72091
|
}
|
|
72079
72092
|
);
|
|
@@ -72601,6 +72614,10 @@
|
|
|
72601
72614
|
return this.roiSets.find(roiSet => true === roiSet.isUserDefined)
|
|
72602
72615
|
}
|
|
72603
72616
|
|
|
72617
|
+
deleteUserDefinedROISet(){
|
|
72618
|
+
this.roiSets = this.roiSets.filter(roiSet => roiSet.isUserDefined !== true);
|
|
72619
|
+
}
|
|
72620
|
+
|
|
72604
72621
|
initializeUserDefinedROISet() {
|
|
72605
72622
|
|
|
72606
72623
|
const config =
|
|
@@ -72616,15 +72633,8 @@
|
|
|
72616
72633
|
}
|
|
72617
72634
|
|
|
72618
72635
|
async deleteRegionWithKey(regionKey, columnContainer) {
|
|
72619
|
-
|
|
72620
72636
|
columnContainer.querySelectorAll(createSelector(regionKey)).forEach(node => node.remove());
|
|
72621
72637
|
|
|
72622
|
-
const {feature, set} = await this.findRegionWithKey(regionKey);
|
|
72623
|
-
|
|
72624
|
-
if (set) {
|
|
72625
|
-
set.removeFeature(feature);
|
|
72626
|
-
}
|
|
72627
|
-
|
|
72628
72638
|
const records = await this.getTableRecords();
|
|
72629
72639
|
|
|
72630
72640
|
if (0 === records.length) {
|
|
@@ -72634,23 +72644,6 @@
|
|
|
72634
72644
|
|
|
72635
72645
|
}
|
|
72636
72646
|
|
|
72637
|
-
async findRegionWithKey(regionKey) {
|
|
72638
|
-
|
|
72639
|
-
const {chr, start, end} = parseRegionKey(regionKey);
|
|
72640
|
-
|
|
72641
|
-
for (let set of this.roiSets) {
|
|
72642
|
-
const features = await set.getFeatures(chr, start, end);
|
|
72643
|
-
|
|
72644
|
-
for (let feature of features) {
|
|
72645
|
-
if (feature.chr === chr && feature.start >= start && feature.end <= end) {
|
|
72646
|
-
return {feature, set}
|
|
72647
|
-
}
|
|
72648
|
-
}
|
|
72649
|
-
}
|
|
72650
|
-
|
|
72651
|
-
return {feature: undefined, set: undefined}
|
|
72652
|
-
}
|
|
72653
|
-
|
|
72654
72647
|
toJSON() {
|
|
72655
72648
|
return this.roiSets.map(roiSet => roiSet.toJSON())
|
|
72656
72649
|
}
|
|
@@ -74625,7 +74618,7 @@
|
|
|
74625
74618
|
*/
|
|
74626
74619
|
async loadGenome(idOrConfig) {
|
|
74627
74620
|
|
|
74628
|
-
if(idOrConfig.genarkAccession) {
|
|
74621
|
+
if (idOrConfig.genarkAccession) {
|
|
74629
74622
|
idOrConfig.url = convertToHubURL(idOrConfig.genarkAccession);
|
|
74630
74623
|
}
|
|
74631
74624
|
|
|
@@ -75921,7 +75914,7 @@
|
|
|
75921
75914
|
|
|
75922
75915
|
if (dragObject && dragObject.viewport.referenceFrame.start !== dragObject.start) {
|
|
75923
75916
|
this.updateViews();
|
|
75924
|
-
this.fireEvent('trackdragend');
|
|
75917
|
+
this.fireEvent('trackdragend', [dragObject.viewport]);
|
|
75925
75918
|
}
|
|
75926
75919
|
}
|
|
75927
75920
|
|