-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKappa.bas
70 lines (51 loc) · 1.53 KB
/
Kappa.bas
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
Attribute VB_Name = "Kappa"
Public total_val_x As Variant
Public total_val_y As Variant
Public Last_x_lim_min As Variant
Public Last_x_lim_max As Variant
Public Last_y_lim_min As Variant
Public Last_y_lim_max As Variant
Public Sir_IC_regression As String
Public Sir_CG_regression As String
Function IC(ByVal sequence As String) As Variant
Dim count, i, u, total As Long
Dim S1, s2 As String
Dim max As Integer
S1 = sequence
max = Len(S1) - 1
For u = 1 To max
s2 = Mid(S1, u + 1)
For i = 1 To Len(s2)
If Mid(S1, i, 1) = Mid(s2, i, 1) Then
count = count + 1
End If
Next i
total = total + (count / Len(s2) * 100)
count = 0
Next u
IC = Round((total / max), 2)
End Function
Function strand2(ByVal strand1 As String) As String
For j = 1 To Len(strand1)
nucleotida = LCase(Mid(strand1, j, 1))
If nucleotida = "a" Then
nucleotida = "t"
GoTo 1
End If
If nucleotida = "t" Then
nucleotida = "a"
GoTo 1
End If
If nucleotida = "c" Then
nucleotida = "g"
GoTo 1
End If
If nucleotida = "g" Then
nucleotida = "c"
GoTo 1
End If
1:
fereastra_continut = fereastra_continut & nucleotida
Next j
strand2 = UCase(fereastra_continut)
End Function