updated version to 2.6.1
[jalview.git] / src / MCview / PDBChain.java
index e9b0247..c084fa1 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6.1)
  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
@@ -46,7 +46,9 @@ public class PDBChain
   public int offset;
 
   public Sequence sequence;
-  public boolean isNa=false;
+
+  public boolean isNa = false;
+
   public boolean isVisible = true;
 
   public int pdbstart = 0;
@@ -150,10 +152,9 @@ public class PDBChain
                 - offset)).atoms.elementAt(0)).alignmentMapping);
         tx.setEnd(1 + ((Atom) ((Residue) residues.elementAt(tx.getEnd()
                 - offset)).atoms.elementAt(0)).alignmentMapping);
-        tx
-                .setStatus(status
-                        + ((tx.getStatus() == null || tx.getStatus()
-                                .length() == 0) ? "" : ":" + tx.getStatus()));
+        tx.setStatus(status
+                + ((tx.getStatus() == null || tx.getStatus().length() == 0) ? ""
+                        : ":" + tx.getStatus()));
         if (tx.begin != 0 && tx.end != 0)
           sq.addSequenceFeature(tx);
       }
@@ -163,20 +164,20 @@ public class PDBChain
 
   public void makeCaBondList()
   {
-    boolean na=false;
-    int numNa=0;
+    boolean na = false;
+    int numNa = 0;
     for (int i = 0; i < (residues.size() - 1); i++)
     {
       Residue tmpres = (Residue) residues.elementAt(i);
       Residue tmpres2 = (Residue) residues.elementAt(i + 1);
       Atom at1 = tmpres.findAtom("CA");
       Atom at2 = tmpres2.findAtom("CA");
-      na=false;
+      na = false;
       if ((at1 == null) && (at2 == null))
       {
-        na=true;
+        na = true;
         at1 = tmpres.findAtom("P");
-        at1 = tmpres2.findAtom("P");
+        at2 = tmpres2.findAtom("P");
       }
       if ((at1 != null) && (at2 != null))
       {
@@ -194,9 +195,9 @@ public class PDBChain
         System.out.println("not found " + i);
       }
     }
-    if (numNa>0 && ((numNa/residues.size())>0.99))
+    if (numNa > 0 && ((numNa / residues.size()) > 0.99))
     {
-      isNa=true;
+      isNa = true;
     }
   }
 
@@ -273,8 +274,8 @@ public class PDBChain
       // Keep totting up the sequence
       if ((symbol = ResidueProperties.getAA3Hash().get(tmpat.resName)) == null)
       {
-        String nucname=tmpat.resName.trim();
-        if (ResidueProperties.nucleotideIndex[nucname.charAt(0)] == -1)
+        String nucname = tmpat.resName.trim();
+        if (tmpat.name.equalsIgnoreCase("CA") || ResidueProperties.nucleotideIndex[nucname.charAt(0)] == -1)
         {
           seq.append("X");
           // System.err.println("PDBReader:Null aa3Hash for " +
@@ -303,7 +304,7 @@ public class PDBChain
     {
       id = " ";
     }
-    isNa=nucleotide;
+    isNa = nucleotide;
     sequence = new Sequence(id, seq.toString(), offset, resNumber - 1); // Note:
     // resNumber-offset
     // ~=
@@ -475,11 +476,9 @@ public class PDBChain
           }
         }
       }
-      sq
-              .addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM",
-                      "PDB Residue Numbering for " + this.pdbid + ":"
-                              + this.id, an, (float) min, (float) max,
-                      AlignmentAnnotation.LINE_GRAPH));
+      sq.addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM",
+              "PDB Residue Numbering for " + this.pdbid + ":" + this.id,
+              an, (float) min, (float) max, AlignmentAnnotation.LINE_GRAPH));
     }
   }
 }