JAL-629 Guesstimate whether to set pLDDT with PDB file
[jalview.git] / src / jalview / gui / StructureChooser.java
index 11e50db..5612469 100644 (file)
@@ -679,7 +679,17 @@ public class StructureChooser extends GStructureChooser
     {
       selectedPdbFileName = chooser.getSelectedFile().getPath();
       Cache.setProperty("LAST_DIRECTORY", selectedPdbFileName);
+      boolean guessTFType = localPdbPaeMatrixFileName == null;
       localPdbPaeMatrixFileName = guessPAEFilename();
+      guessTFType |= localPdbPaeMatrixFileName != null;
+      if (guessTFType
+              && new File(selectedPdbFileName).getName().startsWith("AF-")
+              && !tempFacAsChanged)
+      {
+        // localPdbPaeMatrixFileName was null and now isn't and filename could
+        // well be AlphaFold and user hasn't adjusted the tempFacType
+        combo_tempFacAs.setSelectedItem(TFType.PLDDT);
+      }
       validateSelections();
     }
   }