-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
65 lines (55 loc) · 1.67 KB
/
index.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
<style>
body {
margin: 0;
}
</style>
<div id="container"></div>
<script src="../../dist/valis-hpgv.js"></script>
<script>
let config = {
allowNewPanels: false,
clampToTracks: true,
removableTracks: false,
panels: [
{
location: { contig: 'chr1', x0: 0, x1: 249e6 }
}
],
tracks: [
{
name: 'DNA',
type: 'sequence',
path: 'https://s3-us-west-1.amazonaws.com/valis-file-storage/genome-data/GRCh38.vdna-dir',
},
{
name: 'Genes',
type: 'annotation',
compact: true,
path: 'https://s3-us-west-1.amazonaws.com/valis-file-storage/genome-data/GRCh38.92.vgenes-dir',
},
{
name: 'Cerebellum, DNase',
type: 'signal',
path: "https://www.encodeproject.org/files/ENCFF833POA/@@download/ENCFF833POA.bigWig",
heightPx: 150,
},
],
};
// get state from URL
if (window.location.hash) {
config = JSON.parse(decodeURIComponent(window.location.hash.substr(1)));
}
let visualizer = new GenomeVisualizer(config);
let container = document.getElementById('container');
window.addEventListener('resize', update);
function update() {
visualizer.render({
width: window.innerWidth,
height: window.innerHeight
}, container);
}
function saveStateInURL() {
window.history.replaceState(null, null, '#' + JSON.stringify(visualizer.getConfiguration()));
}
update();
</script>