JAL-1818 reimplemented sequence and annotation processing for JmolParser and further...
[jalview.git] / src / MCview / PDBChain.java
index 228eede..f4263b1 100755 (executable)
@@ -335,6 +335,7 @@ public class PDBChain
       // Add inserted residues as features to the base residue
       Atom currAtom = resAtoms.get(0);
       if (currAtom.insCode != ' '
+              && !residues.isEmpty()
               && residues.lastElement().atoms.get(0).resNumber == currAtom.resNumber)
       {
         SequenceFeature sf = new SequenceFeature("INSERTION",
@@ -347,6 +348,18 @@ public class PDBChain
       else
       {
 
+        // boolean baseDetected = false;
+        // for (Atom resAtom : resAtoms)
+        // {
+        // if (resAtom.insCode == ' ')
+        // {
+        // baseDetected = true;
+        // }
+        // }
+        // if (!baseDetected)
+        // {
+        // continue;
+        // }
       // Make a new Residue object with the new atoms vector
       residues.addElement(new Residue(resAtoms, resNumber - 1, count));
 
@@ -360,6 +373,7 @@ public class PDBChain
       resFeatures.addElement(sf);
       resAnnotation.addElement(new Annotation(tmpat.tfactor));
       // Keep totting up the sequence
+
       if ((symbol = ResidueProperties.getAA3Hash().get(tmpat.resName)) == null)
       {
         String nucname = tmpat.resName.trim();