| 1 |
function GUIBuildCodonFrequencies (EFV) |
| 2 |
{ |
| 3 |
PIStop = 1.0; |
| 4 |
result = {ModelMatrixDimension,1}; |
| 5 |
hshift = 0; |
| 6 |
|
| 7 |
for (h=0; h<64; h=h+1) |
| 8 |
{ |
| 9 |
first = h$16; |
| 10 |
second = h%16$4; |
| 11 |
third = h%4; |
| 12 |
if (ModelGeneticCode[h]==10) |
| 13 |
{ |
| 14 |
hshift = hshift+1; |
| 15 |
PIStop = PIStop-EFV[first][0]*EFV[second][0]*EFV[third][0]; |
| 16 |
continue; |
| 17 |
} |
| 18 |
result[h-hshift][0]=EFV[first][0]*EFV[second][0]*EFV[third][0]; |
| 19 |
} |
| 20 |
return result*(1.0/PIStop); |
| 21 |
} |
| 22 |
|
| 23 |
function GUIHandleFrequenciesCollection (dummy_parameter) |
| 24 |
{ |
| 25 |
HarvestFrequencies (Model_EFV_Vector,Data_Set_ID,1,1,1); |
| 26 |
MULTIPLY_BY_FREQS = 0; |
| 27 |
return 0; |
| 28 |
} |
| 29 |
|
| 30 |
/** MATRIX MODIFICATION CODE **/ |
| 31 |
|
| 32 |
EFVModifierMatrix = {ModelMatrixDimension,ModelMatrixDimension}; |
| 33 |
hshift = 0; |
| 34 |
|
| 35 |
for (h=0; h<64; h=h+1) |
| 36 |
{ |
| 37 |
if (ModelGeneticCode[h]==10) |
| 38 |
{ |
| 39 |
hshift = hshift+1; |
| 40 |
continue; |
| 41 |
} |
| 42 |
vshift = hshift; |
| 43 |
for (v = h+1; v<64; v=v+1) |
| 44 |
{ |
| 45 |
diff = v-h; |
| 46 |
if (ModelGeneticCode[v]==10) |
| 47 |
{ |
| 48 |
vshift = vshift+1; |
| 49 |
continue; |
| 50 |
} |
| 51 |
if ((h$4==v$4)||((diff%4==0)&&(h$16==v$16))||(diff%16==0)) |
| 52 |
{ |
| 53 |
if (h$4==v$4) |
| 54 |
{ |
| 55 |
transition = v%4; |
| 56 |
transition2= h%4; |
| 57 |
} |
| 58 |
else |
| 59 |
{ |
| 60 |
if(diff%16==0) |
| 61 |
{ |
| 62 |
transition = v$16; |
| 63 |
transition2= h$16; |
| 64 |
} |
| 65 |
else |
| 66 |
{ |
| 67 |
transition = v%16$4; |
| 68 |
transition2= h%16$4; |
| 69 |
} |
| 70 |
} |
| 71 |
if (transition==0) |
| 72 |
{ |
| 73 |
EFVModifierMatrix[h-hshift][v-vshift] := "EFV__[0]"; |
| 74 |
} |
| 75 |
else |
| 76 |
{ |
| 77 |
if (transition==1) |
| 78 |
{ |
| 79 |
EFVModifierMatrix[h-hshift][v-vshift] := "EFV__[1]"; |
| 80 |
} |
| 81 |
else |
| 82 |
{ |
| 83 |
if (transition==2) |
| 84 |
{ |
| 85 |
EFVModifierMatrix[h-hshift][v-vshift] := "EFV__[2]"; |
| 86 |
} |
| 87 |
else |
| 88 |
{ |
| 89 |
EFVModifierMatrix[h-hshift][v-vshift] := "EFV__[3]"; |
| 90 |
} |
| 91 |
|
| 92 |
} |
| 93 |
} |
| 94 |
if (transition2==0) |
| 95 |
{ |
| 96 |
EFVModifierMatrix[v-vshift][h-hshift] := "EFV__[0]"; |
| 97 |
} |
| 98 |
else |
| 99 |
{ |
| 100 |
if (transition2==1) |
| 101 |
{ |
| 102 |
EFVModifierMatrix[v-vshift][h-hshift] := "EFV__[1]"; |
| 103 |
} |
| 104 |
else |
| 105 |
{ |
| 106 |
if (transition2==2) |
| 107 |
{ |
| 108 |
EFVModifierMatrix[v-vshift][h-hshift] := "EFV__[2]"; |
| 109 |
} |
| 110 |
else |
| 111 |
{ |
| 112 |
EFVModifierMatrix[v-vshift][h-hshift] := "EFV__[3]"; |
| 113 |
} |
| 114 |
|
| 115 |
} |
| 116 |
} |
| 117 |
} |
| 118 |
} |
| 119 |
} |
| 120 |
|
| 121 |
|