-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAdditional algorithm 91.html
More file actions
68 lines (58 loc) · 3.53 KB
/
Additional algorithm 91.html
File metadata and controls
68 lines (58 loc) · 3.53 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
<!-- ############################################################################################################################## -->
<!-- # John Wiley & Sons, Inc. # -->
<!-- # # -->
<!-- # Book: Algorithms in Bioinformatics: Theory and Implementation # -->
<!-- # Author: Dr. Paul A. Gagniuc # -->
<!-- # # -->
<!-- # Institution: # -->
<!-- # University Politehnica of Bucharest # -->
<!-- # Faculty of Engineering in Foreign Languages # -->
<!-- # Department of Engineering in Foreign Languages # -->
<!-- # # -->
<!-- # Area: European Union # -->
<!-- # Date: 04/01/2021 # -->
<!-- # # -->
<!-- # Cite this work as: # -->
<!-- # Paul A. Gagniuc. Algorithms in Bioinformatics: Theory and Implementation. John Wiley & Sons, 2021, ISBN: 9781119697961. # -->
<!-- # # -->
<!-- ############################################################################################################################## -->
<script>
c = "|G\t-0.92\t-0.22\t0.69\t1.39\t-40.06\t0.69\t-0.92\t1.16\t-0.92" +
"|A\t0.18\t0.47\t-0.22\t-40.06\t-40.06\t0.69\t1.03\t-0.92\t-40.06" +
"|T\t-0.22\t0.18\t-0.22\t-40.06\t1.39\t-40.06\t-40.06\t-0.92\t1.03" +
"|C\t0.47\t-0.92\t-0.92\t-40.06\t-40.06\t-40.06\t-0.22\t-40.06\t-0.22"
var tmp;
tmp = load(c);
document.write(SMC(tmp[0])+ '<br>');
//LOAD MATRICES FROM STRINGS
function load(t){
var n = [];
var m = [];
var L = [];
m = t.split('|');
var max = 0;
for(var i=1; i<m.length; i++) {
L[i-1]=[];
n = m[i].split('\t');
for(var j=0; j<n.length; j++){
L[i-1][j]=n[j]; //Number(n[j]);
if(j>0){L[i-1][j]+='|'+L[i-1][0];}
if(max<=L[i-1][j]){max=L[i-1][j];}
}
}
return [L, max];
}
// SHOW MATRIX CONTENT
function SMC(m) {
var r = "<table border=1>";
for(var i=0; i<m.length; i++) {
r += "<tr>";
for(var j=0; j<m[i].length; j++){
r += "<td>"+m[i][j]+"</td>";
}
r += "</tr>";
}
r += "</table>";
return r;
}
</script>