dasmoth / dalliance

Interactive web-based genome browser.
http://www.biodalliance.org/
BSD 2-Clause "Simplified" License
226 stars 68 forks source link

rgbItem color not displaying #238

Closed denisemauldin closed 6 years ago

denisemauldin commented 6 years ago

I'm making a BED file from a list of positions.

chr5    45003655    45003681    LEFT01  400 +   45003655    45003673    253,174,97  2   18,1    0,25
chr5    45003680    45003706    RIGHT01 629 -   45003689    45003706    171,217,233 2   1,17    0,9
chr5    45003695    45003719    LEFT11  540 +   45003695    45003712    254,224,144 2   17,1    0,23
chr5    45003718    45003744    RIGHT11 433 -   45003726    45003744    253,174,97  2   1,18    0,8
chr5    45003732    45003758    LEFT21  431 +   45003732    45003751    253,174,97  2   19,1    0,25
chr5    45003757    45003787    RIGHT21 425 -   45003766    45003787    253,174,97  2   1,21    0,9
chr5    45003767    45003794    LEFT31  360 +   45003767    45003787    244,109,67  2   20,1    0,26
chr5    45003793    45003818    RIGHT31 592 -   45003801    45003818    254,224,144 2   1,17    0,8

I'm using this biodalliance style:

style: [
                    {
                        type: 'transcript',
                        style: {
                            glyph: 'BOX',
                            HEIGHT: 10,
                            FGCOLOR: 'black',
                            BGCOLOR: 'white',
                            BUMP: 'yes',
                            LABEL: 'yes',
                            ZINDEX: 20

                        }
                    },
                    {
                        type: 'translation',
                        style: {
                            glyph: 'BOX',
                            HEIGHT: 10,
                            FGCOLOR: 'black',
                            BGITEM: 'yes',
                            ZINDEX: 200,
                        }
                    }]

It seems like the white of the transcript is overwriting the BGITEM color that should be showing:

screen shot 2018-06-28 at 6 44 36 pm

This seems like a bug. The bf objects in the bedwig.js have translation objects for each BED line.

Doesn't show color:

{
    "groups": [{
        id: "LEFT01",
        max: 45003682,
        min: 45003656,
        notes: [],
        type: "transcript"
    }],
    itemRgb: "rgb(253,174,97)",
    label: "LEFT01",
    max: 45003674,
    min: 45003656,
    orientation: "+",
    score: 400,
    segment: "chr5",
    type: "translation",
}

Does show color:

groups: [{
        id: "LEFT11"
        max: 45003720
        min: 45003696
        notes: []
        type: "transcript"
    }],
    itemRgb: "rgb(254,224,144)",
    label: "LEFT11",
    max: 45003713,
    min: 45003696,
    orientation: "+",
    score: 540,
    segment: "chr5",
    type: "translation",
}
dasmoth commented 6 years ago

Sorry to hear you're having problems. This seems like a sort order issue ("transcript" sometimes rendering on top of "translation", in spite of the ZINDEX you've specified).

Have you tried using the master branch?

(Apologies for brief response, I should have more time to look into this tomorrow).

denisemauldin commented 6 years ago

When I wasn't able to get the npm package to install I downloaded the compiled version from the website, which is where I see this issue. I'll clone the git repo and try the master branch tomorrow. I'm concerned that the BED file I'm generating isn't quite right, but I'm not certain how to verify it. Thanks

denisemauldin commented 6 years ago

I cloned the repo and built from source and included the dalliance-all.js in my project and now the colors seem to work fine. When will a new release happen?

screen shot 2018-06-29 at 8 43 08 am