Skip to content

Commit fe33399

Browse files
authored
Hubs 2 (#1720)
Optimizations and bug fixes to support track hubs
1 parent 08e62c7 commit fe33399

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4774
-867
lines changed

dev/annotation/annotation.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ <h1>Annotation tracks</h1>
3737
"supportsWholeGenome": true,
3838
"name": "Bed - No Index"
3939
},
40+
{
41+
"type": "annotation",
42+
"format": "bigBed",
43+
"url": "../../genes.bb",
44+
"indexed": false,
45+
"supportsWholeGenome": true,
46+
"name": "Bed - No Index"
47+
},
4048
{
4149
"type": "annotation",
4250
"format": "bed",

dev/twobit/twobit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
reference: {
1919
id: "GCF_016699485.2",
2020
format: "2bit",
21-
twobitURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.2bit",
21+
twoBitURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.2bit",
2222
aliasBbURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.chromAlias.bb",
2323
nameSet: "ucsc",
2424
wholeGenomeView: false

dev/twobit/twobit_aliasBB.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>twobit</title>
5+
</head>
6+
7+
<body>
8+
9+
<div id="igvDiv" style="padding-top: 50px;padding-bottom: 20px; height: auto"></div>
10+
11+
<script type="module">
12+
13+
import igv from "../../js/index.js"
14+
15+
const config =
16+
{
17+
showChromosomeWidget: false,
18+
locus: "NC_007194.1:1639659-1649659",
19+
reference: {
20+
id: "GCF_000002655.1",
21+
format: "2bit",
22+
twoBitURL: "../../test/data/twobit/GCF_000002655.1.2bit",
23+
chromAliasBbURL: "../../test/data/twobit/GCF_000002655.1.chromAlias.bb",
24+
wholeGenomeView: false,
25+
nameSet: 'ucsc'
26+
},
27+
tracks: [
28+
{
29+
name: "GC Percent",
30+
autoScale: false,
31+
height: 36,
32+
color: "rgb(0,0,0)",
33+
altColor: "rgb(128,128,128)",
34+
min: 30,
35+
max: 70,
36+
format: "bigWig",
37+
url: "https://hgdownload.soe.ucsc.edu/hubs/GCF/000/002/655/GCF_000002655.1/bbi/GCF_000002655.1_ASM265v1.gc5Base.bw"
38+
}
39+
]
40+
}
41+
42+
igv.createBrowser(document.getElementById('igvDiv'), config)
43+
.then(browser => {
44+
45+
})
46+
47+
48+
</script>
49+
50+
</body>
51+
52+
</html>

dev/twobit/twobit_basic.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>twobit</title>
5+
</head>
6+
7+
<body>
8+
9+
<div id="igvDiv" style="padding-top: 50px;padding-bottom: 20px; height: auto"></div>
10+
11+
<script type="module">
12+
13+
import igv from "../../js/index.js"
14+
15+
const config =
16+
{
17+
showChromosomeWidget: false,
18+
locus: "NC_007194.1:1639659-1649659",
19+
reference: {
20+
id: "GCF_000002655.1",
21+
format: "2bit",
22+
twoBitURL: "../../test/data/twobit/GCF_000002655.1.2bit",
23+
wholeGenomeView: false
24+
},
25+
// tracks: [
26+
// {
27+
// name: "GC Percent",
28+
// autoScale: false,
29+
// height: 36,
30+
// color: "rgb(0,0,0)",
31+
// altColor: "rgb(128,128,128)",
32+
// min: 30,
33+
// max: 70,
34+
// format: "bigWig",
35+
// url: "https://hgdownload.soe.ucsc.edu/hubs/GCF/000/002/655/GCF_000002655.1/bbi/GCF_000002655.1_ASM265v1.gc5Base.bw"
36+
// }
37+
//]
38+
}
39+
40+
igv.createBrowser(document.getElementById('igvDiv'), config)
41+
.then(browser => {
42+
43+
})
44+
45+
46+
</script>
47+
48+
</body>
49+
50+
</html>

dev/twobit/twobit_chromSizes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
reference: {
1919
id: "GCF_016699485.2",
2020
format: "2bit",
21-
twobitURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.2bit",
21+
twoBitURL: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.2bit",
2222
chromeSizes: "https://hgdownload.gi.ucsc.edu/hubs//GCA/011/100/615/GCA_011100615.1/GCA_011100615.1.chrom.sizes.txt",
2323
wholeGenomeView: false
2424
}

dev/twobit/twobit_t2t.html

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,60 +14,69 @@
1414

1515
const config =
1616
{
17-
locus: "myc",
17+
//locus: "myc",
18+
locus:"CP068269.2:35,726,976-35,734,192",
19+
showChromosomeWidget: false,
1820
reference: {
19-
"id": "chm13v2.0",
20-
"name": "Human (T2T CHM13-v2.0)",
21-
"fastaURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0.fa",
22-
"indexURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0.fa.fai",
23-
"cytobandURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/CHM13_v2.0.cytoBandMapped.bed",
24-
"aliasURL": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/GCA_009914755.4.chromAlias.txt",
25-
twobitURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/GCA_009914755.4.2bit",
21+
wholeGenomeView: false,
22+
id: "chm13v2.0",
23+
name: "Human (T2T CHM13-v2.0)",
24+
twoBitURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/GCA_009914755.4.2bit",
2625
cytobandBbURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.cytoBandMapped/cytoBandMapped.bb",
27-
aliasBbURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/GCA_009914755.4.chromAlias.bb",
26+
chromAliasBbURL: "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/GCA_009914755.4.chromAlias.bb",
2827
nameSet: "ucsc",
29-
"tracks": [
28+
tracks: [
29+
// {
30+
// "id": "catLiftOffGenesV1",
31+
// "name": "CAT/Liftoff Genes",
32+
// "format": "bigbed",
33+
// "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>",
34+
// "url": "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1/catLiftOffGenesV1.bb",
35+
// "displayMode": "EXPANDED",
36+
// "height": 200,
37+
// "visibilityWindow": -1,
38+
// "supportsWholeGenome": false
39+
// },
40+
//
41+
// // Include a hg38 bigwig track -- test chromosome aliasing
42+
// {
43+
// "url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
44+
// "name": "Encode bigwig",
45+
// },
46+
47+
// plain wig track
48+
{
49+
url: "../../test/data/hubs/ENCFF754TJH.wig",
50+
name: "Encode wig"
51+
},
52+
53+
// plain bed track
3054
{
31-
"id": "catLiftOffGenesV1",
32-
"name": "CAT/Liftoff Genes",
33-
"format": "bigbed",
34-
"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>",
35-
"url": "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.catLiftOffGenesV1/catLiftOffGenesV1.bb",
36-
"displayMode": "EXPANDED",
37-
"height": 200,
38-
"visibilityWindow": -1,
39-
"supportsWholeGenome": false,
40-
"order": 1000000
55+
url: "../../test/data/hubs/catLiftOff.bed",
56+
name: "plain bed"
4157
},
58+
59+
// indexed bed track
4260
{
43-
"id": "augustus",
44-
"name": "Augustus",
45-
"format": "bigbed",
46-
"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>",
47-
"url": "https://hgdownload.soe.ucsc.edu/hubs/GCA/009/914/755/GCA_009914755.4/bbi/GCA_009914755.4_T2T-CHM13v2.0.augustus.bb",
48-
"displayMode": "EXPANDED",
49-
"color": "180,0,0",
50-
"height": 200,
51-
"visibilityWindow": -1,
52-
"supportsWholeGenome": false,
53-
"order": 1000001
61+
url: "../../test/data/hubs/catLiftOff.bed.gz",
62+
indexUrl: "../../test/data/hubs/catLiftOff.bed.gz.tbi",
63+
name: "indexed bed"
5464
},
65+
66+
//bam
5567
{
56-
"name": "Genes",
57-
"format": "bed",
58-
"url": "https://s3.amazonaws.com/igv.org.genomes/chm13v2.0/chm13v2.0_geneLocations.short.bed.gz",
59-
"hidden" : true,
60-
"searchable": true
68+
type: "alignment",
69+
url: "https://1000genomes.s3.amazonaws.com/phase3/data/NA19625/exome_alignment/NA19625.mapped.ILLUMINA.bwa.ASW.exome.20120522.bam",
70+
indexURL: "https://1000genomes.s3.amazonaws.com/phase3/data/NA19625/exome_alignment/NA19625.mapped.ILLUMINA.bwa.ASW.exome.20120522.bam.bai",
71+
name: "NA12878n"
6172
}
6273
]
6374
}
6475

6576
}
6677

67-
igv.createBrowser(document.getElementById('igvDiv'), config)
68-
.then(browser => {
78+
const browser = await igv.createBrowser(document.getElementById('igvDiv'), config)
6979

70-
})
7180

7281

7382
</script>

dev/twobit/twobithg38.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"cytobandURL": "http://hgdownload.cse.ucsc.edu/goldenPath/hg38/database/cytoBandIdeo.txt.gz",
2525
"aliasURL": "https://s3.amazonaws.com/igv.broadinstitute.org/annotations/hg38/hg38_alias.tab",
2626
"format": "2bit",
27-
"twobitURL": "https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.2bit",
27+
"twoBitURL": "https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.2bit",
2828
"aliasBbURL": "https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.chromAlias.bb",
2929
"tracks": [
3030
{

dev/ucsc/hub.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636

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

@@ -45,6 +45,7 @@
4545

4646
const igvConfig = {
4747
locus: hub.getDefaultPosition(),
48+
showChromosomeWidget: false,
4849
reference: ref
4950
}
5051

dev/ucsc/slowHub.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,16 @@
2222

2323

2424
const hub = await Hub.loadHub(hubOptions)
25-
const ref = hub.getGenomeConfig()
2625

2726
const igvConfig = {
27+
showChromosomeWidget: false,
2828
locus: hub.getDefaultPosition(),
29-
reference: ref
29+
reference: hub.getGenomeConfig()
3030
}
3131

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

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

4136

4237
</script>

dev/wig/bigWigs.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@
2929
"Bar": 999.999
3030
}
3131
},
32-
{
33-
"url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
34-
"graphType": "points",
35-
"pointSize": 3,
36-
"name": "Encode bigwig points"
37-
},
38-
{
39-
"url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
40-
"graphType": "line",
41-
"name": "Encode bigwig line"
42-
},
32+
// {
33+
// "url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
34+
// "graphType": "points",
35+
// "pointSize": 3,
36+
// "name": "Encode bigwig points"
37+
// },
38+
// {
39+
// "url": "https://www.encodeproject.org/files/ENCFF754TJH/@@download/ENCFF754TJH.bigWig",
40+
// "graphType": "line",
41+
// "name": "Encode bigwig line"
42+
// },
4343
{
4444
"url": "https://s3-us-west-2.amazonaws.com/ilmn.igv-test/test2.bigWig",
4545
color: 'rgb(0,0,255)',

0 commit comments

Comments
 (0)