JAL-2349 allow PAE or other contact matrices to hold a coordinate mapping allowing...
[jalview.git] / src / jalview / datamodel / Alignment.java
index 517a6dd..1ec702c 100755 (executable)
@@ -2076,14 +2076,19 @@ public class Alignment implements AlignmentI, AutoCloseable
     }
     if (cl == null && _aa.sequenceRef != null)
     {
-      int spos = _aa.sequenceRef.findPosition(column);
-      if (spos >= _aa.sequenceRef.getStart()
-              && spos <= 1 + _aa.sequenceRef.getEnd())
+      if (_aa.annotations[column] != null)
       {
-        cl = _aa.sequenceRef.getContactListFor(_aa, spos-_aa.sequenceRef.getStart());
+        // sequence associated
+        cl = _aa.sequenceRef.getContactListFor(_aa, column);
         if (cl == null && _aa.sequenceRef.getDatasetSequence() != null)
         {
-          _aa.sequenceRef.getDatasetSequence().getContactListFor(_aa, spos-_aa.sequenceRef.getStart());
+          int spos = _aa.sequenceRef.findPosition(column);
+          if (spos >= _aa.sequenceRef.getStart()
+                  && spos <= 1 + _aa.sequenceRef.getEnd())
+          {
+            cl = _aa.sequenceRef.getDatasetSequence().getContactListFor(_aa,
+                    spos-_aa.sequenceRef.getStart());
+          }
         }
       }
     }