JAL-2226 transfer chain annotation when calcId, label and description are distinct...
[jalview.git] / src / mc_view / PDBfile.java
index 0435def..24e0435 100755 (executable)
@@ -143,18 +143,19 @@ public class PDBfile extends StructureFile
           }
 
           Atom tmpatom = new Atom(line);
-          try
+          if (tmpatom.resNumIns.trim().equals(lastID))
+          {
+            // phosphorylated protein - seen both CA and P..
+            continue;
+          }
+          tmpchain = findChain(tmpatom.chain);
+          if (tmpchain != null)
           {
-            tmpchain = findChain(tmpatom.chain);
-            if (tmpatom.resNumIns.trim().equals(lastID))
-            {
-              // phosphorylated protein - seen both CA and P..
-              continue;
-            }
             tmpchain.atoms.addElement(tmpatom);
-          } catch (Exception e)
+          } else
           {
-            tmpchain = new PDBChain(getId(), tmpatom.chain);
+            // PDBfile never handles alphafold models, so false
+            tmpchain = new PDBChain(getId(), tmpatom.chain, false);
             getChains().add(tmpchain);
             tmpchain.atoms.addElement(tmpatom);
           }