-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
195 lines (157 loc) · 4.47 KB
/
Copy pathindex.html
File metadata and controls
195 lines (157 loc) · 4.47 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<head>
<title>Elizabeth's Reverse Completementron</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
var app = {
convert_primer: function($input) {
var primer = $input.toUpperCase();
// reverse string by first turning into array
var reverse_primer = primer.split("").reverse();
var new_primer = [];
// read through array and replace each primer with its complement
for (var i=0;i<reverse_primer.length;i++) {
if (reverse_primer[i] == "A") {
new_primer.push("T");
}else if(reverse_primer[i] == "T") {
new_primer.push("A");
}else if(reverse_primer[i] == "G") {
new_primer.push("C");
}else if(reverse_primer[i] == "C") {
new_primer.push("G");
}
}
// change the status of the output field
$("#output").attr('value',new_primer.join(""));
if($input.match(/[^ATCGatcg]/)){
$("#output").addClass('fail');
$("#output").removeClass('selected');
} else if ($input.match(/[ATCGatcg]/)) {
$("#output").addClass('selected');
$("#output").removeClass('fail');
} else {
$("#output").removeClass('fail');
$("#output").removeClass('selected');
}
// fun things
if ($input == "smiley" || $input == ":-)") {
$("#smiley").html("<img src=\"http://heksie.com/SmileyVault/gifs/smilies0262.gif\" />");
$("#output").removeClass('fail');
$("#output").removeClass('selected');
} else if ($input == "dna") {
$("body").css('background-image', 'url(http://3.bp.blogspot.com/_zY7hIwMmNiA/TU9tpDah4RI/AAAAAAAABRw/mUOhIXA6Z8Q/s1600/dnapixels.PNG)');
$("#container").css('backgroundColor', '#fff');
} else {
$("#smiley").html(null);
}
}
}
//listen on the primer input field for changes
$('#primer').live('keyup', function() {
var $f = this;
app.convert_primer($(this).attr('value'));
});
});
</script>
<style type="text/css">
#container {
padding: 20px;
}
.selected {
background-color:lightyellow;
}
.fail {
background-color:lightpink;
}
.field {
font-size:24px;
width:300px;
}
.left {
margin-top: 10px;
padding: 5px 0px 10px 0;
width: 300px;
float: left;
}
.right {
margin-top: 10px;
padding: 5px 0 10px 0px;
width: 300px;
float: left;
}
.center {
float:left;
width:1px;
padding-left: 20px;
border-right: 1px dashed #aaa;
margin-top: 10px;
margin-right: 20px;
height: 100px;
}
.clear {
clear: both;
}
#smiley {
padding-left: 5px;
}
h1 {
font-family: Helvetica, Arial, sans-serif;
margin: 5px 0;
}
h2 {
font-family: Helvetica, Arial, sans-serif;
margin: 5px 0;
color: #666;
}
body {
width: 700px;
margin: 50px auto;
}
p {
border-top: 1px solid #666;
margin: 5px 0;
padding: 10px 0 0 0;
font-family: Helvetica, Arial, sans-serif;
font-size: 0.9em;
color: #666;
}
#footer {
margin-top: 10px;
font-family: Helvetica, Arial, sans-serif;
font-size: 0.8em;
color: #666;
}
</style>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22421728-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<!-- Thanks for checking out the complementron! It is quite simple. Let me know if you like it at cameron at api dot gy -->
<div id="container">
<h1>Elizabeth's Reverse Complementron<span id="smiley"></span></h1>
<p>Hello! Welcome to Elizabeth's Reverse Complementron! Just type or paste in your sequence on the left and Elizabeth's Reverse Complementron will take care of the rest. Voila!</p>
<div class="left">
<h2>Sequence</h2>
<input id="primer" name="primer" value="" class="field" />
</div>
<div class="center">
</div>
<div class="right">
<h2>Reverse Complement</h2>
<input id="output" value="" class="field" />
</div>
<div class="clear"></div>
<div id="footer">Made for Elizabeth</div>
</div>
</body>
</html>