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
460 stars 199 forks source link

Some question about y-axis scales on track #1611

Closed ydy1127 closed 2 years ago

ydy1127 commented 2 years ago

Hi,

I have set the min_score(0) and max_score(1500) manually, but y-axis scales on track is from 0 to 2000.

image image

How to set the JBrowse to display the expected y-axis(0-1500)?

cmdcolin commented 2 years ago

Is this a custom plugin that does this dialog box? If so it is very nice :)!

The thing you are running into probably is that JBrowse tries to "round up" in some cases, apparently pretty aggressively e.g. 1500->2000

I think if you set "fixBounds":false on the track config, then it will not do the rounding. It can also have string values corresponding to the type of scale fixing it tries to do e.g. "none" (similar to false IIRC) and "micro", "minor","major" (default major I believe)

cmdcolin commented 2 years ago

See also https://jbrowse.org/docs/bigwig.html

ydy1127 commented 2 years ago

Hi,

Thanks for your reply. I have try to set "fixBounds":false on the track config.

image

As shown in the figure above, the y-axis still shows "0-2000". So, we tried to change some source code which refers to "fixBounds", including "jbrowse/src/JBrowse/View/Ruler.js","jbrowse/src/JBrowse/View/Track/_YScaleMixin.js",”jbrowse/src/JBrowse/View/Track/Wiggle/XYPlot.js“. But none of them solved the problem.

We think it might be because of the step size of the y-axis. Because when we set "0-11", it will show "0-20";Set "0-110" display "0-200" to look like the step size is an integer multiple of 10, although this makes for a more aesthetically pleasing display of the axes. When we focus on certain region, whether we can change the configuration or code to address this limitation?

cmdcolin commented 2 years ago

Hmm, If I understand everything, I think it works for me I try with a sample track

set

maxScore=123 fixBounds=false

Then the scale it precisely at 123

maxScore=123 fixBounds=true

Rounds up to 130

Note that fixBounds:false was added in 1.16.2

ydy1127 commented 2 years ago

Thanks for your reply.

We thought maybe the version we were using was too low (JBrowse 1.11.5) . We have been using this version on our server for a long time. Is there any way to solve this problem on our old version?

cmdcolin commented 2 years ago

you could try to backport this patch I think it is fairly small https://github.com/gmod/jbrowse/pull/1306

ydy1127 commented 2 years ago

Thank you very much.

Follow the link you provided,we changed as follows:

1,/var/www/html/jbrowse/src/JBrowse/View/Ruler.js

line 61 change to : fixLower: this.fixBounds ? (typeof this.fixBounds=='string' ? this.fixBounds : 'major') : 'none', line 62 change to : fixUpper: this.fixBounds ? (typeof this.fixBounds=='string' ? this.fixBounds : 'major') : 'none',

2,/var/www/html/jbrowse/src/JBrowse/View/Track/Wiggle/XYPlot.js

line 71change to : fixBounds: 'fixBounds' in this.config ? this.config.fixBounds : true,

In addition, we restarted the network service after modifying the files. However, it still does not solve the problem.

Do we need to change anything else, or reinstall and configure JBrowse for the modified ".js" file to take effect.

cmdcolin commented 2 years ago

You may need to use the "dev" package e.g. JBrowse-1.11.5-dev.zip instead of JBrowse-1.11.5.zip

If you are using the non-dev package, then editing those files will have no effect, as most of the data will have been compiled/minified into src/dojo/dojo.js

You can retry your procedure with this package, e.g. the dev package https://jbrowse.org/releases/JBrowse-1.11.5-dev.zip

ydy1127 commented 2 years ago

OK. Thank you very much! I will try this method.

cmdcolin commented 2 years ago

let me know if there are any other issues...maybe close for now