Merge branch 'develop' into features/r2_11_2_alphafold/JAL-629
[jalview.git] / src / jalview / datamodel / ContactMapHolder.java
index 5ef2b2a..2b5c853 100644 (file)
@@ -28,19 +28,23 @@ public class ContactMapHolder implements ContactMapHolderI
     {
       return null;
     }
+    // TODO: could resolve sequence position to column position here
+    // TODO: what about for complexes - where contactMatrix may involve two or
+    // more sequences
     return cm.getContactList(column);
   }
 
   @Override
   public AlignmentAnnotation addContactList(ContactMatrixI cm)
   {
-    AlignmentAnnotation aa = new AlignmentAnnotation("Contact Matrix",
-            "Contact Matrix", new Annotation[0]);
+
+    AlignmentAnnotation aa = new AlignmentAnnotation(cm.getAnnotLabel(),
+            cm.getAnnotDescr(), new Annotation[0]);
     aa.graph = AlignmentAnnotation.CUSTOMRENDERER;
     aa.graphMin = cm.getMin();
     aa.graphMax = cm.getMax();
     aa.editable = false;
-    // aa.autoCalculated = true;
+
     contactmaps.put(aa.annotationId, cm);
     // TODO: contact matrices could be intra or inter - more than one refseq
     // possible!
@@ -50,4 +54,17 @@ public class ContactMapHolder implements ContactMapHolderI
     }
     return aa;
   }
+
+  @Override
+  public ContactMatrixI getContactMatrixFor(AlignmentAnnotation ann)
+  {
+    return contactmaps == null ? null : contactmaps.get(ann.annotationId);
+  }
+
+  @Override
+  public void addContactListFor(AlignmentAnnotation annotation,
+          ContactMatrixI cm)
+  {
+    contactmaps.put(annotation.annotationId, cm);
+  }
 }