igvteam / igv

Integrative Genomics Viewer. Fast, efficient, scalable visualization tool for genomics data and annotations
https://igv.org
MIT License
647 stars 386 forks source link

Bedgraph display scaling bug #1623

Open mbosm opened 7 hours ago

mbosm commented 7 hours ago

Hello, I've run into what I'm guessing is an odd little graphical scaling bug. I'm seeing it for bedgraphs in which a lot of data has to be displayed at once. Depending on what 'zoom' level I'm at, I'll get different amounts of data displayed, and the default view is not representative of the 'zoomed in' view.

Here's three shots of the same data in IGV. Each has the same three bedgraph files loaded, and I'm looking at the same location in the genome, approximately 9000 bases in size. Since there are more bases (and bedgraph values) than horizontal pixels, I appreciate that there will need to be some abbreviation. But it seems like the calculations that abbreviate the data are failing somewhere.

tall1

tall2

tall3

The farthest zoom level is the default view. The Sample2 bars are sparse, and there's only a handful of high peaks.

Zoom level 2, I can get to by just clicking the zoom button. Note that it's still displaying the same number of nucleotides, 9334, and Sample1, which is sparsely populated, hasn't changed, but now Sample2 is displaying much more sites. Also, at places like ~600 nt and ~2700 nt, high value peaks appear that were previously absent now appear, and one peak that was at ~5500 nt disappears!

Zoom level 3, I managed to 'trick' the program into displaying by manually resizing the window back and forth until this zoom level 'stuck'. Note that the window is the same size, and the upper dropdown says it's still displaying nucleotides 1-9333, but the black-color span above the 'ruler' has changed from 9334 bp to 9330 bp. Again, the number of bars in the Sample 2 display expands, and new peaks appear. The one at ~3700 nt stands out as a very high peak that would otherwise be absent.

Note that while so many of these peaks are climbing up and down or disappearing and reappearing, there are others, like ~1000 nt or ~8200 nt that stay rock-solid in terms of appearance.

I'm not sure what to make of this. I could probably get around the problem by reducing the number of data points in the bedgraph file to only those peaks that are above a threshold, but as-is, I could get three completely different visual representations of the data based simply on how I navigate to that area of the genome.

jrobinso commented 4 hours ago

I can't really comment much without test data, but what you see at each zoom level is an average over the width in base pairs of the screen pixel. You can turn this off from the menu by selecting "None" for the windowing function from the menu.

I can't read the font on the screenshots, too small, and clicking them gives a "not found" error. Not sure what is going on there.

If you'd like to zip and attach a sample dataset I'll look into it further. Also, please tell us what version of IGV you are using.

mbosm commented 4 hours ago

Yeah, not sure why the photos can't be opened, as you mentioned. I uploaded them the normal way to github. Sample 2 is the third one shown, the one in cyan.

This is with the linux version of IGV, 2.18.4. I've zipped up the reference, the bedgraph file, and the three photos uploaded above.

igv_bedgraph.zip

jrobinso commented 2 hours ago

Have you tried switching the "windowing function" to None?

mbosm commented 2 hours ago

Yes, that seems to make the behavior go away. Thanks.