ccp4mapwish is a customised version of the wish program, consisting of the Tcl command language, the Tk toolkit, and a main program that reads commands from standard input or from a file. It creates a main window and then processes Tcl commands.
The program is not currently installed as a standard part of the CCP4 suite, and must be built separately if you want to use it. See the $CPROG/ccp4mapwish_/INSTALL.txt document for details.
ccpmapwish offers a number of commands in addition to those found in standard TCL/Tk. These are divided into three sections.
Reads the specified map file into memory. Only one map can be held in memory at any one time.
Returns an integer value depending on exit conditions:
0 = successful
-1 = a map is already stored in memory
-2 = error reading map file header or map values (from CCP4 libraries)
-3 = memory allocation failure
Clears any map currently stored in memory. Returns an integer value depending on exit conditions:
0 = section successfully deleted
-1 = no section to delete
Interrogate the map in memory. Without keywords, used to ask if a map is currently stored. Other keywords access header information:
[none] - returns -1 if no map is currently held in memory
spacegroup - spacegroup from map
cell - cell parameters (6 numbers in a list)
maximum - maximum density in map
minimum - minimum density
mean - mean density
rms - rms density
limits - start...stop grid points on x..y..z (6 numbers in
a list)
title - title from the map
grid - number of grid points along cell edge on x..y..z
(3 numbers in a list)
Stores the specified section from the current map in memory, for rapid access when contouring. <axis> is one of x, y or z, <section> is an (integer) section number. Only one section can be stored in memory at any time.
Returns an integer value depending on exit conditions:
0 = successful capture of section
-1 = no map loaded, or section already stored
-3 = memory allocation failure
-4 = unrecognised axis specification, or section not in range
Clears the current section from memory. Returns an integer value depending on exit conditions:
0 = section successfully deleted
-1 = no section to delete
Interrogate the section in memory. Without keywords, used to ask if a section is currently stored. Other keywords access particular information:
[none] - returns -1 if no section is currently held in memory
limits - start...stop grid points on u and v (4 numbers in
a list)
fraclimits - as limits but in fractional coords
number - returns section number along current axis (grid units)
axis - returns axis from which section is taken (x, y or z)
Sets up the contouring routines, call it once before using any of the other commands. <canvas> is the path of a canvas widget which the user must already have created, and on which the contours etc will be drawn. contourinit also binds the canvas to mouse motion, which calls the setcoordsinsection command (see below).
setcontours <type> <contours> ?-negcontours?
Sets the contour levels to be used by the contoursection command.
<type> is one of abs, sigma or frac - depending on this value the contour levels will be set as absolute values, multiples of sigma, or as fractions of the maximum density.
<contours> is an expression with one of two possible forms:
If the -negcontours option also appears then equivalent positive and negative contours are generated.
Draw contours on canvas using the currently stored section. The options modify the drawing as follows:
-orth <ncode> : sets orthologonisation code
-limits <x1 <y1> <x2> <y2> : limits of the section to be drawn
If <x1>...<y2> are all > 1 then the limits are taken
to be in grid units; otherwise they are taken as
fractional units.
-nobbox : switches off drawing of bounding box and gridlines
-nogrid : switches off drawing of gridlines
-gridspacing <uspace> <vspace> : spacing between grid lines on
the horizontal (uspace) and vertical (vspace) axes, in
fractional units
-gridlabels <type> : <type> can be "frac", "orth" (default is
"frac") sets units for grid labels
WARNING: orth labels are rather misleading
(they are the distance from the origin along the axis
in question) so it's probably best to avoid using them!
-scale <scale> : scale factor to apply to contours; <scale> is
number of pixels per Angstrom (must be integer)
Interrogate the contours stored in memory. Available options:
[none] = returns 1 if contours is currently held in memory nlevels = returns the number of levels currently loaded levels = returns the contour levels as a list limits = returns the current canvas limit (pixels) displayed = returns 1 if contours are currently displayed
Sets the current coordinates (in the canvas) of the cursor. This shouldn't be called by the user, it is effectively an internal command.
Returns the current cursor position in the section in either fractional (type=frac) or orthogonal (type=orth) coordinates, plus the map density at that point.
ccp4mapwish is built from a combination of original C and Fortran code, it also requires the following files and libraries:
OSF1: libUfor and libfor
IRIX : libftn
Linux/GNU: libg2c
The Fortran compiler man pages should give information on which libraries
are used.Some systems require additional libraries (e.g. Linux). See also the $CPROG/ccp4mapwish_/INSTALL.txt document.
Sometimes crashes out with segmentation fault (possibly due to memory leaks).
Example script which would display a section:
# First set up a canvas to display sections set canv1 [canvas .c] pack $canv1 # Read in the map readmap toxd.map # Store a section storesection z 5 # Initialise contouring commands with canvas pathname contourinit $canv1 # Set the contourlevels to use setcontours sigma range 1.0 5.0 0.5 -negcontours # Display the contours for the currently stored section contoursection -limits 0 0 10 10
The mapslicer program was built using these commands.
Fortran contouring routines are modified versions of those in NPO
ccp4mapwish uses the TCL and Tk libraries
Additional commands above written by Peter Briggs