JAL-1551 format and tidy
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index 8a5f02a..58bba48 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();
@@ -236,7 +253,7 @@ public class StructureSelectionManager
       boolean first = true;
       for (int i = 0; i < pdb.chains.size(); i++)
       {
-        PDBChain chain = ((PDBChain) pdb.chains.elementAt(i));
+        PDBChain chain = (pdb.chains.elementAt(i));
         if (targetChain.length() > 0 && !targetChain.equals(chain.id)
                 && !infChain)
         {
@@ -245,8 +262,8 @@ public class StructureSelectionManager
         // TODO: correctly determine sequence type for mixed na/peptide
         // structures
         AlignSeq as = new AlignSeq(sequence[s],
-                ((PDBChain) pdb.chains.elementAt(i)).sequence,
-                ((PDBChain) pdb.chains.elementAt(i)).isNa ? AlignSeq.DNA
+                pdb.chains.elementAt(i).sequence,
+                pdb.chains.elementAt(i).isNa ? AlignSeq.DNA
                         : AlignSeq.PEP);
         as.calcScoreMatrix();
         as.traceAlignment();