Merge branch 'develop' into features/JAL-653_JAL-1766_htslib_refseqsupport
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index b6bb70d..2f81ec4 100644 (file)
@@ -605,17 +605,18 @@ public class StructureSelectionManager
     HashMap<Integer, int[]> mapping = new HashMap<Integer, int[]>();
     int resNum = -10000;
     int index = 0;
+    char insCode = ' ';
 
     do
     {
       Atom tmp = maxChain.atoms.elementAt(index);
-      if (resNum != tmp.resNumber && tmp.alignmentMapping != -1)
+      if ((resNum != tmp.resNumber || insCode != tmp.insCode)
+              && tmp.alignmentMapping != -1)
       {
         resNum = tmp.resNumber;
+        insCode = tmp.insCode;
         if (tmp.alignmentMapping >= -1)
         {
-          // TODO (JAL-1836) address root cause: negative residue no in PDB
-          // file
           mapping.put(tmp.alignmentMapping + 1, new int[] { tmp.resNumber,
               tmp.atomIndex });
         }