JAL-674 don't create multiple secondary structure lines for a particular sequence...
authorJim Procter <j.procter@dundee.ac.uk>
Mon, 20 Oct 2014 12:48:40 +0000 (13:48 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Tue, 21 Oct 2014 10:34:54 +0000 (11:34 +0100)
src/jalview/structure/StructureSelectionManager.java

index 8a5f02a..4d94b2d 100644 (file)
@@ -189,9 +189,26 @@ public class StructureSelectionManager
      * the tried and tested MCview pdb mapping
      */
     MCview.PDBfile pdb = null;
+    boolean parseSecStr=true;
+    for (SequenceI sq:sequence)
+    {
+      SequenceI ds = sq;while (ds.getDatasetSequence()!=null) { ds = ds.getDatasetSequence();};
+      if (ds.getAnnotation()!=null)
+      {
+        for (AlignmentAnnotation ala:ds.getAnnotation())
+        {
+          // false if any annotation present from this structure
+          if (MCview.PDBfile.isCalcIdForFile(ala.getCalcId(), pdbFile))
+          {
+            parseSecStr = false;
+          }
+        }
+      }
+    }
     try
     {
-      pdb = new MCview.PDBfile(pdbFile, protocol);
+      pdb = new MCview.PDBfile(true, parseSecStr, pdbFile, protocol);
+      
     } catch (Exception ex)
     {
       ex.printStackTrace();