JAL-3914 viewers now pass PDBEntry to StructureSelectionManager.setMapping to propaga... features/JAL-3914_modelqualityscores_v2115
authorJim Procter <jprocter@dundee.ac.uk>
Fri, 15 Nov 2024 13:53:19 +0000 (13:53 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Fri, 15 Nov 2024 13:53:19 +0000 (13:53 +0000)
src/jalview/ext/jmol/JalviewJmolBinding.java
src/jalview/gui/ChimeraViewFrame.java
src/jalview/gui/PymolViewer.java
src/jalview/structure/StructureSelectionManager.java

index 26bcecc..ebacc79 100644 (file)
@@ -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);
 
           }
index 2e91b3d..55a6ea5 100644 (file)
@@ -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());
 
index 52c253d..883373a 100644 (file)
@@ -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());
index 9a9e2a2..e65f6cb 100644 (file)
@@ -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.