forked from dasmoth/dalliance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hubstub.html
132 lines (112 loc) · 5.25 KB
/
hubstub.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html>
<head>
<style>
</style>
<title>Dalliance :: Connect to Assembly Hub</title>
<script language="javascript" src="node_modules/es6-promise/dist/promise-0.1.2.js"></script>
<script language="javascript" src="js/bam.js"></script>
<script language="javascript" src="js/bigwig.js"></script>
<script language="javascript" src="js/das.js"></script>
<script language="javascript" src="js/spans.js"></script>
<script language="javascript" src="js/utils.js"></script>
<script language="javascript" src="js/cbrowser.js"></script>
<script language="javascript" src="js/feature-popup.js"></script>
<script language="javascript" src="js/tier.js"></script>
<script language="javascript" src="js/features.js"></script>
<script language="javascript" src="js/color.js"></script>
<script language="javascript" src="js/feature-draw.js"></script>
<script language="javascript" src="js/sequence-draw.js"></script>
<script language="javascript" src="js/domui.js"></script>
<script language="javascript" src="js/track-adder.js"></script>
<script language="javascript" src="js/chainset.js"></script>
<script language="javascript" src="js/version.js"></script>
<script language="javascript" src="js/sha1.js"></script>
<script language="javascript" src="js/sample.js"></script>
<script language="javascript" src="js/kspace.js"></script>
<script language="javascript" src="js/bin.js"></script>
<script language="javascript" src="js/twoBit.js"></script>
<script language="javascript" src="js/thub.js"></script>
<script language="javascript" src="js/svg-export.js"></script>
<script language="javascript" src="node_modules/jszlib/js/inflate.js"></script>
<script language="javascript" src="js/browser-ui.js"></script>
<script language="javascript" src="js/glyphs.js"></script>
<script language="javascript" src="js/session.js"></script>
<script language="javascript" src="js/jbjson.js"></script>
<script language="javascript" src="js/sourceadapters.js"></script>
<script language="javascript" src="polyfills/html5slider.js"></script>
<script language="javascript" src="js/ensembljson.js"></script>
<script language="javascript" src="js/overlay.js"></script>
<script language="javascript" src="js/tier-actions.js"></script>
<script language="javascript" src="js/tier-edit.js"></script>
<script language="javascript" src="js/search.js"></script>
<script language="javascript" src="js/tabix.js"></script>
<script language="javascript" src="js/tabix-source.js"></script>
<script language="javascript" src="js/bigtab.js"></script>
<script language="javascript" src="js/memstore.js"></script>
<script language="javascript" src="js/vcf.js"></script>
<script language="javascript" src="js/bedwig.js"></script>
<script language="javascript" src="js/probe.js"></script>
<script language="javascript" src="js/trix.js"></script>
<script language="javascript" src="js/export-ui.js"></script>
<script language="javascript" src="js/export-config.js"></script>
<script language="javascript" src="js/export-image.js"></script>
<script language="javascript" src="js/lh3utils.js"></script>
<script language="javascript" src="js/svg-utils.js"></script>
<script language="javascript" src="js/numformats.js"></script>
<script language="javascript" src="js/cigar.js"></script>
<script langugage="javascript">
function init() {
var container = document.getElementById('svgHolder'); // Has the nice property that
// it gets nuked when Dalliance starts up....
document.getElementById('submit_button').addEventListener('click', function(ev) {
connectTrackHub(document.getElementById('huburl').value, function(hub, err) {
if (hub) {
container.appendChild(makeElement('p', 'Where do you want to go today?'));
var ge = [];
for (var g in hub.genomes) {
var gg = hub.genomes[g];
var gl = makeElement('li', makeLabelForGenome(gg));
ge.push(gl);
}
container.appendChild(makeElement('ul', ge));
} else {
console.log(err);
}
});
}, false);
}
var AHUB_REGION_REGEXP = /([^:]+):(\d+)-(\d+)/;
function makeLabelForGenome(genome) {
var a = makeElement('a', genome.description);
a.addEventListener('click', function(ev) {
var reg = AHUB_REGION_REGEXP.exec(genome.defaultPos);
var b = new Browser({
chr: reg[1],
viewStart: reg[2]|0,
viewEnd: reg[3]|0,
noPersist: true,
coordSystem: {speciesName: genome.organism,
taxon: genome.orderKey|0,
auth: '', version: '',
ucscName: genome.genome},
sources: [{name: 'Genome',
twoBitURI: relativeURL(genome.absURL, genome.twoBitPath),
tier_type: 'sequence'}],
hubs: [document.getElementById('huburl').value]
});
b.realInit();
__dalliance = b;
}, false);
return a;
}
</script>
</head>
<body onload="init();">
<div id='svgHolder'>
<h1>Assembly hub test</h1>
Hub URL:<input id='huburl' type='text' value='http://genome-test.cse.ucsc.edu/~hiram/hubs/Plants/hub.txt'>
<input type='submit' id='submit_button'>
</div>
</body>
</html>