Masks made easy

Gerard J. Kleywegt & T. Alwyn Jones
Department of Molecular Biology
Biomedical Centre, Uppsala University
Uppsala - Sweden

One of the prerequisites for using density-modification techniques (such as solvent-flattening and NCS-averaging) is the availability of a high-quality molecular envelope. We call these envelopes "masks" and use them in our local set of density-averaging programs (1,2). A mask is a "logical print" of the molecule on a grid which has points set to "1" if they are inside the molecular envelope, and to "0" otherwise.

Up until recently, masks were typically generated from a PDB or BONES file and subsequently edited with "O" (3). This editing process tended to be tedious and time-consuming and many users were less than fond of it. We therefore wrote a new program, called MAMA (MAsk MAnipulation) with which masks can be generated within seconds and turned into high-quality envelopes within the hour.

Masks can be generated in three ways with MAMA:
1 - from a PDB file
2 - from a BONES file
3 - from one or more existing masks
In the first two cases, each (BONES) atom gets a radius associated to it, and all grid points which lie within this radius from the atom's position are included in the mask (i.e., set to "1"). The third option enables users to "recycle" good masks and even to carry them over from a structure in one spacegroup to, for example, a mutant structure in a different spacegroup.
A unique feature of MAMA is that it is able to transform a mask into a different spacegroup, unit cell, and/or position while keeping the volume of the mask virtually constant (typically, within 0.3 %). This feature is a conditio sine qua non for multiple- spacegroup averaging where one wants to edit a mask in all two, three or more spacegroups and therefore requires a convenient mechanism to move the mask from one spacegroup to the next with as little distortion as possible. Alternatively, one may for instance combine two monomer masks into one large dimer mask, etc. Some of the operations which have been implemented to combine masks are: AND, OR, XOR, BUTNOT and UNITE (see Figure 1).

We define a "high-quality mask" as one which:
a - covers (almost) all atoms in the molecule(s)
b - has no internal voids
c - has no "droplets" which are not connected to the bulk of the mask
d - is fairly smooth
e - does not extend too close to the borders of its grid
f - has little overlap with (non-) crystallographically related copies of itself.
MAMA contains options which check criteria (a) and (e). Internal voids (b) and isolated "mask droplets" (c) can also be removed automatically by MAMA. Criterion (d) can be assessed by visual inspection with "O" or by calculating the surface-roughness of the mask with MAMA. In order to make a mask smoother (and larger) or rougher (and smaller), simple binary-image processing techniques have been implemented (in particular, EXPAND and CONTRACT operations; see Figure 2).
MAMA also contains an option to remove overlap areas, i.e. parts of the mask which overlap with some (usually) other part of the mask due to (non-) crystallographic symmetry (see Figure 3). Of course, the "final touches" to a mask will often still be applied within "O" (for example, making room for insertions and sidechains in a mask generated using a molecular-replacement search model). Nevertheless, the generation of a high-quality mask, using MAMA and "O", has become a simple exercise which can be carried out within one or two hours (see Figure 4).

After MAMA had been written, it turned out that the program has a number of unexpected additional capabilities:
- clever use of the image-processing and logical mask operations enables emulation of Delaney's cavity-detection program (4); see Figure 5.
- the overlap-removal option produces an "overlap map" which may be contoured in "O". This can be used to detect inter- molecular contacts due to (non-) crystallographic symmetry.
- by generating masks around two different, but aligned, molecules, one may assess the similarity of the two molecules' shapes: SI = Nab / SQRT (Na * Nb), where Nab is the number of points which both masks have in common, Na is the number of points in mask A and Nb in mask B; see Figure 6.

MAMA is part of a forthcoming averaging package, RAVE (2), which will accompany "O". For more information, contact TAJ (E-mail: "").

(1) T.A. Jones, "a, yaap, asap, @#*? A set of averaging programs", in "Molecular Replacement" (E.J. Dodson et al., Eds.), SERC Daresbury Laboratory (1992), pp. 91-105.
(2) G.J. Kleywegt & T.A. Jones, "Convenient single and multiple-crystal real-space averaging of macromolecular electron-density maps", to be published.
(3) T.A. Jones, J.Y. Zou, S.W. Cowan & M. Kjeldgaard, "Improved methods for building protein models in electron density maps and the location of errors in these models", Acta Cryst. A47 (1991), 110-119.
(4) J.S. Delaney, "Finding and filling protein cavities using cellular logic operations", J. Mol. Graph. 10 (1992), 174-177.

USF Latest update at 12 February, 1998.