}
Double prob;
prob = hmm.getMatchEmissionProbability(position, symbol);
- double freq = ResidueProperties.aminoBackgroundFrequencies.get(symbol);
- Double value = prob - freq;
-
+ double freq = 0;
+ if ("amino".equals(hmm.getAlphabetType()))
+ {
+ if (!ResidueProperties.aminoBackgroundFrequencies.containsKey(symbol))
+ {
+ return Color.white;
+ }
+ freq = ResidueProperties.aminoBackgroundFrequencies.get(symbol);
+ }
+ else if ("DNA".equals(hmm.getAlphabetType()))
+ {
+ if (!ResidueProperties.dnaBackgroundFrequencies.containsKey(symbol))
+ {
+ return Color.white;
+ }
+ freq = ResidueProperties.dnaBackgroundFrequencies.get(symbol);
+ }
+ else if ("RNA".equals(hmm.getAlphabetType()))
+ {
+ if (!ResidueProperties.rnaBackgroundFrequencies.containsKey(symbol))
+ {
+ return Color.white;
+ }
+ freq = ResidueProperties.rnaBackgroundFrequencies.get(symbol);
+ }
+ if (prob == 0)
+ {
+ return Color.red;
+ }
+ Double value = Math.log(prob / freq);
Color colour = null;
- if (value >= 0)
+ if (value > 0)
{
colour = ColorUtils.getGraduatedColour(value.floatValue(), 0,
- Color.WHITE, 1f, Color.green);
+ Color.WHITE, 3f, Color.blue);
}
else if (value < 0)
{
- return Color.YELLOW;
+ return Color.ORANGE;
}
return colour;