From 9c05fc8a07869007db06cc7efc54f2ac41e4575c Mon Sep 17 00:00:00 2001 From: James Procter Date: Tue, 24 Jan 2023 07:49:39 +0000 Subject: [PATCH] JAL-629 need to delay call to AlignFile.parse() if StructureFile needs to configure itself at construction time --- src/jalview/ext/jmol/JmolParser.java | 4 ++-- src/jalview/io/AppletFormatAdapter.java | 7 +++++-- src/jalview/io/StructureFile.java | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) 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)); -- 1.7.10.2