forked from benjiec/giraffe-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyze.html
73 lines (61 loc) · 2.03 KB
/
analyze.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
<!DOCTYPE HTML>
<html>
<head>
<link href="vendor/jquery-ui-1.9.2.custom/css/smoothness/jquery-ui-1.9.2.custom.min.css"
rel="stylesheet" type="text/css" />
<link href="css/giraffe-js.css" rel="stylesheet" type="text/css"/>
<link href="css/demo.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<div id="title">Giraffe: DNA Sequence Analysis</div>
<p>
Feature Detection, Sequence Maps, Digests, and more ...
</p>
</div>
<h2>Analyze Sequence</h2>
<div id="post-form">
<input type="hidden" name="db" value="default" />
<textarea name="sequence" class="sequence" placeholder="Paste your sequence here"></textarea>
<p class="button"><a href="#">Try It</a></p>
</div>
<div id="giraffe-analyze"></div>
<script src="vendor/raphael-min.js"></script>
<script src="vendor/jquery-1.9.0.min.js"></script>
<script src="vendor/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="js/scale.raphael.js"></script>
<script src="js/bio.js"></script>
<script src="js/draw.js"></script>
<script src="js/analyze.js"></script>
<script>
// change this to your URL
var GIRAFFE_URL = '/giraffe/analyze/';
jQuery(document).ready(function($){
$('#post-form .button a').click(function(evt){
evt.preventDefault();
var analyzer_dom_id = 'giraffe-analyze';
$('#'+analyzer_dom_id).empty();
var seq = $('#post-form textarea[name=sequence]').val();
var db = $('#post-form input[name=db]').val();
if (seq !== undefined && seq.length > 0) {
$.post(GIRAFFE_URL,
{ "sequence": seq, "db": db },
function(data) {
var gd = GiraffeDraw2();
gd.read(data);
$('#'+analyzer_dom_id).empty();
analyzer = GiraffeAnalyze2($, gd, {
'dom_id': analyzer_dom_id,
'name': 'Sequence',
'exclude_layers': 'Restriction Enzymes',
});
},
'json');
return;
}
alert('Please enter a sequence');
});
});
</script>
</body>
</html>