Merge branch 'develop' into efficiency/JAL-2034_JAL-1421
[jalview.git] / src / jalview / ext / jmol / JmolParser.java
index 3280471..a791558 100644 (file)
@@ -27,7 +27,7 @@ import jalview.datamodel.SequenceI;
 import jalview.io.FileParse;
 import jalview.io.StructureFile;
 import jalview.schemes.ResidueProperties;
-import jalview.structure.StructureViewSettings;
+import jalview.structure.StructureImportSettings;
 import jalview.util.MessageManager;
 
 import java.io.IOException;
@@ -172,7 +172,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener
 
       if (getId() == null)
       {
-        setId(inFile.getName());
+        setId(safeName(getDataName()));
       }
       for (PDBChain chain : getChains())
       {
@@ -186,7 +186,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener
           prot.add(chainseq);
         }
 
-        if (StructureViewSettings.isPredictSecondaryStructure())
+        if (StructureImportSettings.isPredictSecondaryStructure())
         {
           createAnnotation(chainseq, chain, ms.at);
         }
@@ -206,6 +206,12 @@ public class JmolParser extends StructureFile implements JmolStatusListener
     List<Atom> significantAtoms = new ArrayList<Atom>();
     for (org.jmol.modelset.Atom atom : ms.at)
     {
+      // System.out.println("Seq Id : " + atom.getSeqID());
+      // System.out.println("To String : " + atom.toString());
+      if (!StructureImportSettings.isProcessHETATMs() && atom.isHetero())
+      {
+        continue;
+      }
       if (atom.getAtomName().equalsIgnoreCase("CA")
               || atom.getAtomName().equalsIgnoreCase("P"))
       {
@@ -277,9 +283,15 @@ public class JmolParser extends StructureFile implements JmolStatusListener
     {
       if (secstr[p] >= 'A' && secstr[p] <= 'z')
       {
+        try
+        {
         asecstr[p] = new Annotation(String.valueOf(secstr[p]), null,
                 secstrcode[p], Float.NaN);
         ssFound = true;
+        } catch (Exception e)
+        {
+          // e.printStackTrace();
+        }
       }
     }