igvteam / igv

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

Add sequence information to bedgraph or histogram to bed file #1346

Open vhecht opened 1 year ago

vhecht commented 1 year ago

cc: @nh13

I have a set of sequence features with a position and counts value that I am visualizing with IGV. I'm currently loading the file as a bedgraph, so that I can see the count value associated with each feature. However, with the bedgraph format, I can't include additional annotations (in particular, the sequence of each feature). I was wondering if there was any way to view both a histogram and the annotations? I was thinking about using a bed file, but it seems like I would then be unable to view the histogram.

Thanks a lot!

jrobinso commented 1 year ago

Where would you expect to see the annotation, in the popup text?

nh13 commented 1 year ago

Yes, in the popup text.

jrobinso commented 1 year ago

Well I'm looking over the 30 or so supported formats and don't see anything that would do what we need. it's surpising this hasn't come up before. Leave this open while I think about a solution. I'm thinking of an extended bedgraph format, which can already be considered "bed3+". In the meantime the best solution is probably to create 2 files, a "bed" and "bedGraph". Not optimal certainly, I will think about a better solution.

jrobinso commented 1 year ago

One difficulty here, when zooming out on numeric data tracks data is aggregated, using mean, min, or max for example. This would only make sense when you are zoomed in to see individual features. The UCSC has a similiar model, this is why I think there are no annotation fields on numeric formats such as wig, bedgraph, bigwig, etc.

Rather than break that model, which would be a big deal, I think it makes more sense to allow bed (note not bedgraph) scores to be plotted as a bar chart if you wish. Scores can currently be used to alpha shade features.

nh13 commented 1 year ago

Scores as a bar chart would be great. Hopefully there not a limit on the range for scores?

jrobinso commented 1 year ago

The official range is 0-1000, but IGV has always allowed an arbitrary range.

maximilianh commented 1 year ago

And we could allow arbitrary numbers, too. I don't know why we have a limit 0-1000, we could just remove the error message when they do not fit the format. And yes, plotting bedGraph scores like bigWigs, but they could have labels, mouse overs, etc.

On Sun, Jun 25, 2023 at 5:08 AM Jim Robinson @.***> wrote:

The official range is 0-1000, but IGV has always allowed an arbitrary range.

— Reply to this email directly, view it on GitHub https://github.com/igvteam/igv/issues/1346#issuecomment-1605839199, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACL4TPAVBORRA4QGZUDGN3XM6TR7ANCNFSM6AAAAAAZSC5VGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jrobinso commented 1 year ago

@maximilianh I think removing that error message is a good idea, I see a fair number of files with out-of-spec score values. In addition, can the color only be gray scale? In IGV we allow a color setting, defaults to black, and then let the range be defined by "viewLimit" to compute an alpha for the color. I think if "black" is used for the color and 0,1000 for view limits I get approximately the same shades. In javascript it looks like this

           const min = this.viewLimitMin : 0
            const max =  this.viewLimitMax : 1000
            const alpha = getAlpha(min, max, feature.score)
jrobinso commented 1 year ago

@maximilianh On bedGraph files, how are the additional annotations (labels, mouseovers) defined? This description only mentions the first 4 columns, can you add additional columns and if so how are the column headers (names) defined? I like to keep in spec so-to-speak with UCSC when I can. https://genome.ucsc.edu/goldenPath/help/bedgraph.html

maximilianh commented 1 year ago

Yes, viewLimits is from our spec: https://genome.ucsc.edu/goldenPath/help/trackDb/trackDbHub.html#viewLimits

On Mon, Jun 26, 2023 at 5:57 PM Jim Robinson @.***> wrote:

@maximilianh https://github.com/maximilianh I think removing that error message is a good idea, I see a fair number of files with out-of-spec score values. In addition, can the color only be gray scale? In IGV we allow a color setting, defaults to black, and then let the range be defined by "viewLimit" to compute an alpha for the color. I think if "black" is used for the color and 0,1000 for view limits I get approximately the same shades. In javascript it looks like this

       const min = this.viewLimitMin : 0
        const max =  this.viewLimitMax : 1000
        const alpha = getAlpha(min, max, feature.score)

— Reply to this email directly, view it on GitHub https://github.com/igvteam/igv/issues/1346#issuecomment-1607772526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACL4TPH45V7EEBORKBKKFLXNGWQJANCNFSM6AAAAAAZSC5VGE . You are receiving this because you were mentioned.Message ID: @.***>

maximilianh commented 1 year ago

Sorry, bedGraph files have no additional columns. I misspoke, I meant "bigBed scores", sorry!

On Mon, Jun 26, 2023 at 6:00 PM Jim Robinson @.***> wrote:

@maximilianh https://github.com/maximilianh On bedGraph files, how are the additional annotations (labels, mouseovers) defined? This description only mentions the first 4 columns, can you add additional columns and if so how are the column headers (names) defined? I like to keep in spec so-to-speak with UCSC when I can. https://genome.ucsc.edu/goldenPath/help/bedgraph.html

— Reply to this email directly, view it on GitHub https://github.com/igvteam/igv/issues/1346#issuecomment-1607780877, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACL4TOK23PSQDTAXVY23MLXNGW3FANCNFSM6AAAAAAZSC5VGE . You are receiving this because you were mentioned.Message ID: @.***>

jrobinso commented 1 year ago

OK, refreshing my memory on the issues here. I think what's needed is a bar graph option for displaying scores from a bed (or bigbed) file. That's doable and useful, but out of scope for this release which is coming soon. I'm removing it from this release milestone but keep it open.

maximilianh commented 1 year ago

bargraph-style display has a few drawbacks... you could also just accept bargraph-formatted bigBed data files and display them using your existing heatmap-like code.

On Sat, Sep 2, 2023 at 2:23 AM Jim Robinson @.***> wrote:

OK, refreshing my memory on the issues here. I think what's needed is a bar graph option for displaying scores from a bed (or bigbed) file. That's doable and useful, but out of scope for this release which is coming soon. I'm removing it from this release milestone but keep it open.

— Reply to this email directly, view it on GitHub https://github.com/igvteam/igv/issues/1346#issuecomment-1703557231, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACL4TLHR5AMYFAGGVKH7ADXYJ4AXANCNFSM6AAAAAAZSC5VGE . You are receiving this because you were mentioned.Message ID: @.***>