Draft: March 26, 2010
 
Commands and Modes in Olex2


This document describes some of the commands that are available in Olex2. Many of these commands are also available directly from the Olex2 graphical user interface. Most items on the GUI have a small 'info' symbol next to them, where you can find out more about any of these items.

Introduction

There is no special console window in Olex2 - the commands described in this document can be typed where ever you are in Olex2 and the text you type (as well as the program response) will appear in the bottom left hand corner of the main window. The text will then scroll up behind the displayed molecule. The number of lines of text that are visible can be set with the command lines n. You can also toggle between showing the molecule only, showing the text only and showing both at the same time (default) using Ctr+T. You can always examine the text output in your default text editor by typing text.

Many commands in Olex2 are modelled on the syntax that may be familiar from SHELX: four letter commands, where the letters often provide a hint about the function of the command. Many commands that are available in ShelXP, for example, can be used in Olex2. Also, all commands of the ShelXL and ShelXS syntax are interpreted by Olex2 and used to construct the internal Olex2 structure model. This model is then used directly to carry out a smtbx-refine refinement, whereas a shelx.ins file is generated on the fly if ShelXL/XH is chosen for the refinement.

All commands in Olex2 will auto-complete when pressing the TAB key. If the completion is not possible, because there are more than one commands starting with the letter that have been typed, a list of these commands will be printed. It is good practice to use the auto-complete feature!

Understanding the Syntax


Selection: If one or more atoms are selected on the screen, then any command that acts on a selection will apply to the selected atoms only. If there is no selection, it will apply to all atoms. Instead of making a selection on the screen, a list of atom names can also be supplied. If a command has been successful, the selection will disappear. (Although there are a couple of exceptions to this rule)

Mode: If Olex2 is in a Mode, the chosen action will be applied to all subsequently clicked atoms. The mouse pointer will change from the default arrow symbol to signify that Olex2 is in a mode. To get out of a mode, simply press the Esc key.

Syntax used in this document:
{a, b, c}: choice of a, b or c. For example: fix {occu, xyz, Uiso} [atoms] means 'fix occu [atoms]', 'fix xyz [atoms]', 'fix Uiso [atoms]'.

[val=2]: optional parameter. This parameter is not required for the command to work, and if it is not supplied, the default value will be used.

-k: This is an option switch.

i: Italic characters are used for variables.

[atoms] means an optional list of atoms. Any atoms that are selected will automatically be present in this list. If there are no selected atoms, all atoms will be in this list. Alternatively, the atom names of the atoms that should appear in this list can be typed by hand. 


atoms means a compulsory list of atoms. Any atoms that are selected will automatically be present in this list. Alternatively, the atom names of the atoms that should appear in this list can be typed by hand.

Capital Letters are used for commands that will directly affect the structure model in the refinement. These commands will become part of the structure model and will appear in the ShelX input file. Please note that these commands can be typed either in upper or lower case.

Example Commands are represented in this format: refine 4 20 and can be typed exactly as they are given. In this example, the structure will be refined with four refinement cycles and 20 electron density peaks will be returned.


Changing the Model View

matr

[1,2,3 or abc] or [abc a1b1c1] or [x11 x12 x13 y11 y12 y13 z11 z12 z13]

Orients the model along a (1 or 100), b (2 or 010), c (3 or 001) or any other crystallographic direction, like 123, which sets current normal along (1*a+2*b+3*c) vector. Two crystallographic directions (from and to) may be specified align current view normal along the (to-from) vector. Also a full Cartesian matrix can be specified. If the directions are signed or consist of multiple digits all components should be of the same length like in 120101 or -1+1+1 (same as -10101). If no arguments given, prints current Cartesian orientation matrix.

Examples:

  • matr 1 or matr a or matr 100 - sets current normal along the crystallographic a direction
  • matr 100 011 sets current normal along (011-100) direction (the normal direction changes if from and to are swapped) 

rota

axis angle or x y z angle increment

Changes current view by rotating around given axis (x, y or z) when two arguments are provided and makes a continuous rotation around give axis when 5 arguments are provided. Note that X axis is aligned horizontally, Y - vertically and Z is out of the screen plane.

Examples:

  • rota x 90 rotates the structure 90 degrees around X axis
  • rota 0 0 1 90 1 rotates model in the screen plane (around Z) 90 degrees with 1 degree increment. 

orientation


The command prints current normal in crystallographic coordinates and tries to match it to a crystallographic direction.

mpln [atoms] [-n] [-r] Finds the best plane through the current selection or given atoms, or out of all visible atoms if none are given.
  • -n sets the view along the normal of the plane

The model can be rotated using by moving the mouse pointer while holding the left mouse button down (also Shift+arrow keys); rotated around Z by pressing the Ctrl key down while rotating; zoomed using the right mouse button (also Shift+Home/End). The default mouse behaviour can be overridden in some modes (look at mode split) also some objects, like cell basis or text boxes can override some mouse operations (like zooming on the cell basis) or extend it (moving the basis while holding Shift key down).

Keyboard Shortcuts

Ctrl+Q

ShowQ

Toggles between three states:

  • show electron density peaks
  • show electron density peaks with bonds
  • hides electron density peaks

Ctrl+H

ShowH

Toggles between three states:

  • show hydrogen atoms
  • show hydrogens with internal h-bonds
  • hides hydrogen atoms

Ctrl+T

ShowStr

Toggles between three states:

  • show structure only
  • show show structure and text
  • show text only

Ctrl+I

sel -i

Inverts the current selection.

Ctrl+A

sel -a

Selects all atoms currently visible, however if labels are active (i.e. one or more label is selected) then this selects all labels.

Ctrl+U sel -u Deselects all of current selection.
Ctrl+G mode grow Enters mode grow.  See also symmetry operations.
Ctrl+O reap Brings up the Open File dialogue.
F2 swapbg Swaps the background between white and coloured.
F3 labels Toggles labels on/off.
F4 grad -i Toggles gradient background on/off.
F5
Go to the work menu.
F6
Go to the view menu.
F7
Go to the tools menu.
F8
Go to the info menu.
Esc
Exits current mode (some modes, like mode match, can override this), clears current selection and text in the command line
Break
Interrupts the solution/refinement after the current cycle.



Fixed/Refined Parameters

fix

{occu, xyz, Uiso} [atoms]

Fixes the specified refinement parameter, ie these parameters will not be refined in subsequent refinement cycles.

  • occu: will fix the occupancy 
  • xyz: will fix the xyz coordinates
  • Uiso: will fix the whole ADP
Examples:
  • fix occu 0.5: will set and fix the occupancy of the current selection to 0.5
  • fix xyz: will fix the x, y and z co-ordinates of the currently selected atoms, ie not refine them. 

free

{occu, xyz, Uiso} [atoms]

The opposite of fix - makes the specified parameters for the given atoms refineable. Feeing the occupancy is also available from the context menu.

mode

fixu

Fixes Uiso or ADP for subsequently clicked atoms.

mode

fixxyz

Fixes coordinates for subsequently clicked atoms.

mode

occu occupancy_to_set

Sets atoms occupancy to the povided value for subsequently clicked atoms.

labels -f show currently fixed atomic parameters, labels -f -r show labels for fixed atoms and also the number at which the occupancy of riding atoms is fixed



Atom Connectivity Table Manipulation

conn

n [r] atoms

Sets the maximum number of bonds for the specified  atoms to n and changes the default bond radius for the given atom type to r.

Examples:

  • conn 5 $C sets the maximum number of bonds all C atoms can have to 5,
  • conn 1.3 $C changes the bonding radius for C atoms to 1.3 (the floating point is used to distinguish between n and r in this case!),
  • conn 5 1.3 $C combines the two commands above

compaq
[-a] [-c] [-q] Moves all atoms or fragments of the asymmetric unit as close to each other as possible. If no options are provided, all fragments are assembled around the largest one.
  • -a: assembles broken fragments
  • -c: similar to the default behaviour, but considers atom-to-atom distances and will move all atoms to the closest possible position to the largest fragment in the structure.
  • -q: moves the electron density peaks close to the atoms.

addbond

A1 A2 or atoms

Adds a bond to the connectivity list for the specified atoms. This operation will also be successful if symmetry equivalent atoms are specified.

delbond

A1 A2 or Selected bond(s)

Removes selected bonds from the connectivity list.

sort [m] [l] [p] [h] atoms
[s] [h] [m] moiety
The sorting of atoms in the atom list is very powerful, but also quite complex .
  • -m: atomic weight
  • -l: label, considering numbers
  • -p: part, 0 is first followed by all positive parts in ascending order and then negative ones
  • -h: to treat hydrogen atoms independent of the pivot atom.

Sorting of moieties
  • -s: by size
  • -h: by heaviest atom
  • -m: by molecular weight

Usage:
  • sort [+atom_sort_type] TBA
    sort [Atoms] [moiety [+moiety_sort_type] [moiety_atoms]] If just 'moiety' is provided - the atoms will be split into the moieties without sorting.

Examples:
  • sort +m1 F2 F1 moiety +s will sort atoms by atomic mass and label, put F1 after F2 and form moieties sorted by size. Note that when sorting atoms, any subsequent sort type operates inside the groups created by the preceeding sort types.


Olex2 will display the altered connectivity table in the case if structure is grown or packed


Symmetry Operations

lstsymm

 

Prints symmetry operations and their codes for current structure.

envi

r [2.7 Å] A1 or one selected atom [-h] [-q]

Note: if more than one atom is selected the first one is used

Prints a list of those atoms within a sphere of radius r around the specified atom.

  • -h: adds hydrogen atoms to the list
  • -q: option adds Q-peaks to the list

mode

grow [-s] [-v] [-b]

Displays the directions in which the molecule can be grown

  • -s: also shows the short interaction directions
  • -v: [2.0 Å] shows directions to the molecules within v value of the Van der Waals radii of the selected atoms which can be generated by clicking on the direction representations, only unique symmetry operations (producing shortest contacts are displayed)
  • -r: shows directions to all symmetry equivalent atoms atoms of the selected one(s) within 15 Å
  • shortcut Ctrl+g is used to enter the 'mode grow'

mode

pack

Displays the position of symmetry equivalent asymmetric units as tetrahedra. These asymmetric units can be generated by clicking on the corresponding tetrahedron.

sgen

atoms

The Symmetry operation is represented as 1_555 or -1+X,Y,Z and atoms as a selection or a names list

Generates symmetry equivalents of the provided (or all atoms, if there is no selection) using the provided symmetry operation.

Note: For symmetry operations starting with '-' and letter, a leading zero must be added, for example, 0-x,-y,-z, otherwise Olex2 confuses this with an option.

pack

-a a -b b -c c [atoms]

Packs all or specified atoms within given dimensions

  • -c: prevents clearing existing model

Example:  pack $O will pack all O atoms with the default of -1.5 to 1.5 cells range.

pack

cell

Shows content of the unit cell. In conjunction with 'grow -w' allows the creation of views where all asymmetric units contributing to the unit cell are shown.

pack

r

Packs fragments within radius r of the selected atom(s) or the centre of gravity of the asymmetric unit.

grow

[atoms] [-w]

Grows all possible/given atoms; for polymeric structures or structures that require to be grown several times Olex2 will continue grow until the operation results in a symmetry element that has been used previously.

  • -w: permits the application of symmetry previously used operations to other fragments of the asymmetric unit

Example: If the main molecule is grown, but only one solvent molecule is shown, using 'grow -w' will produce other solvent molecules using symmetry operators used to grow the main molecule

If some atoms are deleted after growing operations, Olex2 will use existing unique atoms as the asymmetric unit atoms; this can be helpful to avoid a sequence of sgen/kill commands


Disorder Modelling: Constraints and Restraints

EXYZ

atom types (to add for the selected atom) [-EADP] [-lo]

Makes the selected site shared by atoms of several atom types.

  • -EADP: adds the equivalent ADPs command for all atoms sharing one site.
  • -lo: links the occupancy of the atoms sharing the site through a free variable.

EADP

atoms

Makes the ADP of the specified atoms equivalent.

SADI

atoms or bonds [esd=0.02]

For selected bonds or atom pairs SADI makes the distances specified by selecting bonds or atom pairs similar within the esd.

If only one atom is selected it is considered to belong to a regular molecule (like PF6) and adds similarity restraints for P-F and F-F distances.

For three selected atoms (A1,A2,A3) it creates similarity restraint for A1-A2 and A2-A3 distances.

DFIX

atom pairs or pairwise selection in order [esd=0.02]

For selected bonds or atom pairs DFIX will generate length fixing restraint with the given esd.

If only one atom is selected, all outgoing bonds of that atom will be fixed to the given length with provided esd. For three selected atoms (A1,A2,A3) the A1-A2 and A2-A3 restraints will be generated.

DANG

d atom pairs or pairwise selection in order  [esd=0.04]

For selected bonds or atom pairs, distance restraints similar to dfix will be generated.

tria

d1 d2 angle [esd=0.02]

For given set of bond pairs sharing an atom or atom triplets generates two dfix commands and one dang command.

Example: tria 1 1 180 C1 C2 C3 will generate 'DFIX 1 0.02 C1 C2  C2 C3' and 'DANG 2 0.04 C1 C3' it will calculate the distance for dang from d1 d2 and the angle.

FLAT

[atoms][esd=0.1]

Restrains given fragment to be flat (can be used on the grown structure) within given esd.

CHIV

[atoms][val=0] [esd=0.1]

Restrains the chiral volume of the provided group to be val within given esd

SIMU

[d=1.7] [esd12=0.04] [esd13=0.08]

Restrains the ADPs of all 1,2 and 1,3 pairs within the given atoms to be similar with the given esd.

DELU    

[esd12=0.01] [esd13=0.01]

'rigid bond' restraint

ISOR

[esd=0.1] [esd_terminal=0.2]

Restrains the ADP of the given atom(s) to be approximately isotropic

SAME

N

Splits the selected atoms into the N groups and applies the SAME restraint to them. Olex2 will manage the order of atoms within the in file, however mixing rigid group constraints and the 'same' instructions might lead to an erroneous instruction file.

showp
[any]; space separated part number(s)
Shows only the parts requested: showp 0 1 will show parts 0 and 1, showp 0 just part 0. showp by itself will display all parts.

split

[-r={eadp, isor, simu}]

Splits selected atom(s) along the longest ADP axis into two groups and links their occupancy through a free variable. -r adds specific restraints/constraints for the generated atoms

  • eadp, isor or simu

AFIX

shelx afix number{mn} [-n]

-n option considers N-atoms as parts of rings. If no are atoms provided and afix corresponds to a fitted group where n is 6 or 9 (such as 106 or 79), all the rings which satisfy the given afix will be automatically made rigid (this is useful in the case of many PPh3 fragments); alternatively a single ring atom can be selected to make that ring rigid. In other cases, depending on afix either 5,6 or 10 atoms will be expected. Special cases of afix 0, 1 and 2 can be used to remove afix, fix all parameters or leave just the coordinates refinable, all other afix instructions will consider the first atom as a pivot atom and the rest - dependent atom.

part

[part=new_part] [atoms] [-p=1]

Changes part number for given/selected atom; -lo options links occupancies of the atoms through a +/-var or linear equation (SUMP) depending on the -p[=1] option which specifies how many parts to create. if -p=1, -lo is ignored and the given or new part is assigned to the given atoms.

fvar

[value] [atoms]

This command links two or more atoms through a free variable.

  • If no atoms are given the current free variables are printed.
  • If no value is given but two atom names are give, the occupancies of those atoms are linked through a new free variable.
  • If a value of 0 is given, the occupancy of the specified atoms will be refined freely
  • if the value is not 0, the occupancy value of the specified atoms is set to the given value.

sump

[val=1] [esd=0.01]

Creates a new linear equation. If any of the selected atoms has refinable or fixed occupancy, a new variable is added with value 1/(number of given atoms), otherwise already used variable is used with weight of 1.0.

Example: If 3 atoms (A1, A2, A3) are selected this command will generate three free variables and insert the r2 1.0 var 3 instruction (equivalent to 1.0 = 1.0*occu(A1) + 1.0*occu(A2) + 1.0*occu(A3).

mode

split [-r={eadp, isor, simu}]

Splits subsequently clicked atoms into parts, or in combination with the Shift key can be used to drag an atom to change its position. -r option can be used to generate extra restraints/constraints for original and generated atoms; values are eadp, isor or simu. While in the mode the newly generated atoms can be selected and moved as a group with Shift down or rotated when dragging the selection. The original and generated atoms will be placed into different parts.



Selection Syntax

sel

sel atoms where xatom.bai.mw > 20

Will select all atoms where the atomic mass is larger than 20








HKL file Operations

hklstat


Prints detailed information about reflections used in the refinement.

omit

h k l

Inserts 'OMIT h k l' instruction in the ins file

omit

val

Inserts 'OMIT h k l' for all reflections with |F{o}^{2} -F{c}^{2}| > val .

omit s 2theta Inserts 'OMIT s 2theta' instruction in the ins file

edithkl

[h k l]

Brings up a dialogue, where 'bad' reflections from the Shelx lst file and all its constituent symmetry equivalents can be inspected and flagged to be excluded from the refinement.

In constrast to the OMIT h k l instruction, which  excludes the reflection and all it equivalents, this dialogue allows to exclude those equivalents that are actually outliers.

If a particular reflection is specified, this particular reflection and all its constituent equivalents can be viewed.

excludehkl

-h=h1;h2;.. -k=k1;k2.. -l=l1;l2.. [-c]

This function provides a mechanism to reversibly exclude some reflections from refinement (these reflections will be moved to the end of the hkl file so they appear after the 0 0 0 reflection).

  • -c: option controls how the given indices are treated, if not -c option is provided, then any reflection having any of the given h, k or l indices will be excluded, otherwise only reflections with indices within provided h, k and l will be excluded.

appendhkl

-h=h1;h2;.. -k=k1;k2.. -l=l1;l2..

Acts in the opposite way to excludehkl

For more advanced HKL processing, a Python script may be used. A sample hklf5.py script is provided in {Olex2 folder}/etc/scripts. The script can be copied and modified to accommodate any particular twinning law and run inside Olex2. The script allows creating an HKLF 5 file where reflections which belong to different twin components are assigned different batch numbers. To run a python script in Olex2 use the following command to load the script:

>>@py -l

This command shows a 'File Open' dialog, a python script can be selected. After loading the script can be modified and executed by pressing OK.



Customising the Olex2 GUI

setfont

{console, Picture_labels} choosefont()

Will bring up the dialogue to choose the font

grad [C1 C2 C3 C4] Choose the colour of the four corners of the graduated background.
brad brad r Adjust the bond radius in the display.


Output: Tables, Reports and Images

pictPS    

filename.ps [color_fill] [color_line]

Generates a post-script file of what is visible in the molecule display.

  • -color_fill: Fills the ellipses with colour.
  • -color_bond: Bonds will be in colour.
  • -color_line: Lines representing the ellipses will be in colour.
  • div_pie: number [4] of stripes in the octant
  • lw_ellipse: line width [0.5] of the ellipse
  • lw_font: line width [1] for the vector font
  • lw_octant: line width [0.5] of the octant arcs
  • lw_pie: line width [0.5] of the octant stripes
  • p: perspective
  • scale_hb: scale for H-bonds [0.5]Label Labels
The bond width is taken from the display. This can be changed with brad

pict

filename.ext [-pq] [n] Generates a bitmap image of what is visible on the molecule display.
  • ext {png, jpg, bmp}. png is best. 
  • -pq: print quality
  • n: refers to the size of the output image. If n is smaller than 10, it refers to a multiple of the current display size, if it is larger than 100, it refers to the width of the image in pixels. 

picta

filename.ext [-pq] [n] A portable version of pict with limited resolution, which is OS and graphics card dependent. This may not be stable on some graphics cards
  • -pq: print quality

label

label [atoms] Adds labels to the selected atoms. These labels can be moved by pressing the SHIFT key while holding down the left mouse button
  • type: {subscript, brackets, default}