From: Jim Procter Date: Fri, 15 Nov 2024 13:53:19 +0000 (+0000) Subject: JAL-3914 viewers now pass PDBEntry to StructureSelectionManager.setMapping to propaga... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8dbe9206561daac950b4154da519d7aad4cfeaee;p=jalview.git JAL-3914 viewers now pass PDBEntry to StructureSelectionManager.setMapping to propagate temperature factor type and other metadata --- diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 26bcecc..ebacc79 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -785,6 +785,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel if (false) // see JAL-623 - need method of matching pasted data up { + // ALSO need to use the PDBEntry based setMapping method to pass in other metadata pdb = getSsm().setMapping(getSequence()[pe], getChains()[pe], pdbfile, DataSourceType.PASTE, getIProgressIndicator()); getPdbEntry(modelnum).setFile("INLINE" + pdb.getId()); @@ -818,8 +819,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel { } // Explicitly map to the filename used by Jmol ; - pdb = getSsm().setMapping(getSequence()[pe], getChains()[pe], - fileName, protocol, getIProgressIndicator()); + pdb = getSsm().setMapping(true,getSequence()[pe], getPdbEntry(pe), getChains()[pe], + getIProgressIndicator()); // pdbentry[pe].getFile(), protocol); } diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index 2e91b3d..55a6ea5 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -484,8 +484,8 @@ public class ChimeraViewFrame extends StructureViewerBase } // Explicitly map to the filename used by Chimera ; - pdb = jmb.getSsm().setMapping(jmb.getSequence()[pos], - jmb.getChains()[pos], pe.getFile(), protocol, + pdb = jmb.getSsm().setMapping(true, jmb.getSequence()[pos], pe, + jmb.getChains()[pos], getProgressIndicator()); jmb.stashFoundChains(pdb, pe.getFile()); diff --git a/src/jalview/gui/PymolViewer.java b/src/jalview/gui/PymolViewer.java index 52c253d..883373a 100644 --- a/src/jalview/gui/PymolViewer.java +++ b/src/jalview/gui/PymolViewer.java @@ -278,8 +278,8 @@ public class PymolViewer extends StructureViewerBase } else { - pdb = binding.getSsm().setMapping(binding.getSequence()[pos], - binding.getChains()[pos], pe.getFile(), protocol, + pdb = binding.getSsm().setMapping(true,binding.getSequence()[pos], + pe,binding.getChains()[pos], getProgressIndicator()); } binding.stashFoundChains(pdb, pe.getFile()); diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 9a9e2a2..e65f6cb 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -401,6 +401,35 @@ public class StructureSelectionManager } /** + * import / map chain using metadata from a PDBEntry object + * @param forStructureView + * @param sequenceArray + * @param pdbEntry + * @param targetChainIds + * @return + */ + synchronized public StructureFile setMapping(boolean forStructureView, + SequenceI[] sequenceArray, PDBEntry pdbEntry, String[] targetChainIds, IProgressIndicator progress) + { + return computeMapping(forStructureView, sequenceArray, targetChainIds, + pdbEntry.getFile(), pdbEntry.getProtocol(), progress, pdbEntry.getTempFacTypeTFType(), pdbEntry.getPAEFile(), true); + } + /** + * import / map chain using metadata from a PDBEntry object + * @param forStructureView + * @param sequenceArray + * @param pdbEntry + * @param targetChainIds + * @return + */ + synchronized public StructureFile setMapping(boolean forStructureView, + SequenceI[] sequenceArray, PDBEntry pdbEntry, String[] targetChainIds) + { + return computeMapping(forStructureView, sequenceArray, targetChainIds, + pdbEntry.getFile(), pdbEntry.getProtocol(), null, pdbEntry.getTempFacTypeTFType(), pdbEntry.getPAEFile(), true); + } + + /** * create sequence structure mappings between each sequence and the given * pdbFile (retrieved via the given protocol). Either constructs a mapping * using NW alignment or derives one from any available SIFTS mapping data.