lidaof / eg-react

WashU Epigenome Browser
https://epigenomegateway.wustl.edu
Other
68 stars 30 forks source link

About local data hub #163

Closed ddepierre closed 4 years ago

ddepierre commented 4 years ago

Hi Washu Browser team,

I've got few questions about local data hub.

Once I loaded local tracks and setted up parameters such as tracks color, Yaxis limits and whatever, can I download a hub.config.json file to reload same tracks with same parameters or do I have to write it by hand using https://eg.readthedocs.io/en/latest/datahub.html ?

I started to write a hub.config.json test file by hand, I don't really get how does smooth parameter work. On the browser, I setted it to 3 pixels, when I set it on 3 in the hub.config.json as : { "filename": "my_most_beautifull_track1.bw", "type": "bigwig", "name": "track1", "options": {"color": "#b825b5", "height": 100, "yScale": "fixed", "yMax": "7", "yMin": "0", "smooth": "3"} },

Loading successful but tracks were completely flat and I had to reset it to 0 then to 3 to obtain the smooth I wanted. I guess it is due to : _"The browser will use the mean values from region [current_position - smooth, currentposition + smooth]". Is the smooth computed from the current window view ? Do I have to set a current position/window which is used to compute the smooth ? What did I miss ?

Thanks,

David

lidaof commented 4 years ago

Hi David @ddepierre , unfortunately so far you need to setup the track options in advance for local data hubs, I can try to code something to make the local hub downloadable after configuration.

Smooth function make the curve looks flat, it uses data from nearby smooth pixels to average the data, say when you set smooth as 1, at pixel 1000, it will use average of data at 999, 1000 and 1001px to represent data at 1000px, it does nothing with current position/window. Is it clear?

thanks!

ddepierre commented 4 years ago

Hi, Thanks for your answer, but I still have an issue with smooth param in hub.config.json. Here I compare the same bigwig track, the pink one is loaded using hub.config.json [ { "filename": "My_most_beautifull_track1.bw", "type": "bigwig", "name": "track1_configJSON", "options": {"color": "#b825b5", "height": 100, "yScale": "fixed", "yMax": "7", "yMin": "0", "smooth": "3"} }, ]

and green one is handly loaded and setted up.

washu1

But as you can see, it seems there is a problem with smooth function when applied from hub.config.json file and I have to reset the smooth param handly to 0 then to 3 to make the pink track looking like the green.

Here are parameters for both track, they are set the same and for pink one well recovered from json file :
washu2 washu3

But actually I just realized the problem comes from smooth param on hub.config.json file : [ { "filename": "My_most_beautifull_track1.bw", "type": "bigwig", "name": "track1_configJSON_NO_SMOOTH", "options": {"color": "#4f75b3", "height": 100, "yScale": "fixed", "yMax": "7", "yMin": "0" } }, { "filename": "My_most_beautifull_track1.bw", "type": "bigwig", "name": "track1_configJSON_SMOOTH_0", "options": {"color": "#6c2f9e", "height": 100, "yScale": "fixed", "yMax": "7", "yMin": "0", "smooth": "0"} }, { "filename": "My_most_beautifull_track1.bw", "type": "bigwig", "name": "track1_configJSON_SMOOTH_3", "options": {"color": "#b825b5", "height": 100, "yScale": "fixed", "yMax": "7", "yMin": "0", "smooth": "3"} }, ]

Blue one has no smooth param on the json, purple one has smooth set to 0 and pink one has smooth set to 3 (see the hub.config.json file attach below) :

washu417

[ { "filename": "My_most_beautifull_track1.bw", "type": "bigwig", "name": "track1_configJSON_NO_SMOOTH", "options": {"color": "#4f75b3", "height": 100, "yScale": "fixed", "yMax": "7", "yMin": "0" } }, { "filename": "My_most_beautifull_track1.bw", "type": "bigwig", "name": "track1_configJSON_SMOOTH_0", "options": {"color": "#6c2f9e", "height": 100, "yScale": "fixed", "yMax": "7", "yMin": "0", "smooth": "0"} }, { "filename": "My_most_beautifull_track1.bw", "type": "bigwig", "name": "track1_configJSON_SMOOTH_3", "options": {"color": "#b825b5", "height": 100, "yScale": "fixed", "yMax": "7", "yMin": "0", "smooth": "3"} }, ]

Do I missuse the smooth param in json file ?

Best,

David

lidaof commented 4 years ago

This looks pretty interesting/weird 😄 @ddepierre

smooth should be a number, try use 1, 2, 3 instead of "1", "2" "3", I will cast it to integers in the code.

ddepierre commented 4 years ago

Aaaah ok ! it works with "smooth": 3 ! Thanks a lot !

David

lidaof commented 4 years ago

That's great! I applied the cast, "3 "will also work on next release.

ddepierre commented 4 years ago

Hi, As you answer fast, I'm gonna benefit again. I've got an issue with bed file loading using hub.config.json:

I managed to hanldy load a bed file (histone modification domains calling) in blue. When I try to load the same bed file using hub.config.json script with:

{ "filename": "The_bed_s_too_big_without_you.bed", "type": "bed", "name": "BED_HUBLY_LOADED", "options": {"displayMode": "density", "color": "#42f542", "height": 40} },

I get that: whasu_5

What did I miss ?

BTW, the dynamic plot is so great ! Thanks for that ! Is there a way to add it in the hub.config.json file ?

Best,

David

lidaof commented 4 years ago

Hi @ddepierre David, for bed track, you did upload put the .tbi file together with the bed.gz and upload the entire folder? It should be work as I tested from my side. thanks for using dynamic plot, it can be used in local hub as well.

this is my files in the folder I am going to upload: image

and this is the content of hub.config.json:

[
    {
        "filename": "TW551_20-5-bonemarrow_MRE.CpG.bigWig",
        "type": "bigwig",
        "name": "a bigwig track",
        "options": {"color": "red", "smooth": "4"}
    },
    {
        "filename": "scATAC.bed.gz",
        "type": "bed",
        "name": "a bed track",
        "options": {"displayMode": "density", "color": "#42f542", "height": 40}
    },
    {
        "filename": "a.dbg.gz",
        "type": "dbedgraph",
         "name": "a dbedgraph track",
        "options": {
            "dynamicLabels": ["stage1","stage2","stage3","stage4","stage5","stage6","stage7","stage8","stage9","stage10"],
            "dynamicColors": ["red", "blue", "#00FF00", 0],
            "useDynamicColors": true
            }
    }
]

and the results: image

let me know if it doesn't work for you, thanks!

lidaof commented 4 years ago

closing for now, feel free to reopen it.