1 package jalview.schemes;
3 import static org.testng.Assert.assertEquals;
7 import org.testng.annotations.Test;
9 public class HydrophobicColourSchemeTest
12 * Turn colours are based on the scores in ResidueProperties.hyd A = 1.8, R =
13 * -4.5, N = -3.5, D = -3.5... min = -3.9 max = 4.5
15 * scores are scaled to c 0-1 between min and max and colour is (c, 0, 1-c)
17 @Test(groups = "Functional")
18 public void testFindColour()
20 ScoreColourScheme scheme = new HydrophobicColourScheme();
24 float a = (1.8f - min) / (max - min);
25 assertEquals(scheme.findColour('A', 0, null), new Color(a, 0, 1 - a));
27 float d = (-3.5f - min) / (max - min);
28 assertEquals(scheme.findColour('D', 0, null), new Color(d, 0, 1 - d));
30 assertEquals(scheme.findColour('-', 0, null), Color.WHITE);