next up gif contents index
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:                          

  ``X'' indicates an integer from 0 to 100, corresponding to a color number (see the Graphics Options tex2html_wrap_inline6800 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.      

Bond Coloring

  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).  

Worm Coloring

      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).






      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.

Recall from §3 that the default directories for different types of files are taken from environment variables.




                                          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:

    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, and set up as a gnuplot script to plot data in the file .spocklist. The ``ls'' command always uses the simple internal command (``$PAGER .spocklist'').        

    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.  

Viewing Commands

    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:     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:  



Atom Parameters:

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.

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:

Note that all commands apply only to the selected atoms, and that the absence of a selection string implies all atoms.



Environment Variables

    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.  

The internal periodic table

      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. .  

Object Creation

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.



There are a few commands that relate to the global control of spock:

    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 up gif contents index
Next: Selection Up: Command Language Previous: Typographical conventions

Jon Christopher
Tue Sep 14 16:44:48 CDT 1999