JAL-674 test for presence of annotation derived from particular PDB file
authorJim Procter <j.procter@dundee.ac.uk>
Mon, 20 Oct 2014 12:46:05 +0000 (13:46 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Tue, 21 Oct 2014 10:34:53 +0000 (11:34 +0100)
src/MCview/PDBfile.java

index 20b3171..ae2eb50 100755 (executable)
@@ -269,8 +269,29 @@ public class PDBfile extends jalview.io.AlignFile
         System.err.println(line);
       }
     }
+    markCalcIds();
   }
 
+  public static boolean isCalcIdForFile(String calcId, String pdbFile)
+  {
+    return (calcId != null && calcId.startsWith("JalviewPDB:" + pdbFile
+            + ":JalviewPDB:"));
+  }
+  private void markCalcIds()
+  {
+    for (SequenceI sq : seqs)
+    {
+      for (AlignmentAnnotation aa : sq.getAnnotation())
+      {
+        String oldId = aa.getCalcId();
+        if (oldId == null)
+        {
+          oldId = "";
+        }
+        aa.setCalcId("JalviewPDB:" + getDataName() + ":JalviewPDB:" + oldId);
+      }
+    }
+  }
   private void processPdbFileWithJmol(ArrayList<SequenceI> prot)
           throws Exception
   {