-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Additional algorithm 71 (out of context).html
51 lines (40 loc) · 3.1 KB
/
Additional algorithm 71 (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
<!-- ############################################################################################################################## -->
<!-- # 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 h = 'ACGT';
var s0 = h+'ATCGATTCGATATCATACACGTAT';
var s1 = h+'AATCCTATCTTACTATTCTACTCAGTCCC';
var q
var p = [] = DPD(s0, '(+)');
var b = [] = DPD(s1, '(-)');
document.write('Model (+):<br>'+SMC(p)+'<hr>');
document.write('Model (-):<br>'+SMC(b)+'<hr>');
p[0][0] = '(L)';
for(var i=0; i<p.length; i++){
for(var j=0; j<p[i].length; j++){
if (i>0 && j>0) {
if(p[i][j]==0){p[i][j]=0.000000000000000001;}
if(b[i][j]==0){b[i][j]=0.000000000000000001;}
q = p[i][j]/b[i][j];
p[i][j] = Log(2,q).toFixed(2);
}
}
}
document.write('log likelihood:<br>'+SMC(p));
</script>