igvteam / igv.js

Embeddable genomic visualization component based on the Integrative Genomics Viewer
MIT License
640 stars 226 forks source link

Can we load gene track only ? #193

Closed deepaksibar closed 8 years ago

deepaksibar commented 8 years ago

As per requirement we have to render only gene track in a separate panel. No any other tracks, IdeoPanel, RulerTrack or setting panel will be visible. User will provide provide .gz and .gz.tbi gene files and only gene track should get rendered.

Please let me know if it is possible by implementation of igv.js

keithcallenberg commented 8 years ago

Hi Deepak,

I think you cannot currently avoid the IdeoPanel or RulerTrack. I think currently this is the most minimal configuration:

var div,
        options,
        browser;

        div = $("#igvDiv")[0];
        options = {
            showKaryo: false,
            showNavigation: false,
            genome: "hg19",
            locus: "chr1:1-1000",
            tracks: [
                {
                    name: "Genes",
                    url: "http://igv.broadinstitute.org/annotations/hg19/genes/gencode.v18.collapsed.bed",
                    displayMode: "EXPANDED"
                }
            ]
        };
        browser = igv.createBrowser(div, options);

I don't know the side effects, but it looks like a configuration option could be made to make the IdeoPanel creation optional, similar to showNavigation:

        if (!config.showNavigation) {
            igvLogo = $('<div class="igv-logo-nonav">');
            $(headerDiv).append(igvLogo[0]);
        }

        // ideogram
        browser.ideoPanel = new igv.IdeoPanel(headerDiv);
        browser.ideoPanel.resize();

but it looks like there may be some other objects dependent on the RulerTrack.

skushch commented 8 years ago

You could probably just use CSS styles to hide bits that you don't want:

#igvControlDiv {
    display: none;
}

.igv-ideogram-content-div {
    display: none;
}

.igv-track-container-div .igv-track-div:first-child {
    display: none;
}
jrobinso commented 8 years ago

Thanks all for the good suggestions. I was going to suggest overriding some CSS rules, that's the best option for now. I will add an option for this as Keith suggests as soon as possible.

jrobinso commented 8 years ago

I just added and pushed a few more fine grain controls. These changes did not make it in time to test sufficiently for the upcoming release candidate, but you can access them with the "beta" igv.js at http://igv.org/web/beta/. For a full working example see https://github.com/igvteam/igv.js/blob/master/dev/minimal.html.

amolpshinde07 commented 8 years ago

Thanks for quick response. You can close the issue.