JAL-4311 detect and discover tftype metadata on PDBEntry if no tftype was specified patch/JAL-4311_import_pLDDT_scores_from_nonAlphaFold_sources
authorJames Procter <j.procter@dundee.ac.uk>
Thu, 2 Nov 2023 00:46:14 +0000 (00:46 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Thu, 2 Nov 2023 00:46:14 +0000 (00:46 +0000)
src/jalview/structure/StructureSelectionManager.java

index 2f1ddc0..b8cda73 100644 (file)
@@ -426,6 +426,47 @@ public class StructureSelectionManager
   {
     long progressSessionId = System.currentTimeMillis() * 3;
 
+    boolean inspectPdbEntry=false;
+    PDBEntry barepdbe=null; 
+    if (tft==null || paeFilename==null)
+    {
+      for (SequenceI s:sequenceArray)
+      {
+        while (s.getDatasetSequence()!=null)
+        {
+          s = s.getDatasetSequence();
+        }
+        if (s.getAllPDBEntries()!=null)
+        {
+          for (PDBEntry p:s.getAllPDBEntries())
+          {
+            if (p.getFile()!=null && p.getFile().equals(pdbFile))
+            {
+              if (barepdbe==null)
+              {
+                barepdbe=new PDBEntry(p);
+              } else {
+                // todo - may need to copy and null the chaincode so we can do a faithful update
+                barepdbe.updateFrom(p);
+              }
+            }
+          }
+        }
+      }
+      if (barepdbe!=null)
+      {
+        if (barepdbe.hasTempFacType())
+        {
+          try {
+            tft = TFType.valueOf(barepdbe.getTempFacType().toUpperCase(Locale.ROOT));
+          } catch (IllegalArgumentException ia)
+          {
+            Console.warn("Ignoring unknown temperature factor type '"+barepdbe.getTempFacType()+"'");
+          }
+        }
+      }
+
+    }
     /**
      * do we extract and transfer annotation from 3D data ?
      */