Difference between revisions of "Mouse Manual"
AngelHerraez (talk | contribs) |
(→Whole-molecule atom shifting and rotation on touch-only interfaces) |
||
(26 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{Tutorials_Sections}} | {{Tutorials_Sections}} | ||
{{Lang:Mouse_Manual}} | {{Lang:Mouse_Manual}} | ||
− | + | {{clear}} | |
== Manual for manipulating the molecules using the mouse in Jmol (also called 'mouse gestures') == | == Manual for manipulating the molecules using the mouse in Jmol (also called 'mouse gestures') == | ||
Line 140: | Line 140: | ||
<br /> | <br /> | ||
+ | |||
+ | To toggle the selection status of individual atoms:<br> | ||
+ | Using the menus: | ||
+ | <ol> | ||
+ | <li>Jmol->Main Menu->Select->Selection Halos (This is optional but very helpful. It shows you which atoms are selected by plaing a golden ring around it.) | ||
+ | <li>Jmol->Main Menu->Select->None (Needed because "select all" is the default at load time. Notice the non-zero number in parenthesis after the word select in the main menu. That is the number of items currently selected. | ||
+ | <li>Jmol->Main Menu->Set picking->Select Atom | ||
+ | </ol> | ||
+ | Now click an atom once to select, click again to deselect. | ||
+ | The halos let me know the current selection state of each atom | ||
+ | and the count in parenthesis after the Select in Jmol->Main Menu | ||
+ | gives me a count of the number of atoms selected. | ||
+ | |||
== How to make measurements == | == How to make measurements == | ||
Line 158: | Line 171: | ||
** move outside the window in order to cancel the measurement | ** move outside the window in order to cancel the measurement | ||
** make the same measurement again in order to delete the measurement | ** make the same measurement again in order to delete the measurement | ||
+ | |||
+ | == How to change atom coordinates == | ||
+ | This section describes how to set up a Jmol applet or application so that users can move individual atoms within a model | ||
+ | with the mouse. | ||
+ | |||
+ | By default, mouse-based transformations such as rotations and translations are applied to all atoms identically. All that is happening is that the view ("the tranformation matrix, ('''show transform''')" is modified; the stored coordinates of the atoms are not changed. But Jmol can also be configured to allow users to move specific atoms or sets of atoms and store the changed coordinates permanently. | ||
+ | |||
+ | In situations where it is desired to allow users to change atom coordinates using the mouse, certain settings must be made. This section summarizes the rather complex mix of possible settings and some of the standard combinations that are particularly useful | ||
+ | |||
+ | === Default settings === | ||
+ | |||
+ | The five settings involved and their default values are given below. | ||
+ | |||
+ | [{{ScriptingDoc}}#setpicking set picking identify] | ||
+ | |||
+ | [{{ScriptingDoc}}#setpickingstyle set pickingStyle toggle] | ||
+ | |||
+ | [{{ScriptingDoc}}#set_dragselected set dragSelected false] | ||
+ | |||
+ | [{{ScriptingDoc}}#set_allowrotateselected set allowRotateSelected false] | ||
+ | |||
+ | [{{ScriptingDoc}}#set_allowmoveatoms set allowMoveAtoms false]; | ||
+ | |||
+ | The names of these settings are not necessarily self-explanatory. '''set picking identify''' just means that when an atom is clicked, a message is posted to the Jmol console indicating the identity of the atom picked. '''set pickingStyle toggle''' specifies the overall standard Jmol mouse bindings (but see below for a "drag" option); '''set dragSelected false''' species, within that framework, what is to happen with simple left-mouse dragging. The two '''alllow...''' settings allow restricting atom motion in ways described below. | ||
+ | |||
+ | === Allowing whole-molecule atom shifting and rotation === | ||
+ | |||
+ | A common need is to enable users to translate and rotate whole molecules just by clicking on them and dragging. In this way, all intramolecular relationships remain the same, and bonds are not destroyed. This is enabled using | ||
+ | |||
+ | '''set picking dragMolecule''' | ||
+ | |||
+ | The standard Jmol mouse operations are still present when the mouse is pressed off the structure, but when it is pressed on an atom, then left-drag moves that specific molecule, and alt-drag rotates that molecule around its center of geometry. | ||
+ | |||
+ | === Whole-molecule atom shifting and rotation on touch-only interfaces === | ||
+ | |||
+ | If it is desired to have an interface where users do not need to use ALT (for example, mobile touch-only interfaces such as tablets and smartphones), you will need to provide three buttons that toggle among modes. This requires use of the | ||
+ | [{{ScriptingDoc}}#bind bind] and | ||
+ | [{{ScriptingDoc}}#bind unbind] | ||
+ | commands, which modify how mouse actions are bound to Jmol actions. | ||
+ | This can be accomplished as follows. | ||
+ | |||
+ | Button 1 (reset): | ||
+ | |||
+ | script: '''unbind; set picking identify''' | ||
+ | |||
+ | Button 2 (translate molecule): | ||
+ | |||
+ | script '''unbind;set picking dragMolecule''' | ||
+ | |||
+ | Button 3 (rotate molecule): | ||
+ | |||
+ | script: '''set picking dragMolecule; set allowrotateselected; unbind "_dragAtom"; unbind "_rotateSelected"; bind "left+drag" _rotateSelected''' | ||
+ | |||
+ | Notice that what we are doing here is | ||
+ | |||
+ | # removing Jmol's _dragAtom binding, which is left-drag for the dragMolecule picking mode | ||
+ | # replacing the alt-left-drag binding for _rotateSelected with a simple left-drag | ||
+ | |||
+ | === Allowing moving and rotating of specific atoms === | ||
+ | |||
+ | It is not always desired to restrict atom coordinate changes to whole molecules (for example, when proteins with associated water molecules are involved.) But then we need some indication of which atoms are to be moved. This is done by a number of possible means. | ||
+ | |||
+ | '''selected atoms''' Perhaps the simplest is to use the currently selected atom set. This is done by adding '''set allowMoveAtoms true'''. | ||
+ | |||
+ | [Note: a design flaw and associated bug in Jmol prior to 14.3.13 results in the odd behavior that setting '''allowMoveAtoms''' surreptitiously also sets both '''dragSelected''' and '''allowRotateSelected''' to the same values internally (the design flaw) ''without indicating that'' (the bug). This has been very confusing and is fixed for future versions.] | ||
+ | |||
+ | |||
+ | === Additional options === | ||
+ | |||
+ | The table below summarizes additional options that involve how atoms are selected using special mouse settings. The following two settings are assumed: | ||
+ | |||
+ | '''set allowMoveAtoms TRUE''' | ||
+ | |||
+ | '''set allowRotateSelected TRUE''' | ||
+ | |||
+ | There are additional switches available that influence what can be done and how it can be done. Unless otherwise specified, their values are: | ||
+ | # [{{ScriptingDoc}}#setpicking set picking IDENTIFY] | ||
+ | # [{{ScriptingDoc}}#setpickingstyle set pickingStyle TOGGLE] | ||
+ | # [{{ScriptingDoc}}#set_dragselected set dragSelected FALSE] | ||
+ | |||
+ | The table below summarizes information for three of the possible | ||
+ | setting combinations (tested in Jmol 14.3.13). | ||
+ | |||
+ | <table style="margin-left: 1.2em; margin-top: 0.8em;"> | ||
+ | <tr> | ||
+ | <th></th> | ||
+ | <th colspan="9" style="background-color: rgb(245,235,210); text-align: left; padding:0.4em;">Basic options: | ||
+ | <ul style="margin: 0.5em;"> | ||
+ | <li>'''set allowMoveAtoms TRUE'''</li> | ||
+ | <li>'''set allowRotateSelected TRUE'''</li> | ||
+ | </ul> | ||
+ | Helpful option: | ||
+ | <ul style="margin: 0.5em;"> | ||
+ | <li>[{{ScriptingDoc}}#selectionhalos selectionHalos ON]</li> | ||
+ | </ul> | ||
+ | </th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th></th> | ||
+ | <th colspan="3" style="background-color: rgb(240,240,240); text-align: left; padding:0.4em;" valign="top">Option 1: Allows changing coordinates | ||
+ | |||
+ | <ul style="margin: 0.5em;"> | ||
+ | <li>'''set picking dragSelected'''</li> | ||
+ | </ul> | ||
+ | <br><br><b> | ||
+ | Selecting atoms: no mouse binding | ||
+ | <br><br> | ||
+ | Changing Coordinates: move and rotate selected atoms | ||
+ | <br><br></b> | ||
+ | When the mouse is not over the structure, acts the same as Jmol defaults; when it is over the structure, | ||
+ | binds drag, alt-drag, and shift-drag with movement in the plane of the screen, rotation, and movement perpendicular to the screen, respectively. | ||
+ | |||
+ | </th> | ||
+ | <th colspan="3" style="background-color: rgb(220,200,190); text-align: left; padding:0.4em;" valign="top">Option 2: Allows picking by dragging as well as changing coordinates | ||
+ | |||
+ | <ul style="margin: 0.5em;"> | ||
+ | <li>'''set pickingStyle select drag'''</li> | ||
+ | <li>'''set picking dragSelected'''</li> | ||
+ | </ul> | ||
+ | <br><b> | ||
+ | Selecting atoms: alt/shift-drag to select a box of atoms | ||
+ | <br><br> | ||
+ | Changing Coordinates: drag to move atoms; no rotation | ||
+ | <br><br></b> | ||
+ | |||
+ | Selecting atoms: Binds shift-drag and alt-shift drag to "add to selection" and "remove from selection", respectively, and shift-drag to "add or toggle." Moving atoms: When the mouse is not over the structure, drag changes orientation in a standard Jmol way; when the mouse is over the structure, binds drag to "drag the structure" thus changing coordinates. Does not implement rotate. | ||
+ | |||
+ | </th> | ||
+ | <th colspan="3" style="background-color: rgb(180,245,220); text-align: left; padding:0.4em;" valign="top">Option 3: Allows picking by clicking as well as changing coordinates | ||
+ | <ul style="margin: 0.5em;"> | ||
+ | <li>'''set picking ATOM'''</li> | ||
+ | <li>'''set dragSelected TRUE'''</li> | ||
+ | </ul> | ||
+ | <br><b> | ||
+ | Selecting atoms: click/double-click to select | ||
+ | <br><br> | ||
+ | Changing Coordinates: alt/shift-drag to rotate/move | ||
+ | <br><br></b> | ||
+ | Selecting atoms: Clicking on an atom (or group, or chain, etc., based on <b>set picking</b> option) toggles its selection on or off; double-clicking selects this item and deselects all others. Binds alt-drag to rotate and alt-shift-drag to move atoms. | ||
+ | </th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th></th> | ||
+ | <th style="background-color: rgb(220,220,220); text-align: left; padding: 0.4em;">Click Type</th> | ||
+ | <th style="background-color: rgb(220,220,220); text-align: left; padding: 0.4em;">Click Target</th> | ||
+ | <th style="background-color: rgb(220,220,220); text-align: left; padding: 0.4em;">Comment</th> | ||
+ | <th style="background-color: rgb(200,185,175); text-align: left; padding: 0.4em;">Click Type</th> | ||
+ | <th style="background-color: rgb(200,185,175); text-align: left; padding: 0.4em;">Click Target</th> | ||
+ | <th style="background-color: rgb(200,185,175); text-align: left; padding: 0.4em;">Comment</th> | ||
+ | <th style="background-color: rgb(170,230,205); text-align: left; padding: 0.4em;">Click Type</th> | ||
+ | <th style="background-color: rgb(170,230,205); text-align: left; padding: 0.4em;">Click Target</th> | ||
+ | <th style="background-color: rgb(170,230,205); text-align: left; padding: 0.4em;">Comment</th> | ||
+ | |||
+ | <tr> | ||
+ | <th colspan="10" style="background-color: rgb(220,230,180); | ||
+ | text-align: left; padding:0.4em;">Atom Movement (only selected atoms)</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th style="background-color: rgb(235,245,190); text-align: left; padding:0.4em;">x/y-shift<br>(along screen axes)</th> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;">drag</td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: | ||
+ | 0.4em;">any atom</td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">drag</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: | ||
+ | 0.4em;">any atom</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">shift-alt-drag</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">anywhere</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th style="background-color: rgb(235,245,190); text-align: left; padding:0.4em;">z-shift<br>(perpendicular to screen)</th> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;">shift-drag</td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;">any atom</td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">not available</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">not available</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th style="background-color: rgb(235,245,190); text-align: left; padding:0.4em;">rotate</th> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;">alt-drag</td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;">any atom</td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">not available</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">alt-drag</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">anywhere</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th colspan="10" style="background-color: rgb(220,230,180); | ||
+ | text-align: left; padding:0.4em;">Atom Selection</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th rowspan="2" style="background-color: rgb(235,245,190); text-align: left; padding:0.4em;">select a single atom</th> | ||
+ | <td rowspan="2" style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td rowspan="2" style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td rowspan="2" style="background-color: rgb(235,235,235); padding: 0.4em;">not available</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">shift-drag</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: | ||
+ | 0.4em;">around an unselected atom</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">click</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: | ||
+ | 0.4em;">an unselected atom</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | </tr> | ||
+ | |||
+ | <tr> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">alt-drag</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: | ||
+ | 0.4em;">around an atom</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">double-click</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: | ||
+ | 0.4em;">an atom</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: | ||
+ | 0.4em;">other atoms are deselected</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th style="background-color: rgb(235,245,190); text-align: left; padding:0.4em;">deselect a single atom</th> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;">not available</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">shift-drag</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: | ||
+ | 0.4em;">around a selected atom</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">click</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: | ||
+ | 0.4em;">a selected atom</td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th rowspan="2" style="background-color: rgb(235,245,190); text-align: left; padding:0.4em;">select multiple atoms</th> | ||
+ | <td rowspan="2" style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td rowspan="2" style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td rowspan="2" style="background-color: rgb(235,235,235); padding: 0.4em;">not available</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">shift-drag</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: | ||
+ | 0.4em;">around unselected atoms</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td rowspan="2" style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | <td rowspan="2" style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | <td rowspan="2" style="background-color: rgb(180,245,220); padding: 0.4em;">not available</td> | ||
+ | </tr> | ||
+ | |||
+ | <tr> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">alt-drag</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: | ||
+ | 0.4em;">around atoms</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | </tr> | ||
+ | |||
+ | <tr> | ||
+ | <th style="background-color: rgb(235,245,190); text-align: left; padding:0.4em;">deselect multiple atoms</th> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(235,235,235); padding: 0.4em;">not available</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;">shift-drag</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: | ||
+ | 0.4em;">around selected atoms</td> | ||
+ | <td style="background-color: rgb(220,200,190); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;"></td> | ||
+ | <td style="background-color: rgb(180,245,220); padding: 0.4em;">not available</td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th colspan="10" style="background-color: rgb(220,230,180); | ||
+ | text-align: left; padding:0.4em;">Summary</th> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <th></th> | ||
+ | <td colspan="3" style="background-color: rgb(235,235,235); text-align: left; padding:0.4em;"> | ||
+ | Option set 1 (+ basic options) totally disables mouse-based selection changes | ||
+ | and enables all three movement types (x/y-shift, z-shift, rotate). | ||
+ | </td> | ||
+ | <td colspan="3" style="background-color: rgb(220,200,190); text-align: left; padding:0.4em;"> | ||
+ | Option set 2 (+ basic options) enables mouse-based single/multiple atom | ||
+ | selection changes and enables only one movement type (x/y-shift). | ||
+ | </td> | ||
+ | <td colspan="3" style="background-color: rgb(180,245,220); text-align: left; padding:0.4em;"> | ||
+ | Option set 3 (+ basic options) enables mouse-based single atom selection | ||
+ | changes and enables two movement types (x/y-shift, rotate). | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> |
Latest revision as of 10:55, 8 May 2015
- A list of Jmol / JSmol Tutorials written by users.
- Using the mouse (English · Español · Français · Japanese).
- Scripting quickstart: rendering options · selecting atoms.
- How to create surfaces and isosurfaces, including cavities, pockets and tunnels.
- Displaying shapes, polyhedra, orbitals, dipoles, distances, forces and vibrations.
- Creating movies.
- Customizing Jmol: macros · menus.
- Web pages without writing code by using the Jmol "Export to Web" function.
Contents
Manual for manipulating the molecules using the mouse in Jmol (also called 'mouse gestures')
Notes:
- In the usual configuration, "main button" is the left button, and "secondary button" is the right button.
- Reportedly, on single-button mice Alt drag may be equivalent to drag with middle button.
main button | middle button | secondary button | |
(left) | (middle) | (right) | |
Open Jmol menu | Ctrl + click or click on 'Jmol' logo |
click | |
Rotate around X,Y | drag | ||
Move along X,Y (= translate) | Shift + double-click and drag | double-click and drag | Ctrl + drag |
works both when clicking on the molecule or away from it | |||
Reset and centre | Shift + double-click* | double-click* | |
*only works if double-click is done away from the molecule | |||
Rotate around Z | Shift + drag horizontally | drag horizontally | Shift + drag horizontally (possibly fails in Mac's) |
Zoom in / out | Shift + drag vertically | drag vertically | |
or use mouse wheel | |||
Implemented only on Jmol 10.00.22 prerelease and later: Only work after a slab on command has been issued |
|||
Slab (slab from front) | Ctrl+Shift + drag (vertically) * | ||
Depth (slab from back) | Ctrl+Shift + double-click and drag (vertically) * | ||
Shift the slab (change slab and depth maintaining constant thickness) | Alt+Ctrl+Shift + drag (vertically) * | ||
*if this fails on a Mac, try pressing the mouse button first, then the Ctrl Shift keys, then drag | |||
Slab can be tested in this page |
How to select
- Use the appropriate picking command, e.g.
set picking group
- to toggle selection for an entire amino acid by clicking on one of its atoms,
- Click on an atom will toggle selection status.
- Most useful while
set display selected
- is set to monitor the selection status.
To toggle the selection status of individual atoms:
Using the menus:
- Jmol->Main Menu->Select->Selection Halos (This is optional but very helpful. It shows you which atoms are selected by plaing a golden ring around it.)
- Jmol->Main Menu->Select->None (Needed because "select all" is the default at load time. Notice the non-zero number in parenthesis after the word select in the main menu. That is the number of items currently selected.
- Jmol->Main Menu->Set picking->Select Atom
Now click an atom once to select, click again to deselect. The halos let me know the current selection state of each atom and the count in parenthesis after the Select in Jmol->Main Menu gives me a count of the number of atoms selected.
How to make measurements
- Distance (2 atoms):
- double-click on the starting atom
- to fix a distance measurement, double-click on second atom
- Angle (3 atoms):
- double-click on the starting atom
- click on the second atom (central atom in angle)
- to fix an angle measurement, double-click on third atom
- Torsion angle or dihedral (4 atoms)
- double-click on the starting atom
- click on the second atom
- click on the third atom
- to fix a dihedral angle measurement, double-click on fourth atom
- In all cases:
- move pointer over destination atom in order to see measurement results without leaving a permanent measurement
- move outside the window in order to cancel the measurement
- make the same measurement again in order to delete the measurement
How to change atom coordinates
This section describes how to set up a Jmol applet or application so that users can move individual atoms within a model with the mouse.
By default, mouse-based transformations such as rotations and translations are applied to all atoms identically. All that is happening is that the view ("the tranformation matrix, (show transform)" is modified; the stored coordinates of the atoms are not changed. But Jmol can also be configured to allow users to move specific atoms or sets of atoms and store the changed coordinates permanently.
In situations where it is desired to allow users to change atom coordinates using the mouse, certain settings must be made. This section summarizes the rather complex mix of possible settings and some of the standard combinations that are particularly useful
Default settings
The five settings involved and their default values are given below.
The names of these settings are not necessarily self-explanatory. set picking identify just means that when an atom is clicked, a message is posted to the Jmol console indicating the identity of the atom picked. set pickingStyle toggle specifies the overall standard Jmol mouse bindings (but see below for a "drag" option); set dragSelected false species, within that framework, what is to happen with simple left-mouse dragging. The two alllow... settings allow restricting atom motion in ways described below.
Allowing whole-molecule atom shifting and rotation
A common need is to enable users to translate and rotate whole molecules just by clicking on them and dragging. In this way, all intramolecular relationships remain the same, and bonds are not destroyed. This is enabled using
set picking dragMolecule
The standard Jmol mouse operations are still present when the mouse is pressed off the structure, but when it is pressed on an atom, then left-drag moves that specific molecule, and alt-drag rotates that molecule around its center of geometry.
Whole-molecule atom shifting and rotation on touch-only interfaces
If it is desired to have an interface where users do not need to use ALT (for example, mobile touch-only interfaces such as tablets and smartphones), you will need to provide three buttons that toggle among modes. This requires use of the bind and unbind commands, which modify how mouse actions are bound to Jmol actions. This can be accomplished as follows.
Button 1 (reset):
script: unbind; set picking identify
Button 2 (translate molecule):
script unbind;set picking dragMolecule
Button 3 (rotate molecule):
script: set picking dragMolecule; set allowrotateselected; unbind "_dragAtom"; unbind "_rotateSelected"; bind "left+drag" _rotateSelected
Notice that what we are doing here is
- removing Jmol's _dragAtom binding, which is left-drag for the dragMolecule picking mode
- replacing the alt-left-drag binding for _rotateSelected with a simple left-drag
Allowing moving and rotating of specific atoms
It is not always desired to restrict atom coordinate changes to whole molecules (for example, when proteins with associated water molecules are involved.) But then we need some indication of which atoms are to be moved. This is done by a number of possible means.
selected atoms Perhaps the simplest is to use the currently selected atom set. This is done by adding set allowMoveAtoms true.
[Note: a design flaw and associated bug in Jmol prior to 14.3.13 results in the odd behavior that setting allowMoveAtoms surreptitiously also sets both dragSelected and allowRotateSelected to the same values internally (the design flaw) without indicating that (the bug). This has been very confusing and is fixed for future versions.]
Additional options
The table below summarizes additional options that involve how atoms are selected using special mouse settings. The following two settings are assumed:
set allowMoveAtoms TRUE
set allowRotateSelected TRUE
There are additional switches available that influence what can be done and how it can be done. Unless otherwise specified, their values are:
The table below summarizes information for three of the possible setting combinations (tested in Jmol 14.3.13).
Basic options:
Helpful option: |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Option 1: Allows changing coordinates
|
Option 2: Allows picking by dragging as well as changing coordinates
Selecting atoms: Binds shift-drag and alt-shift drag to "add to selection" and "remove from selection", respectively, and shift-drag to "add or toggle." Moving atoms: When the mouse is not over the structure, drag changes orientation in a standard Jmol way; when the mouse is over the structure, binds drag to "drag the structure" thus changing coordinates. Does not implement rotate. |
Option 3: Allows picking by clicking as well as changing coordinates
|
|||||||
Click Type | Click Target | Comment | Click Type | Click Target | Comment | Click Type | Click Target | Comment | |
Atom Movement (only selected atoms) | |||||||||
x/y-shift (along screen axes) |
drag | any atom | drag | any atom | shift-alt-drag | anywhere | |||
z-shift (perpendicular to screen) |
shift-drag | any atom | not available | not available | |||||
rotate | alt-drag | any atom | not available | alt-drag | anywhere | ||||
Atom Selection | |||||||||
select a single atom | not available | shift-drag | around an unselected atom | click | an unselected atom | ||||
alt-drag | around an atom | double-click | an atom | other atoms are deselected | |||||
deselect a single atom | not available | shift-drag | around a selected atom | click | a selected atom | ||||
select multiple atoms | not available | shift-drag | around unselected atoms | not available | |||||
alt-drag | around atoms | ||||||||
deselect multiple atoms | not available | shift-drag | around selected atoms | not available | |||||
Summary | |||||||||
Option set 1 (+ basic options) totally disables mouse-based selection changes and enables all three movement types (x/y-shift, z-shift, rotate). |
Option set 2 (+ basic options) enables mouse-based single/multiple atom selection changes and enables only one movement type (x/y-shift). |
Option set 3 (+ basic options) enables mouse-based single atom selection changes and enables two movement types (x/y-shift, rotate). |
Contributors
Hansonr, Rhuehne, AngelHerraez, Ted, Pimpim, Cudo29, NicolasVervelle, Tania, Domtheo