Skip to content

Commit

Permalink
Hubs 2 (#1720)
Browse files Browse the repository at this point in the history
Optimizations and bug fixes to support track hubs
  • Loading branch information
jrobinso authored Oct 23, 2023
1 parent c6ce255 commit 7c4c190
Show file tree
Hide file tree
Showing 66 changed files with 4,774 additions and 867 deletions.
8 changes: 8 additions & 0 deletions dev/annotation/annotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ <h1>Annotation tracks</h1>
"supportsWholeGenome": true,
"name": "Bed - No Index"
},
{
"type": "annotation",
"format": "bigBed",
"url": "../../genes.bb",
"indexed": false,
"supportsWholeGenome": true,
"name": "Bed - No Index"
},
{
"type": "annotation",
"format": "bed",
Expand Down
2 changes: 1 addition & 1 deletion dev/twobit/twobit.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
reference: {
id: "GCF_016699485.2",
format: "2bit",
twobitURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.2bit",
twoBitURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.2bit",
aliasBbURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.chromAlias.bb",
nameSet: "ucsc",
wholeGenomeView: false
Expand Down
52 changes: 52 additions & 0 deletions dev/twobit/twobit_aliasBB.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>twobit</title>
</head>

<body>

<div id="igvDiv" style="padding-top: 50px;padding-bottom: 20px; height: auto"></div>

<script type="module">

import igv from "../../js/index.js"

const config =
{
showChromosomeWidget: false,
locus: "NC_007194.1:1639659-1649659",
reference: {
id: "GCF_000002655.1",
format: "2bit",
twoBitURL: "../../test/data/twobit/GCF_000002655.1.2bit",
chromAliasBbURL: "../../test/data/twobit/GCF_000002655.1.chromAlias.bb",
wholeGenomeView: false,
nameSet: 'ucsc'
},
tracks: [
{
name: "GC Percent",
autoScale: false,
height: 36,
color: "rgb(0,0,0)",
altColor: "rgb(128,128,128)",
min: 30,
max: 70,
format: "bigWig",
url: "https://hgdownload.soe.ucsc.edu/hubs/GCF/000/002/655/GCF_000002655.1/bbi/GCF_000002655.1_ASM265v1.gc5Base.bw"
}
]
}

igv.createBrowser(document.getElementById('igvDiv'), config)
.then(browser => {

})


</script>

</body>

</html>
50 changes: 50 additions & 0 deletions dev/twobit/twobit_basic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>twobit</title>
</head>

<body>

<div id="igvDiv" style="padding-top: 50px;padding-bottom: 20px; height: auto"></div>

<script type="module">

import igv from "../../js/index.js"

const config =
{
showChromosomeWidget: false,
locus: "NC_007194.1:1639659-1649659",
reference: {
id: "GCF_000002655.1",
format: "2bit",
twoBitURL: "../../test/data/twobit/GCF_000002655.1.2bit",
wholeGenomeView: false
},
// tracks: [
// {
// name: "GC Percent",
// autoScale: false,
// height: 36,
// color: "rgb(0,0,0)",
// altColor: "rgb(128,128,128)",
// min: 30,
// max: 70,
// format: "bigWig",
// url: "https://hgdownload.soe.ucsc.edu/hubs/GCF/000/002/655/GCF_000002655.1/bbi/GCF_000002655.1_ASM265v1.gc5Base.bw"
// }
//]
}

igv.createBrowser(document.getElementById('igvDiv'), config)
.then(browser => {

})


</script>

</body>

</html>
2 changes: 1 addition & 1 deletion dev/twobit/twobit_chromSizes.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
reference: {
id: "GCF_016699485.2",
format: "2bit",
twobitURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.2bit",
twoBitURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.2bit",
chromeSizes: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.chrom.sizes.txt",
wholeGenomeView: false
}
Expand Down
87 changes: 48 additions & 39 deletions dev/twobit/twobit_t2t.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,69 @@

const config =
{
locus: "myc",
//locus: "myc",
locus:"CP068269.2:35,726,976-35,734,192",
showChromosomeWidget: false,
reference: {
"id": "chm13v2.0",
"name": "Human (T2T CHM13-v2.0)",
"fastaURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0.fa",
"indexURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0.fa.fai",
"cytobandURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/CHM13_v2.0.cytoBandMapped.bed",
"aliasURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/GCA_009914755.4.chromAlias.txt",
twobitURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/GCA_009914755.4.2bit",
wholeGenomeView: false,
id: "chm13v2.0",
name: "Human (T2T CHM13-v2.0)",
twoBitURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/GCA_009914755.4.2bit",
cytobandBbURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.cytoBandMapped/cytoBandMapped.bb",
aliasBbURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/GCA_009914755.4.chromAlias.bb",
chromAliasBbURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/GCA_009914755.4.chromAlias.bb",
nameSet: "ucsc",
"tracks": [
tracks: [
// {
// "id": "catLiftOffGenesV1",
// "name": "CAT/Liftoff Genes",
// "format": "bigbed",
// "description": " <a target = \"_blank\" href = \"https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/html/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1.html\">CAT + Liftoff Gene Annotations</a>",
// "url": "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1/catLiftOffGenesV1.bb",
// "displayMode": "EXPANDED",
// "height": 200,
// "visibilityWindow": -1,
// "supportsWholeGenome": false
// },
//
// // Include a hg38 bigwig track -- test chromosome aliasing
// {
// "url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
// "name": "Encode bigwig",
// },

// plain wig track
{
url: "../../test/data/hubs/ENCFF754TJH.wig",
name: "Encode wig"
},

// plain bed track
{
"id": "catLiftOffGenesV1",
"name": "CAT/Liftoff Genes",
"format": "bigbed",
"description": " <a target = \"_blank\" href = \"https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/html/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1.html\">CAT + Liftoff Gene Annotations</a>",
"url": "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1/catLiftOffGenesV1.bb",
"displayMode": "EXPANDED",
"height": 200,
"visibilityWindow": -1,
"supportsWholeGenome": false,
"order": 1000000
url: "../../test/data/hubs/catLiftOff.bed",
name: "plain bed"
},

// indexed bed track
{
"id": "augustus",
"name": "Augustus",
"format": "bigbed",
"description": " <a target = \"_blank\" href = \"https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/html/GCA_009914755.4_T2T-CHM13v2.0.augustus\">Augustus Gene Predictions</a>",
"url": "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.augustus.bb",
"displayMode": "EXPANDED",
"color": "180,0,0",
"height": 200,
"visibilityWindow": -1,
"supportsWholeGenome": false,
"order": 1000001
url: "../../test/data/hubs/catLiftOff.bed.gz",
indexUrl: "../../test/data/hubs/catLiftOff.bed.gz.tbi",
name: "indexed bed"
},

//bam
{
"name": "Genes",
"format": "bed",
"url": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0_geneLocations.short.bed.gz",
"hidden" : true,
"searchable": true
type: "alignment",
url: "https://1000genomes.s3.amazonaws.com/phase3/data/NA19625/exome_alignment/NA19625.mapped.ILLUMINA.bwa.ASW.exome.20120522.bam",
indexURL: "https://1000genomes.s3.amazonaws.com/phase3/data/NA19625/exome_alignment/NA19625.mapped.ILLUMINA.bwa.ASW.exome.20120522.bam.bai",
name: "NA12878n"
}
]
}

}

igv.createBrowser(document.getElementById('igvDiv'), config)
.then(browser => {
const browser = await igv.createBrowser(document.getElementById('igvDiv'), config)

})


</script>
Expand Down
2 changes: 1 addition & 1 deletion dev/twobit/twobithg38.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"cytobandURL": "http://hgdownload.cse.ucsc.edu/goldenPath/hg38/database/cytoBandIdeo.txt.gz",
"aliasURL": "https://s3.amazonaws.com/igv.broadinstitute.org/annotations/hg38/hg38_alias.tab",
"format": "2bit",
"twobitURL": "https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.2bit",
"twoBitURL": "https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.2bit",
"aliasBbURL": "https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.chromAlias.bb",
"tracks": [
{
Expand Down
3 changes: 2 additions & 1 deletion dev/ucsc/hub.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


const hubOptions = {
url: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/hub.txt",
url: "https://hgdownload.soe.ucsc.edu/hubs/GCA/018/471/515/GCA_018471515.1/hub.txt",
includeTracks: "all"
}

Expand All @@ -45,6 +45,7 @@

const igvConfig = {
locus: hub.getDefaultPosition(),
showChromosomeWidget: false,
reference: ref
}

Expand Down
13 changes: 4 additions & 9 deletions dev/ucsc/slowHub.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,16 @@


const hub = await Hub.loadHub(hubOptions)
const ref = hub.getGenomeConfig()

const igvConfig = {
showChromosomeWidget: false,
locus: hub.getDefaultPosition(),
reference: ref
reference: hub.getGenomeConfig()
}

const browser = await igv.createBrowser(document.getElementById('igvDiv'), igvConfig)
//igvConfig.reference.chromAliasBbURL = undefined // TODO <- chromAliasBB is slowish

const selector = document.getElementById("select")
selector.addEventListener("change", () => document.getElementById("hub-input").value = selector.value)
document.getElementById("load-genome").addEventListener("click", () =>
browser.loadGenome({url: document.getElementById("hub-input").value}))
document.getElementById("load-session").addEventListener("click", () =>
browser.loadSession({url: document.getElementById("hub-input").value}))
const browser = await igv.createBrowser(document.getElementById('igvDiv'), igvConfig)


</script>
Expand Down
22 changes: 11 additions & 11 deletions dev/wig/bigWigs.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
"Bar": 999.999
}
},
{
"url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
"graphType": "points",
"pointSize": 3,
"name": "Encode bigwig points"
},
{
"url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
"graphType": "line",
"name": "Encode bigwig line"
},
// {
// "url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
// "graphType": "points",
// "pointSize": 3,
// "name": "Encode bigwig points"
// },
// {
// "url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
// "graphType": "line",
// "name": "Encode bigwig line"
// },
{
"url": "https://s3-us-west-2.amazonaws.com/ilmn.igv-test/test2.bigWig",
color: 'rgb(0,0,255)',
Expand Down
Loading

0 comments on commit 7c4c190

Please sign in to comment.