From: James Procter Date: Tue, 24 Jan 2023 07:49:39 +0000 (+0000) Subject: JAL-629 need to delay call to AlignFile.parse() if StructureFile needs to configure... X-Git-Tag: Release_2_11_4_0~493 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9c05fc8a07869007db06cc7efc54f2ac41e4575c;p=jalview.git JAL-629 need to delay call to AlignFile.parse() if StructureFile needs to configure itself at construction time --- diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index 37b3d68..2bc4869 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -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(); } diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 60eb9cc..b5ed052 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -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 { diff --git a/src/jalview/io/StructureFile.java b/src/jalview/io/StructureFile.java index 7ecbc2d..0a0504e 100644 --- a/src/jalview/io/StructureFile.java +++ b/src/jalview/io/StructureFile.java @@ -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));