7 static const char Alphabet[] = "ACGTU";
9 void SetNucSubstMx(double Match, double Mismatch)
\r
11 static bool Done = false;
\r
17 Die("Match score should be +ve");
\r
18 if (Mismatch >= 0.0)
\r
19 Die("Mismatch score should be -ve");
\r
21 unsigned N = unsigned(strlen(Alphabet));
\r
23 g_SubstMxf.Alloc("NUCMX", 256, 256);
\r
24 strcpy(g_SubstMxf.m_Alpha, "ACGT");
\r
26 g_SubstMx = g_SubstMxf.GetData();
\r
27 for (unsigned i = 0; i < N; ++i)
\r
29 for (unsigned j = 0; j < N; ++j)
\r
31 float v = float(i == j ? Match : Mismatch);
\r
33 byte ui = (byte) toupper(Alphabet[i]);
\r
34 byte uj = (byte) toupper(Alphabet[j]);
\r
35 byte li = (byte) tolower(ui);
\r
36 byte lj = (byte) tolower(uj);
\r
37 ui = (byte) toupper(ui);
\r
38 uj = (byte) toupper(uj);
\r
40 g_SubstMx[ui][uj] = v;
\r
41 g_SubstMx[uj][ui] = v;
\r
43 g_SubstMx[ui][lj] = v;
\r
44 g_SubstMx[uj][li] = v;
\r
46 g_SubstMx[li][uj] = v;
\r
47 g_SubstMx[lj][ui] = v;
\r
49 g_SubstMx[li][lj] = v;
\r
50 g_SubstMx[lj][li] = v;
\r
54 for (unsigned j = 0; j < N; ++j)
\r
58 byte ui = (byte) 'N';
\r
59 byte uj = (byte) toupper(Alphabet[j]);
\r
60 byte li = (byte) 'n';
\r
61 byte lj = (byte) tolower(uj);
\r
62 ui = (byte) toupper(ui);
\r
63 uj = (byte) toupper(uj);
\r
65 g_SubstMx[ui][uj] = v;
\r
66 g_SubstMx[uj][ui] = v;
\r
68 g_SubstMx[ui][lj] = v;
\r
69 g_SubstMx[uj][li] = v;
\r
71 g_SubstMx[li][uj] = v;
\r
72 g_SubstMx[lj][ui] = v;
\r
74 g_SubstMx[li][lj] = v;
\r
75 g_SubstMx[lj][li] = v;
\r