JAL-4134 colour by annotation needs distinct annotation elements to hold colours
[jalview.git] / test / jalview / datamodel / PAEContactMatrixTest.java
index 71e824e..9b95164 100644 (file)
@@ -55,13 +55,25 @@ public class PAEContactMatrixTest
     assertEquals(cm.getContactAt(seq.getStart()),1d);
     verifyPAEmatrix(seq, aa, 0,0,4);
     
+    
     // Now associated with sequence not starting at 1
     seq = new Sequence("Seq/5-9","ASDQE");
     ContactMatrixI paematrix = new PAEContactMatrix(seq, PAEdata);
     aa = seq.addContactList(paematrix);
+    assertNotNull(aa);
+    // individual annotation elements need to be distinct for Matrix associated rows
+    Annotation ae5=aa.getAnnotationForPosition(5);
+    Annotation ae6=aa.getAnnotationForPosition(6);
+    assertNotNull(ae5);
+    assertNotNull(ae6);
+    assertTrue(ae5!=ae6);
+    
     cm = seq.getContactListFor(aa, 0);
     assertEquals(cm.getContactAt(0),1d);
     verifyPAEmatrix(seq, aa, 0, 0, 4);
+
+    // test clustering
+    paematrix.setGroupSet(GroupSet.makeGroups(paematrix, 0.1f, false));
     
     // remap - test the MappableContactMatrix.liftOver method
     SequenceI newseq = new Sequence("Seq","ASDQEASDQEASDQE");