Skip to content

Commit

Permalink
trackline logic bug -- all header lines were treated as a track line,…
Browse files Browse the repository at this point in the history
… not just likes beginning with "track"
  • Loading branch information
jrobinso committed Dec 14, 2021
1 parent 65f1499 commit fddefa7
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 19 deletions.
103 changes: 103 additions & 0 deletions dev/misc/igv-paper.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
</head>
<body>

<h1>Test for igv.js paper figures</h1>

<p><a target="_blank" href="https://www.biorxiv.org/content/10.1101/2020.05.03.075499v1.full">igv.js paper</a></p>

<h3>Figure panels are produced below from this build of igv.js. To see figures in igv.org/app-test</h3>
<ul>
<li>Click the tinyurl</li>
<li>Change the host from "igv.org/app" to "igv.org/app-test"</li>
</ul>

Tiny URLs from paper:
<ul>
<li>(a) <a target="_blank" href="https://tinyurl.com/y9n6dyw9">https://tinyurl.com/y9n6dyw9</a></li>
<li>(b) <a target="_blank" href="https://tinyurl.com/ybo547uf">https://tinyurl.com/ybo547uf</a></li>
<li>(c) <a target="_blank" href="https://tinyurl.com/y75465od">https://tinyurl.com/y75465od</a></li>
<li>(d) <a target="_blank" href="https://tinyurl.com/ydhakvy4">https://tinyurl.com/ydhakvy4</a></li>
</ul>

<h2>Current igv.js</h2>

<p>
<h3>Panel A</h3>
<div id="igv-panelA" style="padding-top: 10px;padding-bottom: 10px; border:1px solid lightgray"></div>
</p>

<p>
<h3>Panel B</h3>
<div id="igv-panelB" style="padding-top: 10px;padding-bottom: 10px; border:1px solid lightgray"></div>
</p>

<p>
<h3>Panel C</h3>
<div id="igv-panelC" style="padding-top: 10px;padding-bottom: 10px; border:1px solid lightgray"></div>
</p>

<p>
<h3>Panel D</h3>
<div id="igv-panelD" style="padding-top: 10px;padding-bottom: 10px; border:1px solid lightgray"></div>
</p>


<script type="module">

import igv from "../../js/index.js"

const igvDivA = document.getElementById("igv-panelA")
const optionsA =
{
queryParametersSupported: true,
sessionURL: "blob:rVNvb9M.EP4qyK9ApE7TkP7Ju60MhjRAWjvx4qcKOck1sXDszHa6dlW_..6ydFAhJn5iVRO1vrvn7p7n8Z5ZWIMFnQNL90wWLGVVGc1YwLSo8YxdtrXQr17Pr.dVPAkp9gaDa.G8uLm.onTvG5eGoYu5qMW90eLO8dzUoSw3PLNGFFI7L33rgRtbhiVoU4MLHdx2cN2Ld4AILHUB2xcHxrdE8HznTSZ08UL4BHeOcNxvPTsETJm8dSz9j.WVjdIoSQJ64tFo8PR7NmKrgJUetgtQkHtpNFbsn6_AOPYmMT7fzCPcw.mGpbpV6oBdvRX5D2q7Z37XUBYO2HaKBszYAixLBxGfzCbjWRzF76bjURwlE3gbD6eoslk0UmtK8raFQ7BnzrQ2h.UjVpk7hOmBhZKlrkF7PGqtojAR2BEjczdo2kzJfFAIL8JGCS91Ww.OtGWiDr.cRaPpZPp9EXH8eyr3P0HhQwL3nu1j5FOp4PTwZ.8KZFl5lo6HQ7SG2YAVJSyJzcs.kmCgZzChFGXs.Y4IRs51Qf1O2QuQIYW6frBwu6wsuMoovFFDPkLNjEVEFKl3yZPk.I0TmtU0ZAea9GZ.dfF1.en9BZ4W0j76BANnizk7rEijfqePaAvSZ21sLRCebnNnlaM.z3ocTc2PlHaGxmpC5DQrdLbm5f3_uJR_B8h9RlptpJOZVNLvviG.uSOXBrhAbTYiU7jdWiiHlPYCRMPucyLpn.Y9cTDl_2JhrY1HOyGfAavF9trcoRgJAf8mJlZ6sARzvNWmNg63w9KO5dVhdXgA"
}
igv.createBrowser(igvDivA, optionsA)
.then(function (browser) {
console.log("Created IGV browser")
})

const igvDivB = document.getElementById("igv-panelB")
const optionsB =
{
queryParametersSupported: true,
sessionURL: "blob:tZRLT9wwEMe_SuUTVY3zIuRxLFLLgdOWqodqVTnJbGLVj8V2loXVfnfGYal4Fqi2h0TJzPgfz..f8YZYWIAF3QKpN0R0pCZDn1SEEs0VxsjpqLj.cHAyOxmyIgq5j5hccOf599lZKPd.6eoochnjil8bzS8da42KRL9ijTW8E9p54UcPzNg.6kEbBS5ycDHJTTc2CaKw0B2s9y6Md4Hi7ZU3DdfdnvSD3GeUY37tyZYSadrRkfonaQebpHVV0qos6FGVHE6PFS3jhMwp8Za3v0PhhvirZYCMkuPkASXGdmBJfZiwoiqOqyzJjsrjNEvyAj5lcYm.mG9LoXUo8naELd38sQq49cEcIWEXGkLol5NtmvOMNVyFtLGKe0zevo5WvgYDu2cdKBM9J_dWx14WwSu448xoWzi_JRJ6wNiOD5ei1wp06G4A0Q.4_SyO0VGzAst7OA9IT3eZHBM7jEkokQafiO2bg5gmRRmu8A8_AknxKxIkfLFwcT5YcIOROA4xS.8hPhP4vYeIZQjtD_Fzcu9G_ETkPyJOHyOuEprm.b8S_goa3H2EeEDh5IWdvhHj3ZxOM4qrgyJzxnqYJpX11.9E.rog803AuxJONEIKf_UD9c1lGGOKDSiz4g3CrhdcOsSwI5c9.I9e2unfPNPaeO6F0RhTfD0zl3is5MG1J.hxpQcbZO6OKKOMw75w6cR3vp1vbwA-"
}
igv.createBrowser(igvDivB, optionsB)
.then(function (browser) {
console.log("Created IGV browser")
})


const igvDivC = document.getElementById("igv-panelC")
const optionsC =
{
queryParametersSupported: true,
sessionURL: "blob:rZXdb.I4FMX_FeSnjtbNJ8GBp86gYdG26mih3T6MqpWTmOBpYlPbKbSo_3uvQxjx1W3pVkJBXOzje37HXJZIsQlTTKQM9ZaIZ6iHprnfRRgJWkINDauSitZJf9SfhsS1332BLydUG3o9urDLjZnpnuvq0KElfZKCzrWTytLl.YOTKEkzLrThpjLMkSp3cyZkybSr2X0tVz.cWhCEucjY4tOF4clBPH00MqEi.yR9K_cN5ByzMOgZo0KmlUa9nyidqqDnkwh34jYOw.jUJzGO4hh7hKBbjIyi6Z1duUTmcWYpg2ZVh4CRVBlTqHfqO6RLOt3QD9txJwj9iLA_Qi.GYOR4xoWwi4yq2DNerrP6kwmmbTpSldRAAcKFrq1qpYq3LINHZ.2x9ge7raKjpTKsdunkT0dk9D5BxyQ2mweuecILbh5vQF_OLQEMBkr5QJMC3E1oodlvPCG45AVrjL_WqZaVStnVirFdD7WGOBVCGmq4FFAr6WIk55BI5Hl7gOuTDFNWZh2vLKUGX7C15ntrQ9hGPJ_PHUhUZmym5C.WmvoO2R60._2yPxh4nj8aX7hnZ2BWFHDbNstOwvMbnts7KwsJjSCVJychbvl.Bx4ktj_Cxvzo8uvpmN1v5g675_Xuxuzqwwawg0cdojVlPJ.CZARcSi5Qz77TRUOKVkaOU7oRj63orUoTWPvgxT2SGYnaV38N95ityoeZeYALmm95G8SG4Xm7ZOHxxHYPOoqYfxyw6DOAtUl8PTrfA7YqHwbmh5YWbrW3gQXkQ8R2T3qL2Ks4Ojs0YQDsw_z_wLpRMPj7nz1gq_IrwDq4fm3w6l_1B8ez2j3kw6zI7m_1nayaZi6knOnWBIZca8j7243mpR_EJP63sGuchGXQ3KbRpvDOv5sMxrt7WPI_RjcXMI1p2szuNZGgRqLSH4oz0Uz2tVcz5ekd_DfC.A52wos9HETYD4mNr.HX3adz._wC"
}
igv.createBrowser(igvDivC, optionsC)
.then(function (browser) {
console.log("Created IGV browser")
})


const igvDivD = document.getElementById("igv-panelD")
const optionsD =
{
queryParametersSupported: true,
sessionURL: "blob:tVNNb9pAEP0r0Z5ayVmbAErwre2BVuoJWuVQRdVgD2ZV7w7dneUjiP.eWdc0ikI_lKoIYXlmeW_mvbcH5XGJHl2FqjwoU6tSrZrhjcqUAys19T5acBevprN3q.FNnnqvpbmEwPB59jEdZ16HMs_DUNcRWqlX33QMlyhHLgcaLNyTg23QFdncNBu98AS1cYENR0ZNvskbdGQx5AG_dxTdj16CMBlX4.7_M8nXCFu1Z1qAq19IKAz6xNChg3PEwIZcyBP2W8H.UCNp3rFu7tUxUy1VMajyi4K2VXeZYi8sqXBQvF8nC2TW2DmUKfI1elVeToriejCZXI1H16NiMhmIXTRfG.dSl33EY_bz780WQrKMvAV.fO_9nd6.mctb9O3Thc8vV6OlPAF8DWDXLWoOm7RH7xNKfpYiFD6bR_hNiz3nWYBA0Vf46cfM6XCa2bSMPtU6haqVJ0tB5JWe6IxJrxWaZiV7jYoiU9Y4VY7lCTt5SgEi07wCQTsN1kt4lRTq55nhUjS.mAriE6XkbnQsZ.R5YR4EMbHoQJ6xPqXg31L.dySaFyngGxPMwrSG97fCSVvJkoTHi60bWDxXaVB0n9_b.aulzjnaZ_LxXkhNzJrRVhweJ6Y_e368Oz4A"
}
igv.createBrowser(igvDivD, optionsD)
.then(function (browser) {
console.log("Created IGV browser")
})


</script>
</body>
</html>
3 changes: 1 addition & 2 deletions js/feature/featureParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ class FeatureParser {
let line
while ((line = await dataWrapper.nextLine()) !== undefined) {
if (line.startsWith("track") || line.startsWith("#track")) {
let h = parseTrackLine(line)
Object.assign(header, h)
header.trackLineProperties = parseTrackLine(line)
} else if (line.startsWith("browser")) {
// UCSC line, currently ignored
} else if (line.startsWith("#columns")) {
Expand Down
4 changes: 2 additions & 2 deletions js/feature/featureTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class FeatureTrack extends TrackBase {
}

// Set properties from track line
if (this.header) {
this.setTrackProperties(this.header)
if (this.header && this.header.trackLineProperties) {
this.setTrackProperties(this.header.trackLineProperties)
}

if (this.visibilityWindow === undefined && typeof this.featureSource.defaultVisibilityWindow === 'function') {
Expand Down
4 changes: 2 additions & 2 deletions js/feature/interactionTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class InteractionTrack extends TrackBase {
}

// Set properties from track line
if (this.header) {
this.setTrackProperties(this.header)
if (this.header && this.header.trackLineProperties) {
this.setTrackProperties(this.header.trackLineProperties)
}

if (this.visibilityWindow === undefined && typeof this.featureSource.defaultVisibilityWindow === 'function') {
Expand Down
4 changes: 2 additions & 2 deletions js/feature/segTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class SegTrack extends TrackBase {
this.header = await this.featureSource.getHeader()
}
// Set properties from track line
if (this.header) {
this.setTrackProperties(this.header)
if (this.header && this.header.trackLineProperties) {
this.setTrackProperties(this.header.trackLineProperties)
}
}

Expand Down
4 changes: 2 additions & 2 deletions js/feature/spliceJunctionTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class SpliceJunctionTrack extends TrackBase {
}

// Set properties from track line
if (this.header) {
this.setTrackProperties(this.header)
if (this.header && this.header.trackLineProperties) {
this.setTrackProperties(this.header.trackLineProperties)
}

if (this.visibilityWindow === undefined && typeof this.featureSource.defaultVisibilityWindow === 'function') {
Expand Down
4 changes: 3 additions & 1 deletion js/feature/wigTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class WigTrack extends TrackBase {

async postInit() {
const header = await this.getHeader()
if (header) this.setTrackProperties(header)
if (header && header.trackLineProperties) {
this.setTrackProperties(header.trackLineProperties)
}
}

async getFeatures(chr, start, end, bpPerPixel) {
Expand Down
5 changes: 3 additions & 2 deletions js/gcnv/gcnvTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ class GCNVTrack extends TrackBase {
this.sampleNames = this.header.columnNames.slice(3)

// Set generic properties from track line
this.setTrackProperties(this.header) // setTrackProperties defined in TrackBase

if (this.header && this.header.trackLineProperties) {
this.setTrackProperties(this.header.trackLineProperties)
}
// set option to highlight sample track line on click
if (this.header.hasOwnProperty("clickToHighlight")) {
let colour = this.header["clickToHighlight"]
Expand Down
12 changes: 6 additions & 6 deletions js/gwas/gwasTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ class GWASTrack extends TrackBase {
}

// Set properties from track line
if (this.header) {
this.setTrackProperties(this.header)
if (this.header && this.header.trackLineProperties) {
this.setTrackProperties(this.header.trackLineProperties)
}

// Set initial range if specfied, unless autoscale == true
if (!this.autoscale) {
if (this.posteriorProbability) {
this.dataRange = {
min: this.config.min === undefined ? 0 : config.min,
max: this.config.max === undefined ? 1 : config.max
min: this.config.min === undefined ? 0 : this.config.min,
max: this.config.max === undefined ? 1 : this.config.max
}
} else {
this.dataRange = {
min: this.config.min === undefined ? 0 : config.min,
max: this.config.max === undefined ? 25 : config.max
min: this.config.min === undefined ? 0 : this.config.min,
max: this.config.max === undefined ? 25 : this.config.max
}
}
}
Expand Down

0 comments on commit fddefa7

Please sign in to comment.