From 0b6e9403e96ee9f0d41211b2f90130ff850c4e98 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 15 Feb 2022 16:47:32 +0000 Subject: [PATCH] JAL-1761 need to pass molecule type when generating superposition commands --- src/jalview/ext/jmol/JmolCommands.java | 2 +- src/jalview/ext/pymol/PymolCommands.java | 2 +- src/jalview/ext/rbvi/chimera/ChimeraCommands.java | 2 +- src/jalview/ext/rbvi/chimera/ChimeraXCommands.java | 2 +- src/jalview/structure/StructureCommandsI.java | 4 +++- .../structures/models/AAStructureBindingModel.java | 13 ++++++++++--- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/jalview/ext/jmol/JmolCommands.java b/src/jalview/ext/jmol/JmolCommands.java index 25f6aec..3a66349 100644 --- a/src/jalview/ext/jmol/JmolCommands.java +++ b/src/jalview/ext/jmol/JmolCommands.java @@ -178,7 +178,7 @@ public class JmolCommands extends StructureCommandsBase */ @Override public List superposeStructures(AtomSpecModel refAtoms, - AtomSpecModel atomSpec) + AtomSpecModel atomSpec, boolean isNucleotide) { StringBuilder sb = new StringBuilder(64); String refModel = refAtoms.getModels().iterator().next(); diff --git a/src/jalview/ext/pymol/PymolCommands.java b/src/jalview/ext/pymol/PymolCommands.java index 652682a..ae91aa5 100644 --- a/src/jalview/ext/pymol/PymolCommands.java +++ b/src/jalview/ext/pymol/PymolCommands.java @@ -106,7 +106,7 @@ public class PymolCommands extends StructureCommandsBase @Override public List superposeStructures(AtomSpecModel refAtoms, - AtomSpecModel atomSpec) + AtomSpecModel atomSpec, boolean isNucleotide) { // https://pymolwiki.org/index.php/Super List commands = new ArrayList<>(); diff --git a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java index 02b7136..bfad8fb 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java @@ -259,7 +259,7 @@ public class ChimeraCommands extends StructureCommandsBase @Override public List superposeStructures(AtomSpecModel ref, - AtomSpecModel spec) + AtomSpecModel spec, boolean isNucleotide) { /* * Form Chimera match command to match spec to ref diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index 4e45ac8..74e7f08 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java @@ -213,7 +213,7 @@ public class ChimeraXCommands extends ChimeraCommands @Override public List superposeStructures(AtomSpecModel ref, - AtomSpecModel spec) + AtomSpecModel spec, boolean isNucleotide) { /* * Form ChimeraX match command to match spec to ref diff --git a/src/jalview/structure/StructureCommandsI.java b/src/jalview/structure/StructureCommandsI.java index 91e0494..734f275 100644 --- a/src/jalview/structure/StructureCommandsI.java +++ b/src/jalview/structure/StructureCommandsI.java @@ -86,10 +86,12 @@ public interface StructureCommandsI * * @param refAtoms * @param atomSpec + * @param isNucleotide TODO + * @param nucleotide - when true, superposition is based on phoshpate backbone, not peptide * @return */ List superposeStructures(AtomSpecModel refAtoms, - AtomSpecModel atomSpec); + AtomSpecModel atomSpec, boolean isNucleotide); /** * Returns a command to open a file of commands at the given path diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index 3414e95..336c6f8 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -91,6 +91,9 @@ public abstract class AAStructureBindingModel public String chain = ""; + /** + * is the mapped sequence not protein ? + */ public boolean isRna; /* @@ -167,6 +170,9 @@ public abstract class AAStructureBindingModel protected boolean colourBySequence = true; + /** + * true if all sequences appear to be nucleotide + */ private boolean nucleotide; private boolean finishedInit = false; @@ -716,7 +722,7 @@ public abstract class AAStructureBindingModel structures[pdbfnum].chain = chain; } structures[pdbfnum].pdbId = mapping.getPdbId(); - structures[pdbfnum].isRna = theSequence.getRNA() != null; + structures[pdbfnum].isRna = !theSequence.isProtein(); /* * move on to next pdb file (ignore sequences for other chains @@ -918,7 +924,8 @@ public abstract class AAStructureBindingModel */ // todo better way to ensure synchronous than setting getReply true!! executeCommands(commandGenerator.showBackbone(), true, null); - + + boolean isNucleotide = structures[refStructure].isRna; /* * superpose each (other) structure to the reference in turn */ @@ -928,7 +935,7 @@ public abstract class AAStructureBindingModel { AtomSpecModel atomSpec = getAtomSpec(structures[i], matched); List commands = commandGenerator - .superposeStructures(refAtoms, atomSpec); + .superposeStructures(refAtoms, atomSpec,isNucleotide); List replies = executeCommands(commands, true, null); for (String reply : replies) { -- 1.7.10.2