Working with maps (MAP)

Introduction.

WHAT IF allows you to work with maps. Maps are a crystallographic invention. Normally maps contain information about the electron density distribution in space. The crystallographer tries to interpret this density in terms of atomic positions. However, WHAT IF does not limit the use of maps to electron densities. It is possible to put any space dependent property into a map. For example, electrostatic potentials through space can be calculated and shown at the screen; neighbour atom probabilities can be dispayed, spatial probabilities for side-chain conformations can be represented as a 3-D map, etc. A 3-D contouring subroutine takes care that these maps can be contoured and shown at the screen.

The command MAP brings you in the MAP menu.

The format of maps

Unformatted maps

If you want to feed WHAT IF a map, then that map should of course have a certain format. As a basis I used the Groningen style MFF. The following is a description of the MFF:

The MFF is an unformatted file starting with eight introductory records followed by the (electron) density records.

U, V, and W are defined as follows:

  U = direction of first variable of three dimensional array.
  V = direction of second variable of three dimensional array.
  W = direction of the sections (U,V) in the whole map/array.
The following records should be present in fixed order:
1) TITLE (character*80)
2) A,B,C,ALPHA,BETA,GAMMA (In Angstroms and degrees)
3) STEPU,STEPV,STEPW      (In Angstroms)
4) IDIRU,IDIRV,IDIRW
5) NDIVA,NDIVB,NDIVC
6) NU,NV,NW
7) UVWORG(3)
8) ((UVWMAT(I,J),I=1,3),J=1,3)
Thereafter NW times:
((DENSITY(I,J),I=1,NU),J=1,NV)
STEPU, STEPV and STEPW are the stepsize in respectively the U, V, and W direction in Angstroms.
IDIRU = 1, 2, 3, when U along X, Y, Z;
IDIRV = 1, 2, 3, when V along X, Y, Z;
IDIRW = 1, 2, 3, when W along X, Y, Z;
NDIVA, NDIVB, and NDIVC are indicative of the step size with which this map was calculated. Normally Fourier maps are calculated in steps of A/NDIVA, B/NDIVB, and C/NDIVC along the three axes.

NU, NV, and NW are the number of points in the U, V, and W direction respectively. These are the dimensions of the array in the program that is going to hold the map.

UVWORG(3) contains the fractional coordinates of the first point in the first section of the map (density(1,1,1)).

UVWMAT(3,3) holds the matrix that converts grid points into fractional coordinates.

(Xfrac) = (UVWORG) + [UVWMAT] * (Ngrid-1)
in which Ngrid(i,j,k) is the (i,j)-th point of the k-th section of the map.

Formatted maps

WHAT IF can read two kinds of formatted maps. 1) XPLOR maps. 2) The type described below. This file format I invented just to allow everybody to write a simple conversion program for his own file system. Also you can locally change the routine MAP020 to make it read your file format rather than mine.

The formatted maps have a header that must hold some basic information as described ABOVE FOR THE (UNFORMATTED) MFF. Header records have a format thAT consists of a 10 character record type identifier, followed by the required data.

The minimal required header records are:

The number of steps along each of the three directions in the map. This record has `STEPS` as record identifier.

The stepsize in these three directions. This record has `STEPSIZE` as record identifier.

The position of the first point in the map (the lower-left-bottom point) in fractional coordinates. This record has `ORIGIN` as record identifier.

The above parameters all refer to the map as it is in the file, if you do not have your map organized such that A, B, and C run along the fastest, medium and slowest running index in the map, you need to indicate how the map is organized. This record has as record indentifier `ORDER`. Thereafter to have to give X, Y, and Z in the order FASTEST, MEDIUM, SLOWEST running index in the map. So for example if you have plates of density with A as fastest running index (horizontal on the page if you read it), C as medium index (vertical on the page if you read it), and the map has plates of density along B, then you would give XZY.

If the coordinate file does not hold celldimensions, or the map does not belong to the read coordinates, you can add a celldimension record. This record Has as record identifier `CELL` and holds A, B, C, Alpha, Beta, Gamma respectively.

Title records have as record identifier `TITLE` but are neglected by WHAT IF.

There should be an empty line between the header records and the data.

The data has to be written at per plate of density. For every plate the plate number should be written as one line with format I6. The data of that plate will be read like:

      READ ((PLATE(I,J),I=1,NI),J=1,NJ)
      where:
      Plate is the density for one value of the slowest index.
      J     runs over the medium index
      I     runs over the fastes index
The data should be given as as many lines with format 6F12.0 as is needed to cover all points in one plate.

The top of a formatted map could for example look like:
TITLE               WHAT IF-X
CELL        36.18100  30.25300  35.80200  90.00000  90.00000  90.00000
STEPSIZE     2.01006   1.89081   1.98900
ORDER            XYZ
STEPS             18        16        18
ORIGIN      -0.20721  -0.16250  -0.33021

     1
 0.00000E+00 0.00000E+00 0.86000E+02 0.10000E+03 0.10000E+03 0.71000E+02
 0.10000E+03 0.10000E+03 0.10000E+03 0.10000E+03 0.10000E+03 0.92000E+02
 0.62000E+02 0.47000E+02 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00
 0.00000E+00 0.00000E+00 0.14000E+02 0.67000E+02 0.10000E+03 0.94000E+02
 0.10000E+03 0.10000E+03 0.97000E+02 0.88000E+02 0.10000E+03 0.10000E+03
 0.10000E+03 0.10000E+03 0.93000E+02 0.68000E+02 0.44000E+02 0.00000E+00
 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.72000E+02 0.10000E+03

Other map types

The program DN6MFF (present in the [...WHAT IF.MAP] menu can be used to convert DN6 style files to MFF style files. This program is written by Martin Noble. It works very simple: you will be prompted for the title line of the MFF file, and then everything goes automatic.

To read formatted files see the GETFMP command. I have given up trying to read every formatted map format that exists. Just edit the few lines with basic information that WHAT IF needs at the top of the map, and read it with this command.

Administration of maps

Crystallographers will probably understand the above section on the format of maps. Normal scientists do not have to worry about that, if you only use WHAT IF generated maps, then WHAT IF will do all the worrying for you.

The first time a map is read, this takes a while. A 100*100*100 grid point map will on a micro VAX-II be read in a couple of minutes. On VAX systems however, you will see that the second time you read a map, it will have been converted to internal WHAT IF format, and reading will take only a few seconds.

Reading maps

Reading an mff (GETMAP)

The command GETMAP will cause WHAT IF to read a map of the MFF type (see above). WHAT IF will read the map, figure out the scale factors, and then write the map out in internal format. Every next time you read this same map, reading will then only take a few seconds. To read maps you will only be prompted for the map name.

Reading a formatted map (GETFMP)

The command GETFMP will cause WHAT IF to read a formatted map. WHAT IF will read the map, figure out the scale factors, and then write the map out in internal format. Every next time you read this same map, reading will then only take a few seconds. To read maps you will only be prompted for the map name.

Reading a frodo map (GETDN6)

The command GETDN6 will cause WHAT IF to read a FRODO-style electron density map. WHAT IF will read the map, figure out the scale factors, and then write the map out in internal format. Every next time you read this same map, reading will then only take a few seconds. To read maps you will only be prompted for the map name.

Reading an xplor formatted map (GETXPF)

The command GETXPF will cause WHAT IF to read an XPLOR-style electron density map. WHAT IF will read the map, figure out the scale factors, and then write the map out in internal format. Every next time you read this same map, reading will then only take a few seconds. To read maps you will only be prompted for the map name.

Setting map parameters (PARMAP)

This command can be used to change map associated parameters. These parameters are the origin of the part of the map to be contoured, and the extend of this part. Also the contour levels (maximally 5 at present), and the colour per level can be changed. PARMAP allows for two ways to input the origin of the part of the map to be contoured. You will first see the question: Do you want to center on a residue. If you answer YES you will be prompted for a residue, and the alpha carbon of this residue will then become the new origin (in case you give something without an alpha carbon in it, just the first atom of that residue will be used). If you answer with NO, you will be prompted for orthogonal (cartesian) coordinates of the center of the part of the map that you want to contour. You will also be prompted for the extend of the map. If you want to see everything, just give very large numbers (eg 1000, 1000, 1000 Angstrom), WHAT IF will automatically check that you do not read outside the map boudaries.

Setting a default map (DEFMAP)

As explained above, WHAT IF can deal with many maps at the same time. However, only one map can be in memory at a time. Because of the very fast way of reading maps by WHAT IF, this is not such a problem, but the user needs to be able to decide which map resides in memory. The command DEFMAP will prompt you for the number of the map which should be in common. (The command SHOMAP gives a numbered list of available maps).

Writing out a map in mff style (MAKMAP)

This command writes the present default map out as a file according to the above described MFF format. The file name will be suggested to you, but you can overrule that. Also you will be prompted for the orientation of the map (1,2,3 or 1,3,2). These are the aforementioned parameters IDIRU,IDIRV,IDIRW. If you do not know what you are doing, give 1,2,3. The 1,3,2 option is mainly added for crystallographers (who understand this anyway) and for the not yet ready R2D2 option.

Writing out a formatted map (MAKFMP)

The command MAKFMP writes the present default map out as a file according to the above described formatted map format. The file name will be suggested to you, but you can overrule that.

Checking a map (CHKMAP)

This command checkes if a map on disk is properly formatted according to the MFF format description give above, and if the header parameters are internally consistent, and consistent with the contents of the data records. You will be prompted for the file name. There is no need to read the map first.

Deleting a map (DELMAP)

This command makes WHAT IF temporarily forget about a map. You will be prompted for its number. The internal representation of this map will stay on disk as a file. So you can always get the map back.

Initializing all maps (INIMAP)

The command INIMAP will remove all map information from WHAT IF's memory. You might want to use SAVMAP before you do this.

Directory of maps (SHOMAP)

SHOMAP will cause WHAT IF to show you which maps are presently available, and what map header parameters and contouring parameters go with these maps.

Saving map information (SAVMAP)

The command SAVMAP will cause WHAT IF to prompt you for a file name. All information related to maps will then be written in this file. You can later restore the present situation with RESMAP.

Restoring map information (RESMAP)

The command RESMAP will cause WHAT IF to prompt you for a file name. If you give it a file you earlier created with the SAVMAP command, then the situation with respect to maps will be set to what it was at the moment of that SAVMAP command. This include setting and reading of the default map.

Creating maps

Creating a surface map (SRFMAP)

The command SRFMAP will cause WHAT IF to create a map in which every grid point has a value corresponding to the distance to the nearest atom. This is very handy because contouring such a map at the proper level will create contours that correspond with the accessible surface for a certain probe size. You will be prompted for the molecule to use in the map generation. Thereafter you will be prompted for a probe size. This does not have to be the size of the probe of your interest, because every probe size between zero and the value you give are later available to WHAT IF. The CPU time needed to generate the map goes roughly linear with the probe size. WHAT IF will then show you a little table with probe sizes and the corresponding contour level. You can interpolate in this table in case you exact probe size is not in there. You will also be prompted for the resolution. The suggested (=default) resolution is set such that the computation will take roughly two minutes CPU on a micro VAX-II. A lower number than this default will create a finer grid, and therefore more precise contours. The amount of CPU time is a function of one over the third power of the resolution.

See Voorintholt et. al. J. Mol. Graph (1989) 7, 243-245 for an extensive description of the used algorithm.

Making a cavity map (CAVITY)

If you want to try to fill cavities in your molecule by mutating residues into bulkier residues, it is nice to know where large enough space is available to put in extra atoms. The CAVITY option will create a density map in which all non-zero points are inside small cavities. Cavities that could hold giant probes (diameter larger than 5.0 Angstrom) will not be indicated. After execution of the CAVITY option you should contour the map at level=1. The holes that are indicated are such that it is likely that an atom that has the right orientation with respect to the cavity volume can get a carbon attached to it. In other words, if a valine C-gamma is placed with the correct geometry towards this cavity, the valine could be mutated into an isoleucine.

Listing atoms near cavities (AACAVI)

The command AACAVI will do the same as the command CAVITY. However, AACAVI will at the end not produce nice density to look at, but rather will list all atoms and put a value in the last column of the output if this atom touches a cavity. If this last number on the atoms lines of the output is non-zero then that does not yet mean that you can start mutating here, but rather, if the value is zero, you can forget mutating at this position.

Searching cavities (SMLCAV)

The command SMLCAV does essentially the same as the command CAVITY. The difference is that SMLCAV will prompt you for a (little) box in space and it will then only calculate the cavities that fall within this little box. This way, a cavity found with the CAVITY option can be calculated with greater precission. Make sure that the whole cavity is contained in this little box.

Displaying maps

Contouring a map (GRAMAP)

GRAMAP will start the contouring process, and send the contours to a MOL-item. If there are too many vectors generated, intermediate results will be written to a MOL-item, and contouring will be continued. Be aware that you will have to use the PARMAP command first in order to get any sensible results.

If you use multiple contour levels, you will be prompted for one MOL-item per contour level while contouring progresses.

Colouring a map (GRACOL)

The option GRACOL will cause WHAT IF to prompt you for a range(s) of residues around which to contour. WHAT IF will then contour the present default map with the given parameters, but will only show those contour lines that have any of the atoms in the given range(s) as the nearest atom. Also, these contour lines will get the colour of this nearest atom.

Contouring a map in two dimensions (GRAXYZ)

With GRAXYZ you can contour in only one of the three orthogonal directions. You will be prompted for the primary direction (X, Y or Z) orthogonal to which the contouring will be done.

GRAXYZ will start the contouring process, and send the contours to a MOL-item. If there are too many vectors generated, intermediate results will be written to a MOL-item, and contouring will be continued. Be aware that you will have to use the PARMAP command first in order to get any sensible results.

If you use multiple contour levels, you will be prompted for one MOL-item per contour level while contouring progresses.

Other map options

Showing gridpoint values (DENMAP)

This is more a debug option. You will be prompted for gridpoints in space. The numerical values of these grid points will be shown at the terminal. Be aware that these are the values as they are internally represented. The following relations between internal byte representations (Bval) and the real map values (Rval) exist:

Rval = (Bval - IPLUS) / PROD
Bval = Rval * PROD + IPLUS

Where
PROD = 230.0 / {Max(Rval) - Min(Rval)} 
And 
IPLUS = - NINT {PROD * Min(Rval) + 115.0}
More density evaluation options will be found in the MASMAP menu. Be aware that usage of the MASMAP options requires a thorough understanding of electron density maps.

Values of 100 and above will be listed as 99.

Making an axis system (AXMAP)

The command AXMAP will cause WHAT IF to put a little axis system just outside the orrigin of the present default map.