1 package jalview.schemes;
3 import static org.testng.Assert.assertEquals;
7 import org.testng.annotations.Test;
9 public class Blosum62ColourSchemeTest
12 * Test the method that determines colour as:
14 * <li>white if there is no consensus</li>
15 * <li>white if 'residue' is a gap</li>
16 * <li>dark blue if residue matches consensus (or joint consensus)</li>
17 * <li>else, total the residue's Blosum score with the consensus residue(s)</li>
19 * <li>if positive, light blue, else white</li>
24 public void testFindColour()
26 ColourSchemeI blosum = new Blosum62ColourScheme();
27 Color lightBlue = new Color(204, 204, 255);
28 Color darkBlue = new Color(154, 154, 255);
31 * findColour does not use column, sequence or pid score
32 * we assume consensus residue is computed as upper case
34 assertEquals(blosum.findColour('A', 0, null, "A", 0f), darkBlue);
35 assertEquals(blosum.findColour('a', 0, null, "A", 0f), darkBlue);
38 * L has a Blosum score of
47 assertEquals(blosum.findColour('L', 0, null, "A", 0f), Color.white); // -1
48 assertEquals(blosum.findColour('L', 0, null, "B", 0f), Color.white); // -4
49 assertEquals(blosum.findColour('L', 0, null, "F", 0f), Color.white); // 0
50 assertEquals(blosum.findColour('L', 0, null, "I", 0f), lightBlue); // 2
51 assertEquals(blosum.findColour('L', 0, null, "TV", 0f), Color.white); // 0
52 assertEquals(blosum.findColour('L', 0, null, "IV", 0f), lightBlue); // 3
53 assertEquals(blosum.findColour('L', 0, null, "IT", 0f), lightBlue); // 1
54 assertEquals(blosum.findColour('L', 0, null, "IAT", 0f), Color.white); // 0