From: gmungoc Date: Mon, 16 Mar 2020 13:47:34 +0000 (+0000) Subject: JAL-3551 tidying, improved commands, fix Jmol model number derivation X-Git-Tag: Release_2_11_2_0~37^2~23 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=28f21e26830c0df0529e74f8de1019476eaca7bf;p=jalview.git JAL-3551 tidying, improved commands, fix Jmol model number derivation --- diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 844fb1b..4c19f6e 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -957,7 +957,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel { if (modelFileNames[i].equalsIgnoreCase(pdbFile)) { - return String.valueOf(i); + return String.valueOf(i + 1); } } return ""; diff --git a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java index 7e04f39..c355abe 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java @@ -52,12 +52,13 @@ import java.util.Map; */ public class ChimeraCommands extends StructureCommandsBase { - private static final StructureCommand SHOW_BACKBONE = new StructureCommand("~display all;chain @CA|P"); + private static final StructureCommand SHOW_BACKBONE = new StructureCommand( + "~display all;~ribbon;chain @CA|P"); public static final String NAMESPACE_PREFIX = "jv_"; private static final StructureCommandI COLOUR_BY_CHARGE = new StructureCommand( - "color white;color red ::ASP;color red ::GLU;color blue ::LYS;color blue ::ARG;color yellow ::CYS"); + "color white;color red ::ASP,GLU;color blue ::LYS,ARG;color yellow ::CYS"); private static final StructureCommandI COLOUR_BY_CHAIN = new StructureCommand( "rainbow chain"); @@ -508,25 +509,27 @@ public class ChimeraCommands extends StructureCommandsBase } @Override - public List superposeStructures(AtomSpecModel spec, - AtomSpecModel ref) + public List superposeStructures(AtomSpecModel ref, + AtomSpecModel spec) { /* * Form Chimera match command to match spec to ref + * (the first set of atoms are moved on to the second) * * match #1:1-30.B,81-100.B@CA #0:21-40.A,61-90.A@CA * - * @see - * https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/match.html + * @see https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/match.html */ StringBuilder cmd = new StringBuilder(); - String atomSpec = getAtomSpec(spec, true); - String refSpec = getAtomSpec(ref, true); - cmd.append("match ").append(atomSpec).append(" ").append(refSpec); + String atomSpecAlphaOnly = getAtomSpec(spec, true); + String refSpecAlphaOnly = getAtomSpec(ref, true); + cmd.append("match ").append(atomSpecAlphaOnly).append(" ").append(refSpecAlphaOnly); /* * show superposed residues as ribbon */ + String atomSpec = getAtomSpec(spec, false); + String refSpec = getAtomSpec(ref, false); cmd.append("; ribbon "); cmd.append(atomSpec).append("|").append(refSpec).append("; focus"); @@ -621,7 +624,8 @@ public class ChimeraCommands extends StructureCommandsBase * restrict to alpha carbon, no alternative locations * (needed to ensuring matching atom counts for superposition) */ - sb.append("@CA|P").append(NO_ALTLOCS); + // TODO @P instead if RNA - add nucleotide flag to AtomSpecModel? + sb.append("@CA").append(NO_ALTLOCS); } } diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java index 9636a6a..3341199 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java @@ -35,7 +35,7 @@ import java.util.List; public class ChimeraXCommands extends ChimeraCommands { private static final StructureCommand SHOW_BACKBONE = new StructureCommand( - "~display all;show @CA|P pbonds"); + "~display all;~ribbon;show @CA|P atoms"); private static final StructureCommand FOCUS_VIEW = new StructureCommand( "view"); @@ -150,7 +150,8 @@ public class ChimeraXCommands extends ChimeraCommands appendModel(sb, model, atomSpec); if (alphaOnly) { - sb.append("@CA|P"); + // TODO @P if RNA - add nucleotide flag to AtomSpecModel? + sb.append("@CA"); } // todo: is there ChimeraX syntax to exclude altlocs? } @@ -195,16 +196,15 @@ public class ChimeraXCommands extends ChimeraCommands } @Override - public List superposeStructures(AtomSpecModel spec, - AtomSpecModel ref) + public List superposeStructures(AtomSpecModel ref, + AtomSpecModel spec) { /* * Form ChimeraX match command to match spec to ref * * match #1/A:2-94 toAtoms #2/A:1-93 * - * @see - * https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/match.html + * @see https://www.cgl.ucsf.edu/chimerax/docs/user/commands/align.html */ StringBuilder cmd = new StringBuilder(); String atomSpec = getAtomSpec(spec, true); diff --git a/src/jalview/gui/ChimeraXViewFrame.java b/src/jalview/gui/ChimeraXViewFrame.java index b33ccd6..56b2fe1 100644 --- a/src/jalview/gui/ChimeraXViewFrame.java +++ b/src/jalview/gui/ChimeraXViewFrame.java @@ -47,4 +47,12 @@ public class ChimeraXViewFrame extends ChimeraViewFrame ap.getStructureSelectionManager(), pdbentrys, seqs, null); } + @Override + protected void initMenus() + { + super.initMenus(); + + viewerActionMenu.setText("ChimeraX"); + } + } diff --git a/src/jalview/gui/PymolViewer.java b/src/jalview/gui/PymolViewer.java index 09451be..8f7f2c1 100644 --- a/src/jalview/gui/PymolViewer.java +++ b/src/jalview/gui/PymolViewer.java @@ -73,6 +73,8 @@ public class PymolViewer extends StructureViewerBase binding.setColourBySequence(true); setSize(myWidth, myHeight); initMenus(); + viewerActionMenu.setText("PyMOL"); + updateTitleAndMenus(); addingStructures = false; worker = new Thread(this); diff --git a/src/jalview/structure/StructureCommandsI.java b/src/jalview/structure/StructureCommandsI.java index 0934488..8725b3d 100644 --- a/src/jalview/structure/StructureCommandsI.java +++ b/src/jalview/structure/StructureCommandsI.java @@ -97,9 +97,9 @@ public interface StructureCommandsI /** * Returns a command to superpose structures by closest positioning of - * residues in {@code atomSpec} to the corresponding residues in {@ refAtoms}. - * If wanted, this may include commands to visually highlight the residues - * that were used for the superposition. + * residues in {@code atomSpec} to the corresponding residues in + * {@code refAtoms}. If wanted, this may include commands to visually + * highlight the residues that were used for the superposition. * * @param refAtoms * @param atomSpec diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index 8d8957c..db523f9 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -913,8 +913,7 @@ public abstract class AAStructureBindingModel { AtomSpecModel atomSpec = getAtomSpec(structures[i], matched); List commands = commandGenerator - .superposeStructures(refAtoms, - atomSpec); + .superposeStructures(refAtoms, atomSpec); List replies = executeCommands(commands, true, null); for (String reply : replies) {