public class PIDColourScheme extends ResidueColourScheme
{
- public Color[] pidColours;
+ private static final Color[] pidColours = { new Color(100, 100, 255),
+ new Color(153, 153, 255), new Color(204, 204, 255), };
- public float[] thresholds;
+ private static final float[] thresholds = { 80, 60, 40, };
SequenceGroup group;
public PIDColourScheme()
{
- this.pidColours = ResidueProperties.pidColours;
- this.thresholds = ResidueProperties.pidThresholds;
}
@Override
String consensusResidue, float pid)
{
/*
- * make everything uppercase; note this does nothing (fast)
+ * make everything uppercase; note this does nothing
* if consensusResidue is already uppercase
*/
consensusResidue = consensusResidue.toUpperCase();
c -= ('a' - 'A');
}
- if (consensusResidue == null)
+ if (consensusResidue == null || Comparison.isGap(c))
{
return Color.white;
}
String.valueOf(c));
if (matchesConsensus)
{
- if (!Comparison.isGap(c))
+ for (int i = 0; i < thresholds.length; i++)
{
- for (int i = 0; i < thresholds.length; i++)
+ if (pid > thresholds[i])
{
- if (pid > thresholds[i])
- {
- colour = pidColours[i];
- break;
- }
+ colour = pidColours[i];
+ break;
}
}
}