GMOD / jbrowse

JBrowse 1, a full-featured genome browser built with JavaScript and HTML5. For JBrowse 2, see https://github.com/GMOD/jbrowse-components.
http://jbrowse.org
Other
464 stars 199 forks source link

grouped track autoscaling #254

Open rbuels opened 11 years ago

rbuels commented 11 years ago

That's a good point. A more powerful version of this idea would probably be to have a way to group tracks that should all autoscale together, based on them being the same type of data, or in the same group of tracks.

On 05/13/2013 05:14 PM, Nathan Boley wrote:> Hi All,

The new auto-scaling feature is very useful for viewing RNAseq data, but it also (ironically) makes it difficult to compare expression levels across samples. Would it be possible to add another scaling feature that scales to the same max over all samples , i.e. 'autoscale': 'page'? ( or, even better, over selected samples, but that seems like much more work and the former would be tremendously useful )

Thanks again for all of your hard work!

Best, Nathan

Gmod-ajax mailing list Gmod-ajax@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gmod-ajax

rbuels commented 11 years ago

Probably group tracks together according to track metadata. Something like:

autoscale: 'metadata:Category'

to autoscale tracks together that all have the same 'Category' metadata item.

rbuels commented 11 years ago

@slowkow says:

I propose an extra configuration value in trackList.json called group and a new autoscale called local_group. Each track object in the tracks array can belong to a single group defined by the group property.

When using autoscale local, each wiggle track has a unique y-scale according to its own maximum value. With local_group, all tracks in a group share the same y-scale.

What do you think? I might try to hack on this eventually but I wonder if you think this is a good idea or if you have ideas about implementation details. I'm looking at JBrowse/View/Track/Wiggle/_Scale.js and see that each wiggle track seems to be independent of the others. Perhaps the track could ask a View object for the maximum among all displayed tracks that belong to this track's group? I have just opened the code so I'm just thinking out loud.

Visual

BEFORE
------

Track 1    | |  ||               -10
           |||||||        |||    -0

Track 2    |              |||    -50
           ||             |||    -0

Track 3    |    ||         |     -1000
           |||||||        |||    -0

AFTER
-----

# Let's say "Track 1" and "Track 2" are in a group "group1"
# because the data from the two tracks is comparable.
# *** So, we change the maximum y value for "Track 1"
#     to match "Track 2".

Track 1                          -50 ***
           :::::::        :::    -0

Track 2    |              |||    -50
           ||             |||    -0

Track 3    |    ||         |     -1000
           |||||||        |||    -0

This way, we can get the benefit of increasing the size of small bars as when using the local autoscale option. And by using groups, we can directly compare wiggle tracks by having them share the same y-scales.

Also, it would be nice to first trim each wiggle track individually by a z-score cutoff so that a single track does not dominate the others in the group with a large y-scale.

In trackList.json:

{
         "style" : {
            "clip_marker_color" : "black",
            "variance_band_color" : "rgba(0,0,0,0.3)",
            "neg_color" : "black",
            "pos_color" : "rgb(255,165,79)",
            "height" : 30,
            "origin_color" : "#888"
         },
         // *** share y-scale with other tracks in group "gtex"
         "group": "gtex",
         "autoscale" : "local_group", // ***
         "key" : "Adipose - Subcutaneous",
         "storeClass" : "JBrowse/Store/SeqFeature/BigWig",
         "urlTemplate" : "gtex/Adipose_Subcutaneous.bw",
         "label" : "Adipose - Subcutaneous",
         "type" : "JBrowse/View/Track/Wiggle/XYPlot",
         "z_score_bound" : 2
      }
}
andronekomimi commented 10 years ago

Hello rbuels,

Hello, I think I've tried my best but I didn't succeed in having this kind of results. Each track seems to have its own scale mode. Do you see an obvious mistake in my trackList.json file : { "tracks" : [ { "storeClass" : "JBrowse/Store/Sequence/StaticChunked", "chunkSize" : 20000, "urlTemplate" : "seq/{refseq_dirpath}/{refseq}-", "label" : "DNA", "type" : "SequenceTrack", "category" : "Reference sequence", "key" : "Reference sequence" }, { "style" : { "className" : "feature", "color" : "crimson" }, "autoscale" : "local_group", "key" : "Specific reads 3", "group" : "test1", "storeClass" : "JBrowse/Store/SeqFeature/NCList", "trackType" : "CanvasFeatures", "urlTemplate" : "tracks/Specific reads 3/{refseq}/trackData.json", "compress" : 0, "label" : "Specific reads 3", "type" : "CanvasFeatures" }, { "style" : { "className" : "feature", "color" : "lightseagreen" }, "autoscale" : "local_group", "key" : "Multi reads 2", "group" : "test1", "storeClass" : "JBrowse/Store/SeqFeature/NCList", "trackType" : "CanvasFeatures", "urlTemplate" : "tracks/Multi reads 2/{refseq}/trackData.json", "compress" : 0, "label" : "Multi reads 2", "type" : "CanvasFeatures" } ], "formatVersion" : 1 }

I'm using Firefox 16.0.6. Thank you very much for your help !

Neko

cmdcolin commented 10 years ago

@andronekomimi I don't think this has been implemented yet (otherwise this issue page would probably be closed). looks like a great feature though, maybe we can refresh interest in it.

lpryszcz commented 9 years ago

I'm also interested in this feature!

cmdcolin commented 6 years ago

There was additional interest in this at the GCCBOSC JBrowse BOF session

The user described interest in setting things like the "max score" across multiple bigwig tracks, or at the very least, something easier than doing "Edit config" to edit the "max_score" param manually.

vaneet-lotay commented 6 years ago

@cmdcolin, I would like to say I still have a lot of interest for this feature for the bigwig tracks that we use at Xenbase. There definitely needs to be a feature which groups tracks together so that they scale the same way, perhaps by track category or better yet thru a custom list.

Please assign this if you can and keep it as a feature request for a possible future release of JBrowse, I would really appreciate it, and I think there's evidence here that others would too.

If there's already an applicable feature that can handle this function, please point me to it then, I had posted it on the mailing list as well.

Thanks,

Vaneet

srobb1 commented 6 years ago

@cmdcolin @rbuels We definitely have interest in this feature for bigwig tracks.

Thanks, Sofia

vaneet-lotay commented 5 years ago

@cmdcolin @rbuels , I just want to reaffirm that we still have a lot of interest in a new feature that will handle this type of scaling problem.....

Thanks, Vaneet

cmdcolin commented 5 years ago

This feature is available in multibigwig if all your data files are grouped into that track https://github.com/elsiklab/multibigwig and can do global or local autoscaling on the group of files

I can see the appeal in doing it outside of multibigwig or in core, but I just thought I would mention it

vaneet-lotay commented 5 years ago

Yes this can work through multibigwig, @cmdcolin. However there are limitations to how tracks are graphed in a multibigwig group compared to regular bigWig tracks....they both each have their pros and cons I guess for different purposes.

I guess I'm saying I still find 'grouped' autoscaling outside multibigwig appealing :)

feedmewifi commented 4 years ago

I want to add that I would really like to see this implemented!