-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDNAbarcode.html
More file actions
49 lines (46 loc) · 2.02 KB
/
DNAbarcode.html
File metadata and controls
49 lines (46 loc) · 2.02 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
<!DOCTYPE html>
<body>
<form id="name">
Sequence Name: <input type="text" name="name" value=""><br>
</form>
<form id="initial_index">
Initial Index: <input type="text" name="initial_index" value=""><br>
</form>
<form id="prefix">
Prefix before barcode: <input type="text" name="prefix" value=""><br>
</form>
<form id="suffix">
Suffix after barcode: <input type="text" name="suffix" value=""><br>
</form>
<form id="barcodes">
List of barcodes: <input type="text" name="barcodes" value=""><br>
</form>
<button onclick="showSequences()">Show barcoded sequences</button>
<table id="seqTable" style="border-collapse:separate; border-spacing:20;">
</table>
<script type="text/javascript">
function showSequences(){
var name=document.getElementById("name").elements[0].value;
var initialind=document.getElementById("initial_index").elements[0].value;
var pre=document.getElementById("prefix").elements[0].value;
var suf=document.getElementById("suffix").elements[0].value;
var barcodes=document.getElementById("barcodes").elements[0].value.split(/[,;\s+]/);
var sequenceTable = document.getElementById("seqTable");
for (i in barcodes){
//sequenceTable.appendChild(document.createElement('tr')).appendChild(document.createTextNode(name+i+' '+pre+barcodes[i]+suf));
var row = document.createElement('tr')
var num = parseInt(i)+parseInt(initialind);
row.appendChild(document.createElement('td')).appendChild(document.createTextNode(name+num));
//row.appendChild(document.createElement('td')).appendChild(document.createTextNode('\u00a0 \u00a0 \u00a0 \u00a0 \u00a0'+barcodes[i]+suf));
//var preFT=document.createElement('pre').appendChild(document.createTextNode('\u0009'+barcodes[i]+suf));
//row.appendChild(document.createElement('td')).appendChild(document.createTextNode('\u0009'+barcodes[i]+suf));
var td=document.createElement('td');
td.innerHTML="<pre>	"+pre+barcodes[i]+suf+"</pre>";
row.appendChild(td)
//	  
//U+000A
sequenceTable.appendChild(row);
}
}
</script>
</body>