
Next: Selection
Up: Command Language
Previous: Typographical conventions
``Actions'' are things the user wants spock to do, such as coloring bonds,
rotating the molecule, or reading a file. These commands are entered from
the command line. (The menu bar, to be discussed in §6, is an
alternate way of carrying out many of the commands.) Spock's actions are
broken up into the following categories: Coloring, Input/Output, Views,
Parameters, Object Creation, and Control. Not all actions may be limited
to a subset of atoms, so those for which selections are valid will be
indicated.
Spock allows color specifications for atoms, bonds, worms, surfaces,
labels, helices, sheets, interactions, and annotations. The color commands
are derived from the name of the object, ``ac'' for atom
color, ``bc'' for bond color, etc. Spock has an internal
color map of 100 colors, which are referred to by name or number from the
command line. Please see §6.11.4 for a discussion of spock's
coloring strategy.
The format of the commands to change the color number for a group of
objects is:
- bc=<X|d|d2|u|i> [,selection]: bond color
- ac=<X|d|d2|u> [,selection]: atom color
- wc=<X|d|u|n|s>[,selection]: worm color
- hc=<X|d|u|n> [,selection]: helix axis color
- sc=<X|d|u|n> [,selection]: sheet axis color
- nc=<X|d|u|n> [,selection]: note (annotation) color
- ic=<X|d|n> [,selection]: interaction color
- lc=<X|d|u|n> [,selection]: label color
- vc=<X|d|u|a|n> [,selection]: vertex (surface) color
- cc=X: set cap color for clipped surfaces
- bgc=X: set background color
- hbc=X: set H-bond color (all H-bonds are the same
color)
- cac=<X|n|a[tom]|b[ond]>: set the color for the CA
trace.
- ilc=X: interaction label color
``X'' indicates an integer from 0 to 100, corresponding to a
color number (see the Graphics Options
Color Tool menu item
for a list). ``d'' specifies use of the default colors, described in the
next paragraph. ``u'' means undo the last color command (there are
separate undo buffers for each type of object, so you can change the atom
colors, then the worm colors, say, and then go back and undo the atom
color change.) For vertices, the vc=a command will color surface
vertices according to the color of their underlying atoms (note that this
is not the only way to color vertices by atom properties, because
spock allows vertex selections based on atom properties). Also for
vertices, the vc=n command will color surfaces by their surface
number (see the s= selection property in §5.3.4),
so that each separately constructed surface is assigned a different color.
For CA traces the cac command a[tom] means to color the CA
trace using the atom color property and [bond] indicates to color by
the bond color property.
Finally, ``n'' stands for color by number for helices, sheets and
interactions, and for color by molecule number for CA traces and worms.
(Helices and Sheets, in this context, means the axis cylinders calculated
via the ``Build Helices/Sheets'' command. See §6.4.8 and
6.4.9.) ``Color by number'' means that each object of that
type gets a different color. For example, coloring worms by number will
assign each molecule's worm a different color, color 1 for molecule 1 and
so on.
The default colors are different for each class of object. Atoms and
bonds are assigned default colors according to their atom type. Worms are
colored with color 1 by default, as are surfaces. Helices are initially
yellow (color 5) and sheets, blue (color 4). All label colors are 0,
except for CA atoms of amino acids and and backbone phosphorus of nucleic
acids, which get white (color 1). Color 0 is a special color, which means
that the object is hidden (i.e. not drawn). Surfaces have a default color
of 51 which (unless the colormap has been changed) is 50% grey.
A few comments on appearances: different object types have vastly
different appearances at different colors. For instance, white bonds
(color 1) look fine, but atoms colored 1 appear washed out. I recommend
using the ac=51,ac=1 command to set increase the contrast on atom
colors. Similarly, surface colors in the range (1-10) appear washed out
as well. I heartily recommend surface colors in the 50's, as the lower
color numbers make the surfaces look really ugly. Contour colors in the
1-10 range look fine, however.
The default colors for atoms and bonds may be re-defined via the set
element command as described in §5.2.4.
Initially, Carbon is color 1 (white), Oxygen is color 2 (red), and
Nitrogen is color 4 (blue). For a complete list of the default colors,
see Appendix B. Atoms and bonds may also use a
second default color set, via the ac=d2 or bc=d2 commands.
The second default set is offset from the first by an adjustable
parameter, the color offset (§6.11.4). Users may wish to use
the second default color set for some subset of the objects in a display.
Note: The bc=i bond color command is a unique coloring command in
spock. This command ``inverts'' the selected bond colors, multiplying the
color by negative one. Spock is capable of displaying bonds in two
different styles simultaneously, called the primary and secondary bond
modes, respectively. Normally bonds are displayed in the primary mode.
However, bonds with ``negative'' color numbers are displayed in the
secondary bond style. (There are not actually negative colors, the
displayed is the absolute value of the color.) This is quite useful,
because it allows for, say, a substrate to be in ball-and-stick style,
while other bonds are in line style. The bc=i command is a shortcut
way to invert the bond colors (and thus the bond style). The bc
command will also accept negative numbers directly, however, so the
command bc=-3,r=atp will color make all ATP molecules green and use
the secondary bond style. The primary and secondary bond modes may be
changed via the Alter Bonds menu (§6.4.1).
Notes for worm colors: For the rectangular and secondary structure worms,
there is a shadow. The color for this shadow is taken as the worm's color
plus 40, modulo 100, so that if a worm is colored with color 14, its
shadow color will be 54, but if it's color 95 the shadow color will be 35,
not 135. This makes the edges stand out nicely. If you don't want this
effect you can turn off worm shadows via the ``Alter Worms'' menu. If you
use the color editor (§6.11.4) to change the color scheme,
and you are using worm shadows, you should update the worm shadow color
too, or unexpected results may occur. See §6.4.3 for more
information. Also, there is a wc=s command. This command is a
shortcut to get worm segments colored according to the secondary
structure. Helical segments get colored color 2 (red by default), sheets
get color 4 (blue), turns get color 7 (magenta), and random coil gets 5
(yellow). There is no way to change these assignments. (Well I suppose
you *could* patch the binary...). Of course, if no secondary information
has been assigned, wc=s will color every thing color 7 (yellow),
because structure types default to coil.
NEW: Spock now supports ``negative'' worm colors. Backbone segments
whose owners have a negative color are drawn as a wire-frame mesh, and the
color is taken from the absolute value of the assigned color. Note that
the ``negative color implies mesh'' mapping applies even when coloring
with a spectrum (§cross_ref_motif., §cross_ref_motif.). This
feature is intended to be useful when you have data mapped onto a
backbone with some missing residues (e.g. from an NMR experiment). The
residues for which there is no data may be displayed in mesh format. Note
that you may wish to increase the worm cross section if you use this
feature (§6.4.3).
- bc=0: ``Hide'' all bonds. Color 0 means no display.
- bc=1: color all bonds color 1
- wc=n: color
worms by molecule number
- cac=n: color CA traces by
molecule number
- cac=b: color CA traces by bond color
property
- ac=d: color atoms the default colors
-
lc=u: undo the last label color change
- hc=n:
color helices by number
- sc=n: color sheets by number
- vc=1: color vertices (surface) color 1
Most input and output is handled through the menu system. However, as a
convenience, there is a ``read'' command, which will attempt to
guess the file's type by the extension and look for the file in the
appropriate directory for that type of file, or the current working
directory. Files with an unrecognized extension will be treated as spock
command/history files. The format of the command is:
read=file.ext: read file according to extension:
.sps = spock session files
.spv = spock view files
.pdb or .ent = PDB file
.dssp = DSSP file
.sp = spock history file
.spo = spock object file
.r3d = raster3d file
.phi = electrostatics PhiMap
.siz = radius file
.crg = charge file
.int = interactions file
.xplor or .xplmap = XPLOR density map
.bon* = bones file
History files (see §7), by default, echo the
contents of the file to the screen as the file executes. You can change
this to a silent mode as indicated below. There are also commands to
pause and resume execution of history files.
- read -s=file.sp: read a history file, without echo
- silent=true: make silent mode the default for history
- silent=false: make verbose (echo) mode the default for
history
- pause: stop executing commands from history file
- resume: resume executing commands from history file
- fetch=code: This command first tries to read the file
from the local PDB directory, but if it fails, it will contact the
PDB server, retrieve the PDB file with the id 'code', and then
read the file. This capability relies on the script
$SPOCK/bin/getentry. There are several versions of this script,
and system administrators can choose whichever is most
appropriate.
Recall from §3 that the default directories for
different types of files are taken from environment variables.
- read=1brl.pdb: read 1brl.pdb from the PDB directory,
$SP_PDB, or the current working directory.
- read=pdb1rnt.ent: read pdb1rnt.ent from PDB directory,
$SP_PDB, or the current working directory.
- read=1brl.dssp: read 1brl.dssp from the dssp
directory, $SP_DSSP, or the current working directory.
- read=setup.sp: read setup.sp from the history
directory, $SP_HISTORY, or the current working directory.
- fetch=1rnt.pdb: attempt to read 1rnt.pdb from the
$SP_PDB directory. If it fails, get 1rnt from the PDB FTP
server.
- read=test.r3d: read the file test.r3d as an external
objects file. (See Appendix F.3). Note
that reading r3d files produced by Molscript may have unexpected
results, as 1) the shapes are not solid and 2) the triangle
orientation is not consistent. I've attempted to correct for the
orientation, but there are no guarantees.
- read=test.spo: read the file test.spo as an external
objects file. (See Appendix F.3).
- read=test.xplor: reads the file test.xplor as and
XPLOR-format density map into the current density map slot (there
are eight, as described in §6.4.7). The
default directory for XPLOR maps may be set from the
$SP_XPLOR variable.
Spock's primary command-line output commands have to do with generating
lists. Spock can generate lists of atoms, residues, molecules, helices,
sheets, bonds, h-bonds and vertices. The commands are:
- list [,selection]: list the atoms specified by the
selection. The default information is the atom identity in the
format specified in §6.9.1.
- rlist [,selection]: list residues
- blist [,selection]: list bonds
- hblist [,selection]: list hydrogen bonds
- ilist [,selection]: list interactions
- mlist: list molecules (no selection applied)
- hlist: list helices (no selection applied)
- slist: list sheets (no selection applied)
- tlist: list turns (no selection applied)
- mass [,selection]: calculate the mass for the selected atoms
Most lists are simply printed to the output window. Atom lists, however,
are first sent to a temporary file, ``./.spocklist'', and then this
file is displayed. The user can control how this file is displayed via
the ``Preferences'' menu off the ``File'' main menu §
6.1.1. In the text-only mode §7.2, the
default is to list the file via the shell command, $PAGER
.spocklist.
There is a separate atom listing command, ls [,selection]. This
command generates the same list as the list command, but the
.spocklist file is treated differently. The ls command spawns a
shell and executes the a command string (called the list command). The
list command by default is $PAGER .spocklist.
The advantage of this setup is that the list command can be changed so
that other things may be done with the file. The list command is only
executed if there are atoms that match the selection. For example, the
list command could be set to gnuplot cmdfile.gp, and
cmdfile.gp set up as a gnuplot script to plot data in the file
.spocklist. The ``ls'' command always uses the simple internal
command (``$PAGER .spocklist'').
- ls [,selection]: list atoms, using list command
-
set list command: prompts for the unix command to be used to
list atoms
- help list: displays a list of available
variables for output and their appropriate formats.
-
set list format: prompts for a ``C'' format string and a list of
variables to print. If you don't know ``C'' formatting, you can
always just use a * for unformatted output.
Users may change the information that spock provides for list and
ls commands via the set list format command. This command
prompts for a for format string and list of variables to print. Then,
whenever a list command is used, data will be presented according to the
variable list and format specified. An example of changing the list
format would be setting the format string to .14s %.14s %f, and
the variable list to id,dpid,d. (See also §8.7
for a tutorial using this command.) If a list command is issued after
this setup, the list file will contain the identity of each atom, the
identity of the distance partner for each atom, and the distance property
for each atom (these properties and others are explained in §
5.2.4. Many other combinations are possible, of
course. A more complicated example of changing the list output format and
list command is given in §7.1.4.
Spock also has a handful of ``show'' commands to output information.
- show helices: shows a
list of all currently defined helices. Differs from hlist
in that the direction vector, the initial point, the final point
and the RMS deviation of the CA atoms from the axis are
shown.
- show sheets: identical
to show helices, except operates on sheets.
- show variables:
this command shows the currently defined spock environment
variables (actually, any environment variable beginning with
``SP'').
- show rotation: shows the
current rotation matrix in 4x4 format. This is identical to the
Graphics
Print rotation matrix menu option.
- show version: prints the
current version number.
Spock has several
command-line commands to let you change the viewpoint, that is to say it
is possible to specify rotations and translations from the command line.
The syntax is:
- xr=n: rotate by n degrees around screen X axis
- yr=n: rotate by n degrees around screen Y axis
- zr=n: rotate by n degrees around screen Z axis
- xt=f: translate by fraction of window size (f) along
screen X
- yt=f: translate by fraction of window size (f) along
screen Y
- zt=f: translate by fraction of window size (f) along
screen Z
- Xt=A: translate by A Ångstroms along screen X
- Yt=A: translate by A Ångstroms along screen Y
- Zt=A: translate by A Ångstroms along screen Z
- zoom[=n]: set magnification factor to n. With no zoom
factor specified, prints the current magnification.
- look[=cutoff][,selection] This command centers the
view on the selected atoms, and sets the bond colors such that
atoms whose distance from the center of the selection is greater
than the cutoff value are hidden, while atoms within the cutoff
radius are shown. If no cutoff is specified, 5.0 Ångstroms is
used. This provides an easy way to focus on a group of atoms.
Note that no colors other than the bond colors are affected by
this command, and the coloring (but not the centering) effect of
this command may be undone via the bc=u[ndo] command.
You can also change the center of rotation from the command line, via the
command: set center [,selection], which will set the new center of
rotation as the center-of-mass of the atoms specified by the selection.
You can remove any applied translations and re-center the center of
rotation in the window with the command center. (Note: these
commands may also use the British spelling centre. Thanks, Janet!).
It is also possible to save up to 10 views in spock. This will save the
current viewing projection as well as remember which objects are
displayed, and the color of all objects. The commands for this are:
- saveview=n: define the current view as view number n,
0
n
9
- view=n: set the view to the saved view number n, 0
N
9.
Spock stores a number of parameters (or
properties) for each atom, including radius, charge, surface area,
secondary structure, distance, distance partner, and two general-use
parameters, atom properties 1 and 2. Spock can carry out mathematical
functions (§6.6.2) on these properties, and select
atoms based on their value (§5.3). The following is a
complete list of spock's atom parameters, and an indication of how they
are set, changed and used. The value of some these properties can be
changed via the ``set'' command, described below.
- radius: This is the atomic radius. This property is
assigned when the pdb file is read. Default radii for different
atoms can be changed via the define element command
discussed in this section. The value can be changed via the
set radius= command. This property controls the size of the
atoms displayed, and may be exported to Molscript (§
6.1.2). This property may serve as a selection
property.
- charge (q): This property may be assigned from charge
files read via the file menu §6.1.1, or it may be
set via the set charge command. This property may be used
in the math system, and can serve as a selection property.
- distance (d): This property is set from a distance
calculation (§6.6.1), and normally contains
the distance to some other atom. It can also be set from the
set distance= command. This property may be used in the math
system, and can serve as a selection property.
- distance partner (dp): This property specifies to
which other atom the distance property refers. This property is
set from a distance calculation (§6.6.1), and
can serve as a selection property. It can also be set via the
set dp= command, but setting dp directly should be used with
caution, and should primarily be reserved for resetting the
distance partner to 0 (no partner) before a new distance
calculation. The value of the dp property is the internal spock
atom number (ISAN §5.3.1) of the other atom.
If the value of dp is negative, the distance (d) property actually
refers to the distance to a surface point; the absolute value of
dp is then the atom owner of the surface point in question.
- surface area (sa): This property normally contains the
value of the accessible surface, calculated via an accessible
surface area calculation (§6.6.3), but may
also be set with the set sa= command. This property may be
used in the math system, and can serve as a selection property.
- potential (p): This property generally stores the
calculated potential at a given atom, as interpolated from the
current electrostatic potential map (see §
6.6.4). This property may be set via the
set ap1= command. It may also be used in the math system,
and can serve as a selection property.
- atom property 1 (ap1): This is a general use property.
It is initially assigned from the occupancy field of the PDB file,
but may be changed via the set ap1= command. This property
may be used in the math system, and can serve as a selection
property.
- atom property 2 (ap2): This is a general use property.
It is initially assigned from the b-factor field of the PDB file,
but may be changed via the set ap2= command. This property
may be used in math system, and can serve as a selection property.
- structure: This property is set when a PDB file is
read if HELIX, SHEET and TURN records are present in the file.
Otherwise it's set to ``C'' (for coil) when the file is read.
This property may be changed by reading a DSSP file, (§
6.1.1 and 6.7.8), using the set
structure= command, or using the secondary structure editor (§
6.7.6). Valid values are ``(H)elix'', ``(S)heet'',
``(T)urn'', and ``(C)oil''. This property is used for the
secondary structure worms (§6.4.3), and may be
exported to Molscript (§6.1.2). Changing this
property by any of the methods above causes spock to recalculate
the table of defined helices and sheets used for the Display
Helices and Display
Sheets menu items
or as printed out by the hlist and slist commands.
- vdistance (vd): This property is set from a distance
calculation (§6.6.1), and normally contains
the distance to some atom or surface point. It can also be set
from the set vdistance= command. This property may be used
in the math system, and can serve as a selection property.
- vertex potential (vp): This property generally stores
the calculated potential at a given vertex, as interpolated from
the current electrostatic potential map (see §
6.6.4). It may also be set via the
set vp command. This property may be used in the math system,
and can serve as a selection property.
- vertex property 1 and 2 (vp1 and vp2): These are
general use vertex properties. They are not currently
automatically assigned, but they may be changed via the set
vp1 or set vp2 command. These properties may be used in
the math system, and can serve as a selection properties.
- colors: Colors can also be seen as atom properties.
The atom color properties are: atom (ac), worm (wc), bond (bc),
label (lc), helix (hc) and sheet (sc). These properties are set
from the internal defaults when a new structure is read in, and
may be changed via the coloring commands, both described in §
5.2.1.
Here is the syntax for the set commands which are used to change the
value of some of the atom parameters, and the define element command
which may be used to alter the default radii assigned to an atom and its
default color:
- set radius=X [,selection]: set the atomic radius to X
for the selected atoms
- set distance=X [,selection]: set the distance to X
- set charge=X [,selection]: set the atomic charge to X
- set sa=X [,selection]: set the surface area to X
- set p=X [,selection]: set the potential to X
- set ap1=X [,selection]: set general atom property 1 to
X
- set ap2=X [,selection]: set general atom property 2 to
X
- set structure=<helix|sheet|coil|turn> [,selection]:
Set the secondary structure type for the selected atoms.
- set chain=X [,selection]: Set the chain id to X for
the selected atoms.
- set iv=X [,selection]: Set the interaction value to X
for the selected interactions
- set it=N [,selection]: Set the interaction type to N
for the selected interactions
Note that all commands apply only to the selected atoms, and
that the absence of a selection string implies all atoms.
- set distance=100: set the distance property to
100Å for all atoms.
- set radius=1.7, a=ca: set the radius to 1.7Å for
all alpha carbons.
- set structure=coil: set all structures types to coil.
- set structure=helix, rn=(1,10): set the structure to
helix for residues 1-10.
Environment variables may be set and used within spock. The syntax for
setting an environment variable is: set $variable=value. This will
create a new variable named $variable. This is useful for the
variables on which spock depends such as SP_PRINT_CMD. See
3 for details on the variables that spock uses. Other,
user-defined variables can also be set by this method, of course.
Environment variables may be accessed in spock commands by preceding them
with a dollar sign $. For example, if $favorite is defined
as your favorite amino acid, bc=4,r=$favorite is a valid command.
There's a special syntax used to count the number of atoms matched by a
selection string, the count command. For example, count
$a=rn=(1,10) will count the number of atoms in the selection
rn=(1,10) and give $a with that value.
Note that these variables are distinct from the command-line calculator
variables described in §5.5.1. See that section for
details on the differences between the two types of variable.
Spock has in internal periodic table complete up to Lawrencium from which
it takes atomic and covalent radii, and the default color for an atom
type. The values used in this table are listed in Appendix
B. These values may be changed via the define
element command. The syntax for this command is:
define element=(Z,covalent_rad,vdw_rad,default_color)
This command will set up the default radii and color assigned
used for elements of a specific type. This command would usually be
included in the .spockrc initialization file (§3.8).
``Z'' is the atom type number and is the element's atomic number, or
the special number 0 for CA's. The covalent_rad field is the
radius used to determine bonding for atoms of this type, while the
vdw_rad field is the radius assigned to the atom and which controls the
size of CPK spheres, etc. Finally, the default_color field is the
default color to use for this atom type. Note that this command will not
reset the radius property for existing atoms, only change the value that
is assigned when a new file is read in. The colors will not be updated
until the a ``color with default color'' command is given, e.g.
bc=d.
For example: define element=(26, 1.35, 1.95, 8) would define element
26 (iron) to have a covalent radius of 1.35, a Van der Waal's radius of
1.95, and would color iron atoms with color 8. .
Spock has several convenience commands for making objects. These are, in
general, shortcuts to using the menu interface. See §6
for more detailed information about these commands.
- makesurf [,selection]: make the molecular surface for
the selected atoms.
- makeacc [,selection]: make the accessible surface for
the selected atoms.
- asurf [,selection]: calculate the accessible surface
area for the selected atoms.
- title: prompt for a title or annotation
- subdef=name [,selection]: define a subset of atoms to
be referenced by name. (See §6.8).
- vsubdef=name [,selection]: define a subset of vertices
to be referenced by name. (See §6.8).
- mutate=aa [,selection]: mutate the first residue
with any atom in the selection. (See §6.7.14.)
- label [,selection]: prompt for a custom label for the
first atom matching the selection.
- macdef=NAME: begin defining a macro named NAME.
See §6.10.
- endmac: stop defining a macro. See §6.10.
- mac=NAME: run the macro called NAME. See §
6.10.
- contour2d=level: Make 2D contour at level
- contour3d=level: Make 3D contour at level
There are a few commands that relate to the global control of spock:
- quit: exit spock, prompting for confirmation
- QUIT: exit spock, do not prompt for confirmation
- delete: delete the selected atoms. This may be
followed by a selection string. If it's not, the default of all
atoms applies.
- zap: delete all atoms and other objects. Return to
initial state.
- menu: activate menus in the nographics mode (Section
7.2).
- draw=<on|off> Turns rendering on and off. This is
particularly useful for history files, as running back a lengthy
history file can be slow. Turning rendering off speeds the
playback, but you don't get to see much along the way. At the end
of history file, the draw mode is always reset to on.
- remake This
command causes spock to rebuild all the currently visible objects
according to the current conditions. You can use this command for
instance after re-defining the secondary structure via the
set structure command in order to update the backbone
representation. This command has the same effect as toggling
items in the display menu off and then on again.
- connect This
command tells spock to re-calculate all bonding information. Any
bonding information present in the PDB file is discarded.
- structure Calculate the secondary structure from
hydrogen bonding parameters using the DSSP algorithm
([5]). This is the same as the Modeling
Calculate secondary structure menu item §6.7.7.
- renumber=N [,selection] renumber the selected residues
sequentially, starting at N (which may be negative).
- swap Spock's graphics
are normally double-buffered. The swap command swaps the
front and back buffer, so that you can see the last image. This
is useful, for example, if you've replaced a molecular surface
with an accessible one. Repeatedly swapping the buffers can help
users appreciated the difference between the two classes of
surfaces. It's also useful if you want to toggle back-and-forth
between two different color schemes. Realize, however, that any
change in the graphics display other than a swap command will
overwrite the back buffer.
There is one further difference between quit and
QUIT. When spock is reading from a history file (§7)
quit simply exits the file and returns control to the command-line. The
QUIT command, however, will cause the program to terminate. This is
useful if you'd like to have a shell script control spock. See §
cross_ref_motif. for an example.

Next: Selection
Up: Command Language
Previous: Typographical conventions
Jon Christopher
Tue Sep 14 16:44:48 CDT 1999