+
+ @Test(groups = { "Functional" })
+ public void testGetDssp3State()
+ {
+ assertNull(ResidueProperties.getDssp3state(null));
+ assertEquals("", ResidueProperties.getDssp3state(""));
+ String foo = "0123 []<>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ String bar = " E E HHH ";
+ assertEquals(bar, ResidueProperties.getDssp3state(foo));
+ }
+
+ @Test(groups = { "Functional" })
+ public void testPhysicoChemicalProperties()
+ {
+ checkProperty("aromatic", "FYWH-*");
+ checkProperty("aliphatic", "IVL-*");
+ checkProperty("tiny", "GAS-*");
+ checkProperty("small", "VCTGACSDNP-*");
+ checkProperty("charged", "HKRDE-*");
+ checkProperty("negative", "DE-*");
+ checkProperty("polar", "YWHRKTSNDEQ-*X");
+ checkProperty("positive", "HKR-*");
+ checkProperty("proline", "P-*");
+ checkProperty("hydrophobic", "MILVFYWHKTGAC-*X");
+ }
+
+ /**
+ * Verify that the residues in the list have the named property, and other
+ * residues do not
+ *
+ * @param property
+ * @param residues
+ */
+ void checkProperty(String property, String residues)
+ {
+ Map<String, Integer> props = ResidueProperties.propHash.get(property);
+
+ /*
+ * assert residues have the property (value 1 in lookup)
+ */
+ for (char res : residues.toCharArray())
+ {
+ assertEquals(res + " should be " + property, 1,
+ props.get(String.valueOf(res)).intValue());
+ }
+
+ /*
+ * assert other residues do not (value 0 in lookup)
+ */
+ for (String res : ResidueProperties.aa)
+ {
+ if (!residues.contains(res))
+ {
+ Integer propValue = props.get(String.valueOf(res));
+
+ if (propValue != null)
+ {
+ /*
+ * conservation calculation assigns unexpected symbols
+ * the same value as '-'; here we just check those which
+ * explicitly do not have the property
+ */
+ assertEquals(res + " should not be " + property, 0,
+ propValue.intValue());
+ }
+ }
+ }
+ }