dalliance icon indicating copy to clipboard operation
dalliance copied to clipboard

Colors in BED format are ignored

Open max-l opened this issue 8 years ago • 2 comments

I am using this stylesheet to display bed tracks : https://www.biodalliance.org/stylesheets/gencode.xml

The rows in the bed tracks have colors that are not honored by the browser, I suspect that the stylesheet is designed override the color.

Here is a sample line in my bed track :

10	14521189	14530459	NP_001269626.1	500	-	14521189	14530459	20,50,0	3	117,151,128	0,679,9142

It displayed as red boxes.I suppose the browser assigns the stylesheet type "translation" or "bb-translation" from the genecode.xml stylesheet, but I don't see how, there is nothing in the row that "says" they are a translation or a "bb-translation".

The genecode.xml stylesheet does exactly what I need (display the tracks as boxes against a genome), except for the color, would love to know how to control the color from the stylesheet or get it to honor the RGB color in bedtracks....

If there was a JSON version of the gencode.xml stylesheet it would be pure pleasure to use it (instead of genecode.xml)...

Oh, and thanks for this great project ! ;-)

max-l avatar Feb 11 '17 19:02 max-l

Colours in BED and bigBed files are supported, but need to be explicitly enabled (which is necessary in order to match UCSC track-hub behaviour).

You can do this with the BGITEM stylesheet property: http://www.biodalliance.org/stylesheets.html

To get a well-behaved gene track with gene bodies coloured according to the itemRgb field of a bigBed file, you probably want (using your preferred JSON format):

       {
             name: 'Colourful gene track',
             bwgURI: '/path/to/genes.bw',
             style: [
                   {type: 'transcript',
                    style: {
                        glyph: 'BOX',
                        HEIGHT: 10,
                        FGCOLOR: 'black'
                        BGCOLOR: 'white',
                        BUMP: 'yes',
                        LABEL: 'yes'
                    }
                 },
                 {type: 'translation',
                  style: {
                         glyph: 'BOX',
                         HEIGHT: 10,
                         FGCOLOR: 'black',
                         BGITEM: 'yes'
                 }}]
       }

dasmoth avatar Feb 13 '17 16:02 dasmoth

It works wonderfully, thanks !

max-l avatar Feb 15 '17 21:02 max-l