-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Additional algorithm 14 (out of context).html
69 lines (52 loc) · 3.36 KB
/
Additional algorithm 14 (out of context).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
<!-- ############################################################################################################################## -->
<!-- # 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>
var AlignmentA = "";
var AlignmentM = "";
var AlignmentB = "";
var i = n_0;
var j = n_1;
while (i>=2 || j>=2) {
var Ai = m[i][0];
var Bj = m[0][j];
if(i>=2 && j>=2 && m[i][j]==m[i-1][j-1] + f(Ai, Bj)) {
AlignmentA = Ai + AlignmentA;
AlignmentB = Bj + AlignmentB;
if(Ai==Bj){
AlignmentM = '|' + AlignmentM;
} else {
AlignmentM = ' ' + AlignmentM;
}
i = i - 1;
j = j - 1;
} else {
if(i>=2 && m[i][j]==m[i-1][j] + gap) {
AlignmentA = Ai + AlignmentA;
AlignmentB = '-' + AlignmentB;
AlignmentM = ' ' + AlignmentM;
i = i - 1;
} else {
AlignmentA = '-' + AlignmentA;
AlignmentB = Bj + AlignmentB;
AlignmentM = ' ' + AlignmentM;
j = j - 1;
}
}
}
</script>