Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using autoscale local, but having pos_color and neg_color relative to global mean #1530

Open
Jungal10 opened this issue Jul 15, 2020 · 6 comments

Comments

@Jungal10
Copy link

I am using Jbrowse version 1.16.9 to create my Genome Browser.

I have multiple XYplots in which I am using autoscale:local. This is an important feature or for me, as I have some extreme values along with the genome and it is useful that the scale is adjustable for the window.
My issue is that it results in having the pos_color and neg_color relative to the local mean and not to the global mean, as I intend to. Especially in regions where the global mean is not visible, it can lead to misinterpretations since I am adding selection and population genetics statistics on it.

Screen Shot 2020-07-15 at 09 05 12

Is there any workaround where I can use autoscale local for the scale, but maintaining the color relative to the global mean?

Thank you

@cmdcolin
Copy link
Contributor

One option might be to set the bicolor_pivot in the config to the number to flip on, you would have to manually calculate it for the data upfront (and that would be across all chromosomes, but technically in bigwig the global is also)

@Jungal10
Copy link
Author

That one can be used to adjust the value for a certain region, but then again it will be a problem when looking for values that deviate from the pivot. Chromosome-wide there will be regions that deviate strongly from the mean. For example, if you are looking for signals of selection, as the tracks I am intending to apply, those sites are especially interesting. So, in those regions, the local mean is far from the global mean, but as the pivot is applied locally, it will look like regions in blue like in the image are above the mean, but this is not the reality. At the same time, if the scale is global, the values are too small for being observable.

This why I needed the ruler to be adjusted locally, but the pos_color and neg_color to be relative to the global mean.

Screen Shot 2020-07-15 at 15 47 51

@cmdcolin
Copy link
Contributor

I think having "autoscale": "local" should adjust the ruler locally, but then having "bicolor_pivot": 6000 would mean that the colors are always pivoted relative to 6000

Is that not what is the proper behavior?

@Jungal10
Copy link
Author

Now I understand what you mean. Yes, that will solve the color issue. I was overthinking, trying to have all at once.

But I still have one issue. The local mean line will be lost with this procedure since the "origin" is now defined with the bicolor_pivot:6000.

Any way of having the best of both worlds?

Thank you

@cmdcolin
Copy link
Contributor

I changed our sample data config "volvox_microarray" to have bicolor_pivot=200 and noFill=true

localhost_jbrowse__data=sample_data%2Fjson%2Fvolvox loc=ctgA%3A22804 36717 tracks=volvox_microarray_bw_xyplot highlight=

It seemed to keep the mean line. What is the origin that is lost?__

@Jungal10
Copy link
Author

If you have autoscale : local and you define the bicolor_pivot : mean you will have:

  • global mean line (yellow)
  • pos and neg_color relative to the local mean
  • origin line representing the local mean (black line on my example above)

Now, having defined bicolor_pivot : 200, you will have:

  • global mean (yellow)
  • pos and neg_color relative to 200
  • origin_line (black line) = 200

So, you do not have your origin line representing the local mean, since you are using it as the pivot to separate neg and pos color.
I am asking if there is any way of adding a local mean line to the track beside the defined settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants