JAL-2148 further enhancment to CA HETATM processing
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 31 Aug 2016 13:18:53 +0000 (14:18 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 31 Aug 2016 13:18:53 +0000 (14:18 +0100)
src/jalview/ext/jmol/JmolParser.java

index 848e7db..7c3ff42 100644 (file)
@@ -257,6 +257,10 @@ public class JmolParser extends StructureFile implements JmolStatusListener
       // diff < 5 then mark as valid and update termination Atom
       if (chainTerMap.containsKey(curAtomChId))
       {
+        if (curAtom.getResno() < chainTerMap.get(curAtomChId).getResno())
+        {
+          return false;
+        }
         if ((curAtom.getResno() - chainTerMap.get(curAtomChId).getResno()) < 5)
         {
           chainTerMap.put(curAtomChId, curAtom);
@@ -268,6 +272,10 @@ public class JmolParser extends StructureFile implements JmolStatusListener
     // atom with previously terminated chain encountered
     else if (chainTerMap.containsKey(curAtomChId))
     {
+      if (curAtom.getResno() < chainTerMap.get(curAtomChId).getResno())
+      {
+        return false;
+      }
       if ((curAtom.getResno() - chainTerMap.get(curAtomChId).getResno()) < 5)
       {
         chainTerMap.put(curAtomChId, curAtom);