JAL-629 need to delay call to AlignFile.parse() if StructureFile needs to configure...
authorJames Procter <j.procter@dundee.ac.uk>
Tue, 24 Jan 2023 07:49:39 +0000 (07:49 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Tue, 24 Jan 2023 07:50:51 +0000 (07:50 +0000)
src/jalview/ext/jmol/JmolParser.java
src/jalview/io/AppletFormatAdapter.java
src/jalview/io/StructureFile.java

index 37b3d68..2bc4869 100644 (file)
@@ -251,8 +251,8 @@ public class JmolParser extends StructureFile implements JmolStatusListener
         {
           AnnotationRowBuilder builder = null;
           String tempFString = null;
-          if (isAlphafoldModel() || this
-                  .getTemperatureFactorType() == StructureImportSettings.TFType.PLDDT)
+          if (isAlphafoldModel() || StructureImportSettings.TFType.PLDDT
+                  .equals(getTemperatureFactorType()))
           {
             builder = new AlphaFoldAnnotationRowBuilder();
           }
index 60eb9cc..b5ed052 100755 (executable)
@@ -36,7 +36,6 @@ import jalview.datamodel.PDBEntry.Type;
 import jalview.datamodel.SequenceI;
 import jalview.ext.jmol.JmolParser;
 import jalview.structure.StructureImportSettings;
-import jalview.structure.StructureImportSettings.TFType;
 import jalview.util.Platform;
 
 /**
@@ -184,12 +183,16 @@ public class AppletFormatAdapter
                         .toString());
         StructureImportSettings.addSettings(annotFromStructure,
                 localSecondaryStruct, serviceSecondaryStruct);
+        if (tempfacType != null)
+        {
+          StructureImportSettings.setTemperatureFactorType(tempfacType);
+        }
         if (isParseWithJMOL)
         {
           // needs a File option
           alignFile = new JmolParser(
                   selectedFile == null ? inFile : selectedFile, sourceType,
-                  tempfacType);
+                  StructureImportSettings.getTemperatureFactorType());
         }
         else
         {
index 7ecbc2d..0a0504e 100644 (file)
@@ -89,8 +89,9 @@ public abstract class StructureFile extends AlignFile
   public StructureFile(Object inFile, DataSourceType sourceType,
           StructureImportSettings.TFType tempfacType) throws IOException
   {
-    super(inFile, sourceType);
+    super(false, inFile, sourceType);
     this.setTemperatureFactorType(tempfacType);
+    doParse();
   }
 
   public StructureFile(FileParse fp) throws IOException
@@ -339,6 +340,8 @@ public abstract class StructureFile extends AlignFile
                 .setProcessSecondaryStructure(predictSecondaryStructure);
         StructureImportSettings
                 .setExternalSecondaryStructure(externalSecondaryStructure);
+        StructureImportSettings
+                .setTemperatureFactorType(temperatureFactorType);
         Object jmf = constructor.newInstance(args);
         AlignmentI al = new Alignment((SequenceI[]) cl
                 .getMethod("getSeqsAsArray", new Class[] {}).invoke(jmf));