-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
119 lines (111 loc) · 4.83 KB
/
test.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
<html>
<head>
<script src="dist/js/mascp-jstools.js"></script>
</head>
<body>
<div style="padding: 30px;">
<gator-gene id="blaz" auto="true" style="height: 300px; overflow: auto;" interactive="true" zoom="auto" geneid="1605" accession="q14118" exonmargin="300" caching="true">
<gator-track><!-- default to using the accession on the parent otherwise use an id also set genomic attribute-->
<gator-gatorurl href="http://glycodomain-data.glycocode.com/data/latest/pnas-omannose/" rendererUrl="/omannose.renderer" name="Oman" caching="true"></gator-gatorurl>
<gator-domains href="http://glycodomain-data.glycocode.com/data/latest/fulldomains/"></gator-domains>
</gator-track>
<gator-track name="mutations" genomic="true">
<gator-localdata id="foo" caching="true" ></gator-localdata>
</gator-track>
<gator-track name="q14118">
<gator-editabledata id="foobar"></gator-editabledata>
</gator-track>
</gator-gene>
</div>
<script>
window.fakeblah = function() {
return function renderData(seq,datas) {
return [{ 'aa' : 49548000, 'type' : 'marker', 'width' : 1 ,'options': {
'offset' : 1,
'height' : 24,
'events' : [{ 'type' : 'mousemove,mouseup,click,touchstart', 'data' : {'blah' : 'blaz'} }]
} },
{ 'aa' : 49568800, 'type' : 'marker', 'width' : 1 ,'options': {
'offset' : 1,
'height' : 24,
'content' : 'Foo',
'events' : [{ 'type' : 'mousemove,mouseup,click,touchstart', 'data' : {'blah' : 'blaz'} }]
} },
{ 'aa' : 49548000, 'type' : 'box', 'width' : 20800, 'options' : { 'offset' : 1, 'height' : 6, 'fill' : '#0f0'}},
{ 'aa' : 49548000, 'type' : 'box', 'width' : 20800, 'options' : { 'offset' : 6, 'height' : 6, 'fill' : '#ff0'}},
{ 'aa' : 49548000, 'type' : 'text', 'width' : 20800, 'options' : { 'offset' : 3 ,'height' : 8, 'txt' : 'FoobarzFoobarz FoobarzFoobarz', 'fill' : '#000'}} ];
};
}
window.doProteome = function() {
var up = 'q14118';
var proxy_reader = {
agi: up,
gotResult: function() {
MASCP.registerLayer(up,{'fullname' : "foo"});
the_rend.addAxisScale('foo',function(aa) { return aa * (window.scaleval || 1); });
// the_rend.getAA(100).addToLayer(up,1,{'fill' : '#000'});
var an_aa = the_rend.getAA(101);
console.log(an_aa);
an_aa.addToLayer(up,{'fill' : '#f00', 'height': 12 });
the_rend.trackOrder.push('q14118');
the_rend.showLayer('q14118');
the_rend.refresh();
// the_rend.getAA(200).addToLayer(up,1,{'fill' : '#000'});
}
};
MASCP.Service.prototype.registerSequenceRenderer.call(proxy_reader,the_rend);
proxy_reader.gotResult();
};
window.doGenome = function() {
var reader = new MASCP.GenomeReader();
reader.registerSequenceRenderer(the_rend);
//p12830
// var up = 'p02768';
var up = 'q14118';
reader.exon_margin = 300;
// reader.geneid = 2590;
reader.retrieve(up,function(err) {
the_rend.zoom = 0.01;
var proxy_reader = {
agi: up,
gotResult: function() {
// the_rend.getAA(100).addToLayer(up,1,{'fill' : '#000'});
MASCP.registerLayer(up,{'fullname' : "prot"});
var an_aa = the_rend.getAA(300);
an_aa.addToLayer(up,{'fill' : '#f00', 'height': 12 });
the_rend.trackOrder.push(up);
the_rend.showLayer(up);
// the_rend.getAA(200).addToLayer(up,1,{'fill' : '#000'});
}
};
MASCP.Service.prototype.registerSequenceRenderer.call(proxy_reader,the_rend);
proxy_reader.gotResult();
});
};
window.blah = function() {
document.getElementById('blaz').go();
setTimeout(function() {
document.getElementById('foo').data = {'q14118' : {'foo' : 'bar'}};
document.getElementById('foo').renderer = window.fakeblah();
document.getElementById('foobar').data = [{"id" : 1, "acc" : "q14118", "type": "symbol" , "color" : "#0f0", "index" : 200 }];
document.getElementById('foo').parentNode.go();
document.getElementById('foobar').parentNode.go();
document.getElementById('blaz').renderer.selecting = true;
},300);
// var renderer = new MASCP.CondensedSequenceRenderer(document.getElementById('container'));
// MASCP.Service.BeginCaching();
// (new MASCP.UniprotReader()).retrieve('q14118',function() {
// renderer.setSequence(this.result.getSequence());
// });
// renderer.bind('sequenceChange',function() {
// renderer.hideAxis();
// // window.doProteome();
// })
// renderer.refresh();
// renderer.grow_container = true;
// window.the_rend = renderer;
// window.doGenome();
};
</script>
</body>
</html>