From: gmungoc Date: Fri, 14 Nov 2014 12:53:45 +0000 (+0000) Subject: JAL-1528 Chimera Help doc + fixes to setting colours X-Git-Tag: Release_2_8_2b1^2~33^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cedd8bb81245ba719e6d54688d763e341b3cc695;p=jalview.git JAL-1528 Chimera Help doc + fixes to setting colours --- diff --git a/help/help.jhm b/help/help.jhm index 7750265..c6cc626 100755 --- a/help/help.jhm +++ b/help/help.jhm @@ -52,6 +52,7 @@ + diff --git a/help/helpTOC.xml b/help/helpTOC.xml index 4c09e8f..6ae5c78 100755 --- a/help/helpTOC.xml +++ b/help/helpTOC.xml @@ -106,6 +106,7 @@ + diff --git a/help/html/features/chimera.html b/help/html/features/chimera.html new file mode 100644 index 0000000..e866597 --- /dev/null +++ b/help/html/features/chimera.html @@ -0,0 +1,172 @@ + + + +The Chimera PDB Viewer + + +

The Chimera Viewer

+

Since Jalview 2.8.2, Chimera +has been integrated into Jalview for interactively viewing structures +opened by entries in the "Structure" submenu in the sequence +id pop-up menu (if you can't see this, then you need to associate a PDB structure with the +sequence). Chimera is available from the Jalview desktop, provided Chimera has been separately installed.

+

You can set a default choice of Jmol or Chimera structure viewer in Preferences. +You can also optionally specify the path to the Chimera program here (if it differs from the standard paths searched by Jalview). +

The following menu entries are provided for viewing structure data
+

    +
  • The "Structure→View + Structure→ submenu allows a single PDB structure to be chosen + for display from the available structures for a sequence. +
  • +
  • The "Structure→View all N + structures + option will open a new window containing all structures associated + with the current selection. +
  • +
  • The "Structure→View all N + representative structures + option will open a new window containing exactly one structure per + currently selected sequence.
  • +
+
+

+

Superposing structures based +on their aligned sequences
+

If several structures are available on the alignment, you may add +additional structures to an existing Chimera view by selecting their entry +in the appropriate pop-up menu. Jalview will ask you if you wish to add +the structure to the existing alignment, and if you do, it will import +and superimpose the new PDB file using the corresponding positions from +the alignment. If the alignment is subsequently edited, you can use the +Chimera→Align menu option from the +menu bar of the structure view window to superpose the structures using +the updated alignment.
+

+

Chimera Controls
+

The structure is by default rendered as a ribbon diagram. Moving the +mouse over the structure brings up tooltips giving the residue name, PDB +residue number and chain code +([RES]Num:Chain). Moving the mouse over an +associated residue in an alignment window highlights the associated +atoms in the displayed structures. For comprehensive details of Chimera's commands, refer to the tool's Help menu.

+

Basic screen operations (see Chimera help for full details). + + + + + + + + + + + + + + + + + + + + + + + + +
ActionWindowsUnixMac/OSX
Rotate ViewLeft Click and DragLeft Click and DragLeft Click and Drag
ZoomRight Click
+ drag mouse up or down
Right Click
drag mouse up or down
cmd or Right + Click and drag mouse up or down,
or use mouse scroll button
Move OriginMiddle Button + DragMiddle Button and dragalt + Click
+ and drag
+

+

Jalview Controls +

The Jalview Chimera View window has up to five menus: +

    +
  • File
    +
    +
      +
    • View Mapping
      +
      Opens a text window showing the alignment between the + residues corresponding to alpha-carbon atoms in the PDB structure and + the residues in the associated sequence.
    • +
    +
  • +
  • View +
      +
    • Show Chains
      +
      Select which of the PDB file's chains (if more than one) are to be displayed.
    • +
    • Colour by ..
      Submenu allowing specific alignment views to be selected for colouring associated chains in the structure display. This menu contains all the alignment views associated with the structure view, with those used to colour the view indicated by ticks. Addditionally, it contains the following menu entries: +
      • Select many views
        When this option is enabled, selecting an alignment view adds it to the set used to colour the structures. Use this when colouring structures related to a number of alignments involving different domains or chains which are shown in the same structure view. +
      • +
      • Select all views
        This is only enabled when Select many views is also enabled, and will add all associated views to the set used to colour the structure display. +
      • +
      • Invert selection
        This is only enabled when Select many views is also enabled, and will replace the current set of views with any remaining views not currently used to colour the structure display. +
    +
  • Colours
    +
    +
      +
    • By Sequence
      +
      Colours each residue in the structure with the colour of its + corresponding residue in the associated sequence as rendered in the + associated alignment views, including any Uniprot sequence features or + region colourings.
      Pick which of the associated alignment views are used to colour the structures using the View→Colour by .. sub menu.

      + Residues which only exist in the PDB structure are coloured white if + they are insertions (relative to the associated sequence in the + alignment) and grey if they are N or C terminal flanks outside the + region mapped to the alignment window's sequence.
    • +
    • Charge & Cysteine
      +
      Highlights cysteines in yellow, anionic (Aspartic Acid or + Glutamic Acid) residues in red, and cationic (Lysine or Arginine) + residues in blue.
    • +
    • Colour with Chimera
      Defers any colouring operations to Chimera. Select this if you want to use the + Chimera scripting interface or menu to modify the view directly.
    • +
    • Standard and User Defined Jalview + colourschemes.
      +
      The remaining entries apply the colourschemes available from + the standard and user defined amino + acid colours.
    • +
    +
  • +
  • Chimera
    +
    This pulldown menu is only displayed if there are multiple + structures shown in the Chimera window, and Jalview can also locate at + least two of the structures in the currently associated alignment view. +
      +
    • Align
      +
      When selected, the associated alignment will be used to + superimpose all the structures in the view onto the first structure in + the alignment. The regions used to calculate the superposition will be + highlighted using the 'Cartoon' rendering style, and the remaining + data shown as a chain trace.
    • +
    +
  • +
  • Help
    +
    +
      +
    • Chimera Help
      +
      Access the Chimera Help documentation in a new browser window.
    • +
    +
  • +
+

+ + diff --git a/help/html/features/jmol.html b/help/html/features/jmol.html index 5102679..45e5526 100644 --- a/help/html/features/jmol.html +++ b/help/html/features/jmol.html @@ -79,7 +79,7 @@ atoms in the displayed structures.

and alpha carbon location. Double clicking an atom allows distances to be measured from it to any other atom in the structure.

- +
@@ -162,7 +162,7 @@ be measured from it to any other atom in the structure.

  • Select all views
    This is only enabled when Select many views is also enabled, and will add all associated views to the set used to colour the structure display.
  • Invert selection
    This is only enabled when Select many views is also enabled, and will replace the current set of views with any remaining views not currently used to colour the structure display. -
  • +
  • Colours
      diff --git a/help/html/features/preferences.html b/help/html/features/preferences.html index 1831c3e..b2d8b93 100755 --- a/help/html/features/preferences.html +++ b/help/html/features/preferences.html @@ -121,6 +121,8 @@ annotation will be shown on the alignment when available.

      Add Temperature Factor annotation to alignment - if selected, PDB Temperature Factor annotation will be shown on the alignment when available.

      Default structure viewer - choose JMOL or CHIMERA for viewing 3D structures. +

      Path to Chimera program - Optional, as Jalview will search standard installation paths for Windows, Linux or MacOS. +If you have installed Chimera in a non-standard location, you can specify it here. Enter the full path to the Chimera executable program.

      "Connections" Preferences tab

      diff --git a/help/html/features/viewingpdbs.html b/help/html/features/viewingpdbs.html index 1f49498..8fc557e 100755 --- a/help/html/features/viewingpdbs.html +++ b/help/html/features/viewingpdbs.html @@ -28,6 +28,9 @@

      Jalview can view protein structures associated with a sequence via the "Structure→" submenu from a sequence's pop-up menu.

      +A Jmol viewer has been included since Jalview 2.3. Jalview 2.8.2 added support for Chimera, +provided this has been separately installed. Choice of default viewer is configurable in the Preferences Structure tab. +

      The following menu entries are provided for viewing structure data

      -

      If a single pdb @@ -55,19 +57,19 @@ structure is selected, one of the following will happen:

      Associating PDB files with Sequences

      To associate PDB files with a sequence, right click on a sequence diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index 7033ba7..090b61d 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -74,13 +74,14 @@ public abstract class JalviewChimeraBinding extends private boolean loadingFromArchive = false; /** - * second flag to indicate if the jmol viewer should ignore sequence colouring - * events from the structure manager because the GUI is still setting up + * second flag to indicate if the Chimera viewer should ignore sequence + * colouring events from the structure manager because the GUI is still + * setting up */ private boolean loadingFinished = true; /** - * state flag used to check if the Jmol viewer's paint method can be called + * state flag used to check if the Chimera viewer's paint method can be called */ private boolean finishedInit = false; @@ -173,7 +174,7 @@ public abstract class JalviewChimeraBinding extends } catch (Error e) { } - // Explicitly map to the filename used by Jmol ; + // Explicitly map to the filename used by Chimera ; // pdbentry[pe].getFile(), protocol); if (ssm != null) @@ -236,13 +237,6 @@ public abstract class JalviewChimeraBinding extends } viewer = new ChimeraManager( csm = new ext.edu.ucsf.rbvi.strucviz2.StructureManager(true)); - /* - * viewer = JmolViewer.allocateViewer(renderPanel, new SmarterJmolAdapter(), - * "jalviewJmol", ap.av.applet .getDocumentBase(), - * ap.av.applet.getCodeBase(), "", this); - * - * jmolpopup = JmolPopup.newJmolPopup(viewer, true, "Jmol", true); - */ } public JalviewChimeraBinding(StructureSelectionManager ssm, @@ -335,15 +329,13 @@ public abstract class JalviewChimeraBinding extends { viewer.exitChimera(); } - // viewer.evalStringQuiet("zap"); - // viewer.setJmolStatusListener(null); lastCommand = null; viewer = null; releaseUIResources(); } /** - * called by JalviewJmolbinding after closeViewer is called - release any + * called by JalviewChimerabinding after closeViewer is called - release any * resources and references so they can be garbage collected. */ protected abstract void releaseUIResources(); @@ -351,17 +343,16 @@ public abstract class JalviewChimeraBinding extends public void colourByChain() { colourBySequence = false; - // TODO: colour by chain should colour each chain distinctly across all - // visible models - // TODO: http://issues.jalview.org/browse/JAL-628 + // this is not a valid Chimera command; is there one? Menu option hidden evalStateCommand("select *;color chain",false); } public void colourByCharge() { colourBySequence = false; - evalStateCommand("colour *;color white;select ASP,GLU;color red;" - + "select LYS,ARG;color blue;select CYS;color yellow", false); + evalStateCommand( + "color white;color red ::ASP;color red ::GLU;color blue ::LYS;color blue ::ARG;color yellow ::CYS", + false); } /** @@ -411,7 +402,7 @@ public abstract class JalviewChimeraBinding extends assert (_alignment.length == _refStructure.length && _alignment.length != _hiddenCols.length); StringBuilder allComs = new StringBuilder(128); // Chimera superposition cmd String[] files = getPdbFile(); - // check to see if we are still waiting for Jmol files + // check to see if we are still waiting for Chimera files long starttime = System.currentTimeMillis(); boolean waiting = true; do @@ -1225,10 +1216,13 @@ public abstract class JalviewChimeraBinding extends String res; int index; Color col; + // Chimera expects RBG values in the range 0-1 + final double normalise = 255D; viewerCommandHistory(false); // TODO: Switch between nucleotide or aa selection expressions Enumeration en = ResidueProperties.aa3Hash.keys(); - StringBuffer command = new StringBuffer("select *;color white;"); + StringBuilder command = new StringBuilder(128); + command.append("color white;"); while (en.hasMoreElements()) { res = en.nextElement().toString(); @@ -1239,32 +1233,19 @@ public abstract class JalviewChimeraBinding extends } col = cs.findColour(ResidueProperties.aa[index].charAt(0)); - // TODO: need colour string function and res selection here - command.append("select " + res + ";color[" + col.getRed() + "," - + col.getGreen() + "," + col.getBlue() + "];"); + command.append("color " + col.getRed() / normalise + "," + + col.getGreen() / normalise + "," + col.getBlue() + / normalise + " ::" + res + ";"); } evalStateCommand(command.toString(),false); viewerCommandHistory(true); } - public void showHelp() - { - // chimera help - showUrl("http://jmol.sourceforge.net/docs/JmolUserGuide/", "jmolHelp"); - } - /** - * open the URL somehow - * - * @param target - */ - public abstract void showUrl(String url, String target); - - /** - * called when the binding thinks the UI needs to be refreshed after a Jmol + * called when the binding thinks the UI needs to be refreshed after a Chimera * state change. this could be because structures were loaded, or because an - * error has occured. + * error has occurred. */ public abstract void refreshGUI(); @@ -1293,8 +1274,8 @@ public abstract class JalviewChimeraBinding extends /** * - * @return true if Jmol is still restoring state or loading is still going on - * (see setFinsihedLoadingFromArchive) + * @return true if Chimeral is still restoring state or loading is still going + * on (see setFinsihedLoadingFromArchive) */ public boolean isLoadingFromArchive() { @@ -1312,13 +1293,22 @@ public abstract class JalviewChimeraBinding extends loadingFinished = finishedLoading; } - public void setBackgroundColour(java.awt.Color col) + /** + * Send the Chimera 'background solid " command. + * + * @see https + * ://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/background + * .html + * @param col + */ + public void setBackgroundColour(Color col) { viewerCommandHistory(false); - // todo set background colour - viewer.sendChimeraCommand( - "background [" + col.getRed() + "," + col.getGreen() + "," - + col.getBlue() + "];", false); + double normalise = 255D; + final String command = "background solid " + col.getRed() / normalise + "," + + col.getGreen() / normalise + "," + col.getBlue() + / normalise + ";"; + viewer.sendChimeraCommand(command, false); viewerCommandHistory(true); } diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index 3c53762..cfac4ef 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -144,6 +144,12 @@ public class ChimeraViewFrame extends GStructureViewer implements Runnable, _alignwith = new Vector(); } + // no colour by chain command in Chimera? + chainColour.setVisible(false); + + // save As not yet implemented + savemenu.setVisible(false); + ViewSelectionMenu seqColourBy = new ViewSelectionMenu( MessageManager.getString("label.colour_by"), this, _colourwith, new ItemListener() diff --git a/src/jalview/gui/JalviewChimeraBindingModel.java b/src/jalview/gui/JalviewChimeraBindingModel.java index c582c5d..f68b585 100644 --- a/src/jalview/gui/JalviewChimeraBindingModel.java +++ b/src/jalview/gui/JalviewChimeraBindingModel.java @@ -94,11 +94,4 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding // TODO Auto-generated method stub } - - @Override - public void showUrl(String url, String target) - { - // TODO Auto-generated method stub - - } } diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java index 7e1be58..58b2eb1 100644 --- a/src/jalview/jbgui/GStructureViewer.java +++ b/src/jalview/jbgui/GStructureViewer.java @@ -283,7 +283,7 @@ public class GStructureViewer extends JInternalFrame JMenu fileMenu = new JMenu(); - JMenu savemenu = new JMenu(); + protected JMenu savemenu = new JMenu(); JMenuItem pdbFile = new JMenuItem();

  • Action Windows