elsiklab / multibigwig

A JBrowse plugin for plotting multiple bigwig subtracks
12 stars 2 forks source link

Changes to colors have broken non-continuous #8

Closed keiranmraine closed 7 years ago

keiranmraine commented 8 years ago

Hi,

The changes since #5 & #7 were merged has resulted in line/fill colour not working for non-continuous data and defaulting to black.

{
  "storeClass" : "MultiBigWig/Store/SeqFeature/MultiBigWig",
  "urlTemplates" : [
    {"url":"A.bw","name":"A", "nonCont": true, "color": "green"},
    {"url":"C.bw","name":"C", "nonCont": true, "color": "blue"},
    {"url":"G.bw","name":"G", "nonCont": true, "color": "black"},
    {"url":"T.bw","name":"T", "nonCont": true, "color": "red"}
  ],
  "showTooltips": true,
  "label" : "Alleles",
  "type" : "MultiBigWig/View/Track/MultiWiggle/MultiXYPlot"
}

Now results in the following rather than images as found in #5:

screen shot 2016-08-24 at 13 23 17

There don't appear to be any relevant errors in the js console and removing the 'nonCont' option results in expected colour on lines.

keiranmraine commented 8 years ago

I've managed to isolate it to this commit:

https://github.com/elsiklab/multibigwig/commit/053e33d3f0079b4e683fc3c1a0c8cde3605a2d9a

cmdcolin commented 8 years ago

Thanks for the details! I tried fixing it up on master.

I also augmented a test dataset with a nonCont example that I can use as a sanity check

can browse to http://localhost/jbrowse/?data=plugins/MultiBigWig/test/data to see

keiranmraine commented 8 years ago

Thanks @cmdcolin that's working as expected now:

screen shot 2016-08-25 at 10 50 40

The above shows a track with 4 bigwig files to show the allele fraction makeup of each position in extremely deep sequence (amplicon/targeted seq primarily).

I'd like to use the multibigwig code as a basis for a new plugin which generates a filled stacked +ve display with a mouseover for the actual count values (may need a few pointers on this bit). Are you happy with this?

cmdcolin commented 8 years ago

Cool! I think adding mouseover back is possible.

MultiWiggleBase does inherit from jbrowse's regular WiggleBase, and might inherit some of the mouseover functionality from there but maybe it's not initializing the event handler.

xref #2

srobb1 commented 7 years ago

Hi. I am excited to use this plugin, this is exactly what I needed. I think I am having a problem related to this issue. Hopefully my errors can help you out.

I just cloned your repository today and tried it out.

My data is not diplayed and I am getting this error in my console: dojo.js:1005 TypeError: Cannot read property 'color' of undefined TypeError: Cannot read property 'color' of undefined at . (http://10.0.53.138/jbrowse/plugins/multibigwig/js/View/Track/MultiWiggle/MultiXYPlot.js:102:36) at Object.forEach (http://10.0.53.138/jbrowse/src/dojo/dojo.js:162:162) at . (http://10.0.53.138/jbrowse/plugins/multibigwig/js/View/Track/MultiWiggle/MultiXYPlot.js:93:23) at Object.forEach (http://10.0.53.138/jbrowse/src/dojo/dojo.js:162:162) at _drawFeatures (http://10.0.53.138/jbrowse/plugins/multibigwig/js/View/Track/MultiWiggle/MultiXYPlot.js:92:19) at _draw (http://10.0.53.138/jbrowse/src/dojo/dojo.js:1451:44) at renderBlock (http://10.0.53.138/jbrowse/src/dojo/dojo.js:1449:194) at http://10.0.53.138/jbrowse/src/dojo/dojo.js:1450:396 at Object.forEach (http://10.0.53.138/jbrowse/src/dojo/dojo.js:162:197) at http://10.0.53.138/jbrowse/src/dojo/dojo.js:1450:338 TypeError: Cannot read property 'color' of undefined at . (http://10.0.53.138/jbrowse/plugins/multibigwig/js/View/Track/MultiWiggle/MultiXYPlot.js:102:36) at Object.forEach (http://10.0.53.138/jbrowse/src/dojo/dojo.js:162:162) at . (http://10.0.53.138/jbrowse/plugins/multibigwig/js/View/Track/MultiWiggle/MultiXYPlot.js:93:23) at Object.forEach (http://10.0.53.138/jbrowse/src/dojo/dojo.js:162:162) at _drawFeatures (http://10.0.53.138/jbrowse/plugins/multibigwig/js/View/Track/MultiWiggle/MultiXYPlot.js:92:19) at _draw (http://10.0.53.138/jbrowse/src/dojo/dojo.js:1451:44) at renderBlock (http://10.0.53.138/jbrowse/src/dojo/dojo.js:1449:194) at http://10.0.53.138/jbrowse/src/dojo/dojo.js:1450:396 at Object.forEach (http://10.0.53.138/jbrowse/src/dojo/dojo.js:162:197) at http://10.0.53.138/jbrowse/src/dojo/dojo.js:1450:338

Here is my track configuration: { "storeClass" : "MultiBigWig/Store/SeqFeature/MultiBigWig", "urlTemplates" : [ {"url" : "../files/0dpa.minus.bw", "color": "red"}, {"url" : "../files/0dpa.plus.bw" , "color": "green" }, ], "showTooltips": true, "label" : "Multibigwig", "key" : "Multibigwig", "type" : "MultiBigWig/View/Track/MultiWiggle/MultiXYPlot" }

I tried with out the "nonCont" option, and with it set to true and to false. The above errors are from when I did not use the option.

Thanks, Sofia

cmdcolin commented 7 years ago

looks like that would be due to not having a "name" for each bigwig file. for example I think the following might fix it

{
"storeClass" : "MultiBigWig/Store/SeqFeature/MultiBigWig",
"urlTemplates" : [
{"url" : "../files/0dpa.minus.bw", "color": "red", "name":"0dpa.minus"},
{"url" : "../files/0dpa.plus.bw" , "color": "green", "name":"0dpa.plus" },
],
"showTooltips": true,
"label" : "Multibigwig",
"key" : "Multibigwig",
"type" : "MultiBigWig/View/Track/MultiWiggle/MultiXYPlot"
}

potentially the plugin could just synthesize a name if one wasn't specified but I think adding one will fix that bug :)

srobb1 commented 7 years ago

Yes! Adding a name fixed my problem. It works great now!

cmdcolin commented 7 years ago

super. I think the original issue from this thread was fixed awhile back so I suppose close for now.