@Override
public int getPairwiseScore(char c, char d)
{
- int pog = 0;
+ int score = 0;
try
{
: ResidueProperties.nucleotideIndex[c];
int b = (type == 0) ? ResidueProperties.aaIndex[d]
: ResidueProperties.nucleotideIndex[d];
-
- /*
- * FIXME: 2.10.1 PCA treats gap as [22] or 'X', but Tree
- * calculation treats as [23]; which is correct?
- */
- /*
- * hack to convert unassigned / unknown (including gap)
- * to index of unknown (X for amino acids, N for nucleotide)
- * TODO: statically assign gap characters to this index?
- */
-// if (type == 0)
-// {
-// if (a == ResidueProperties.maxProteinIndex)
-// {
-// a = ResidueProperties.aaIndex['X'];
-// }
-// if (b == ResidueProperties.maxProteinIndex)
-// {
-// b = ResidueProperties.aaIndex['X'];
-// }
-// }
-// if (type != 0)
-// {
-// if (a == ResidueProperties.maxNucleotideIndex)
-// {
-// a = ResidueProperties.nucleotideIndex['N'];
-// }
-// if (b == ResidueProperties.maxNucleotideIndex)
-// {
-// b = ResidueProperties.nucleotideIndex['N'];
-// }
-// }
- pog = matrix[a][b];
+ score = matrix[a][b];
} catch (Exception e)
{
// System.out.println("Unknown residue in " + A1 + " " + A2);
}
- return pog;
+ return score;
}
/**
}
/*
* verify expected BLOSUM dot product scores
- * Note: gap is treated like 'X' [22] in the matrix
*/
// F.F + K.K + L.L = 6 + 5 + 4 = 15
assertEquals(pairwise.getValue(0, 0), 15d);
- // R.R + X.X + D.D = 5 + -1 + 6 = 10
- assertEquals(pairwise.getValue(1, 1), 10d);
+ // R.R + -.- + D.D = 5 + 1 + 6 = 12
+ assertEquals(pairwise.getValue(1, 1), 12d);
// Q.Q + I.I + A.A = 5 + 4 + 4 = 13
assertEquals(pairwise.getValue(2, 2), 13d);
// G.G + W.W + C.C = 6 + 11 + 9 = 26
assertEquals(pairwise.getValue(3, 3), 26d);
- // F.R + K.X + L.D = -3 + -1 + -3 = -8
- assertEquals(pairwise.getValue(0, 1), -8d);
+ // F.R + K.- + L.D = -3 + -4 + -4 = -11
+ assertEquals(pairwise.getValue(0, 1), -11d);
// F.Q + K.I + L.A = -3 + -3 + -1 = -7
assertEquals(pairwise.getValue(0, 2), -7d);
// F.G + K.W + L.C = -3 + -3 + -1 = -7
assertEquals(pairwise.getValue(0, 3), -7d);
- // R.Q + X.I + D.A = 1 + -1 + -2 = -2
- assertEquals(pairwise.getValue(1, 2), -2d);
- // R.G + X.W + D.C = -2 + -2 + -3 = -7
- assertEquals(pairwise.getValue(1, 3), -7d);
+ // R.Q + -.I + D.A = 1 + -4 + -2 = -5
+ assertEquals(pairwise.getValue(1, 2), -5d);
+ // R.G + -.W + D.C = -2 + -4 + -3 = -9
+ assertEquals(pairwise.getValue(1, 3), -9d);
// Q.G + I.W + A.C = -2 + -3 + 0 = -5
assertEquals(pairwise.getValue(2, 3), -5d);
}