TER flag added
authoramwaterhouse <Andrew Waterhouse>
Wed, 30 Nov 2005 15:05:12 +0000 (15:05 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 30 Nov 2005 15:05:12 +0000 (15:05 +0000)
src/MCview/PDBfile.java

index c4fe563..47aa5ac 100755 (executable)
@@ -74,6 +74,8 @@ public class PDBfile extends jalview.io.FileParse {
         PDBChain tmpchain;\r
         String line;\r
         boolean modelFlag = false;\r
+        boolean terFlag = false;\r
+\r
         for (int i = 0; i < lineArray.size(); i++)\r
         {\r
 \r
@@ -88,17 +90,23 @@ public class PDBfile extends jalview.io.FileParse {
            if(line.indexOf("MODEL")==0)\r
              modelFlag = true;\r
 \r
+           if(line.indexOf("TER")==0)\r
+             terFlag = true;\r
+\r
            if(modelFlag && line.indexOf("ENDMDL")==0)\r
              break;\r
 \r
-           if (line.indexOf("ATOM")==0 || line.indexOf("HETATM")==0 )\r
+           if (line.indexOf("ATOM")==0\r
+               || (line.indexOf("HETATM")==0 && !terFlag) )\r
             {\r
+              terFlag = false;\r
+\r
                     try {\r
                         Atom tmpatom = new Atom(line);\r
 \r
                         //Jalview is only interested in CA bonds????\r
-                        if(!tmpatom.name.equals("CA"))\r
-                          continue;\r
+                     //   if(!tmpatom.name.equals("CA"))\r
+                     //     continue;\r
 \r
                         tmpchain = findChain(tmpatom.chain);\r
                         if ( tmpchain != null)\r