From 4a19d8c84a58867a5e69fe3e9ddc36460aeaa2c9 Mon Sep 17 00:00:00 2001 From: James Procter Date: Thu, 2 Nov 2023 00:46:14 +0000 Subject: [PATCH] JAL-4311 detect and discover tftype metadata on PDBEntry if no tftype was specified --- .../structure/StructureSelectionManager.java | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 2f1ddc0..b8cda73 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -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 ? */ -- 1.7.10.2