From e0c29cbc87c031bc4ee64ae7895fdcc1eb3a209a Mon Sep 17 00:00:00 2001
From: Jim Robinson <933148+jrobinso@users.noreply.github.com>
Date: Wed, 7 Aug 2024 11:29:07 -0700
Subject: [PATCH] Merged track issues (#1866)
Fix some issues with merged tracks. Autoscale for merged and individual track settings could conflict.
---
dev/wig/merged.html | 70 +++++++---
examples/mergedWig.html | 22 ++-
examples/spliceJunctions.html | 35 ++++-
js/bam/coverageTrack.js | 1 +
js/cnvpytor/cnvpytorTrack.js | 4 +-
js/feature/featureTrack.js | 2 +-
js/feature/mergedTrack.js | 218 ++++++++++++++++++------------
js/feature/spliceJunctionTrack.js | 30 ++--
js/trackBase.js | 8 ++
js/trackView.js | 21 ---
js/ui/dataRangeDialog.js | 10 +-
js/ui/overlayTrackButton.js | 4 +-
12 files changed, 271 insertions(+), 154 deletions(-)
diff --git a/dev/wig/merged.html b/dev/wig/merged.html
index 660796767..1d285deb3 100644
--- a/dev/wig/merged.html
+++ b/dev/wig/merged.html
@@ -6,6 +6,8 @@
+
+
Merged track
@@ -22,25 +24,12 @@ Merged track
var options =
{
+ queryParametersSupported: true,
genome: "hg19",
locus: "chr4:40,174,668-40,221,204",
tracks: [
- // {
- // "type": "wig",
- // "format": "bigwig",
- // "url": "https://www.encodeproject.org/files/ENCFF000ASJ/@@download/ENCFF000ASJ.bigWig",
- // "color": "red",
- // "name": "ENCFF000ASJ"
- // },
- // {
- // "type": "wig",
- // "format": "bigwig",
- // "url": "https://www.encodeproject.org/files/ENCFF351WPV/@@download/ENCFF351WPV.bigWig",
- // "color": "green",
- // "name": "ENCFF351WPV"
- // },
{
- name: "Merged - group autoscaled",
+ name: "Merged - autoscaled",
type: "merged",
autoscale: true,
tracks: [
@@ -58,6 +47,26 @@ Merged track
}
]
},
+ {
+ name: "Merged - fixed scale",
+ type: "merged",
+ min: 0,
+ max: 100,
+ tracks: [
+ {
+ "type": "wig",
+ "format": "bigwig",
+ "url": "https://www.encodeproject.org/files/ENCFF000ASJ/@@download/ENCFF000ASJ.bigWig",
+ "color": "red"
+ },
+ {
+ "type": "wig",
+ "format": "bigwig",
+ "url": "https://www.encodeproject.org/files/ENCFF351WPV/@@download/ENCFF351WPV.bigWig",
+ "color": "green"
+ }
+ ]
+ },
{
name: "Merged - individual autoscaled",
type: "merged",
@@ -77,7 +86,27 @@ Merged track
"autoscale": true
}
]
- }
+ },
+ {
+ name: "Merged - individual fixed scale",
+ type: "merged",
+ tracks: [
+ {
+ "type": "wig",
+ "format": "bigwig",
+ "url": "https://www.encodeproject.org/files/ENCFF000ASJ/@@download/ENCFF000ASJ.bigWig",
+ "color": "red",
+ "max": 100
+ },
+ {
+ "type": "wig",
+ "format": "bigwig",
+ "url": "https://www.encodeproject.org/files/ENCFF351WPV/@@download/ENCFF351WPV.bigWig",
+ "color": "green",
+ "max": 50
+ }
+ ]
+ },
]
}
@@ -85,7 +114,14 @@ Merged track
igv.createBrowser(igvDiv, options)
.then(function (browser) {
- console.log("Created IGV browser")
+ document.getElementById("log-state").addEventListener("click", () => console.log(browser.toJSON()))
+
+ document.getElementById('bookmark').addEventListener('click', () => {
+ const path = window.location.href.slice()
+ const idx = path.indexOf("?")
+ const url = (idx > 0 ? path.substring(0, idx) : path) + "?sessionURL=blob:" + browser.compressedSession()
+ window.history.pushState({}, "IGV", url)
+ })
})
diff --git a/examples/mergedWig.html b/examples/mergedWig.html
index cedb519bc..51c95c59f 100644
--- a/examples/mergedWig.html
+++ b/examples/mergedWig.html
@@ -63,7 +63,27 @@ Merged track
"color": "green"
}
]
- }
+ },
+ {
+ name: "Merged - individual autoscaled",
+ type: "merged",
+ tracks: [
+ {
+ "type": "wig",
+ "format": "bigwig",
+ "url": "https://www.encodeproject.org/files/ENCFF000ASJ/@@download/ENCFF000ASJ.bigWig",
+ "color": "red",
+ "autoscale": true
+ },
+ {
+ "type": "wig",
+ "format": "bigwig",
+ "url": "https://www.encodeproject.org/files/ENCFF351WPV/@@download/ENCFF351WPV.bigWig",
+ "color": "green",
+ "autoscale": true
+ }
+ ]
+ },
]
}
diff --git a/examples/spliceJunctions.html b/examples/spliceJunctions.html
index d89d5fc12..1aca55380 100644
--- a/examples/spliceJunctions.html
+++ b/examples/spliceJunctions.html
@@ -13,12 +13,41 @@ Splice junctions