[Gmod-ajax] Add color to gff file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Gmod-ajax] Add color to gff file

Sansheng Chen
Hi! All,

Do anyone know how to add color to gff file when the strand doesn't show it positive or negative? Thanks!

best,
sansheng

------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Add color to gff file

Colin
Hi there,

Sorry for the delay, did you find any answer for this? I think it should be pretty easy to do if I understand correctly. 

For example, if you are using CanvasFeatures, you can add a function inside trackList.json like this:

"style": {"color": "function(feature) { if(feature.get('strand')!=-1&&feature.get('strand')!=1) { return 'green' } else return 'red' }" }

This function is very simple, it just checks if the "strand" is -1 or 1 and returns a color conditionally based on that.

Hope that helps

-Colin

On Sun, Aug 30, 2015 at 5:24 PM, Sansheng Chen <[hidden email]> wrote:
Hi! All,

Do anyone know how to add color to gff file when the strand doesn't show it positive or negative? Thanks!

best,
sansheng

------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax