Skip to content

Instantly share code, notes, and snippets.

@turner
Last active May 10, 2017 21:31
Show Gist options
  • Save turner/568bc67f5f2cda81c97fcc0cb19f9b69 to your computer and use it in GitHub Desktop.
Save turner/568bc67f5f2cda81c97fcc0cb19f9b69 to your computer and use it in GitHub Desktop.
IGV in Bootstrap Tab. Lazy-load browser.
<script type="text/javascript">
var browser,
container,
options,
$e = $("a[href='#igv']");
options =
{
reference: {
id: "hg19",
fastaURL: "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/1kg_v37/human_g1k_v37_decoy.fasta",
cytobandURL: "https://s3.amazonaws.com/igv.broadinstitute.org/genomes/seq/b37/b37_cytoband.txt"
},
locus: "chr1:1,000,105-1,000,204",
tracks: [
{
name: "Genes",
type: "annotation",
format: "bed",
sourceType: "file",
url: "https://s3.amazonaws.com/igv.broadinstitute.org/annotations/hg19/genes/refGene.hg19.bed.gz",
indexURL: "https://s3.amazonaws.com/igv.broadinstitute.org/annotations/hg19/genes/refGene.hg19.bed.gz.tbi",
order: Number.MAX_VALUE,
visibilityWindow: 300000000,
displayMode: "EXPANDED"
},
{
name: "Phase 3 WGS variants",
format: "vcf",
url: "https://s3.amazonaws.com/1000genomes/release/20130502/ALL.wgs.phase3_shapeit2_mvncall_integrated_v5b.20130502.sites.vcf.gz",
indexURL: "https://s3.amazonaws.com/1000genomes/release/20130502/ALL.wgs.phase3_shapeit2_mvncall_integrated_v5b.20130502.sites.vcf.gz.tbi",
type: "variant"
}
]
};
container = document.getElementById('igvDiv');
$e.on('shown.bs.tab', function(e) {
if (undefined === browser) {
browser = igv.createBrowser(container, options);
}
});
if ($('#igv').hasClass('active')) {
browser = igv.createBrowser(container, options);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment