A Real-Time Interactive Graphics Program to Determine Crystal Orientation for the. Analysis of Oscillation Diffraction Photographs. BY PHILIPPE DUMAS AND ...
28
J. Appl. Cryst. (1986). 19, 28-33 A R e a l - T i m e I n t e r a c t i v e G r a p h i c s Program to Determine Crystal Orientation for the A n a l y s i s o f Oscillation Diffraction P h o t o g r a p h s BY PHILIPPE DUMAS AND RAYMOND RIPP*
Laboratoire de Cristallographie Biologique, Institut de Biologie Molkculaire et Cellulaire du CNRS, 15 rue Renk Descartes, 67084 Strasbourg, France (Received 24 June 1985; accepted 20 September 1985)
Abstract This paper describes a powerful preliminary to various least-squares programs for finding the exact crystal orientation for the oscillation method. It is well suited to cases of large initial misorientation. It uses the realtime rotation and clipping capabilities of the highperformance graphics system PS300 from Evans & Sutherland. A program has been written that performs a geometrical inversion of reciprocal space through its origin and manipulates this transformed image in place of the direct one. The Ewald sphere is thus transformed into a plane that can be superimposed on the film. The crossing of any reciprocal-lattice point through the Ewald sphere is then replaced by the crossing of its transform through the film plane. Clipping allows elimination of all the points too far away from this plane, i.e. those that are not in a diffraction condition. Determination of the correct orientation is achieved by superimposing the inverted reciprocal-lattice image on the corresponding transformed image of the observed film.
Introduction The oscillation method is the most widely used recording technique in.protein crystallography. It is the only one applied so far to large-cell problems or when synchrotron radiation is used as a primary beam. Up to now this technique has almost always been used with photographic recordings, although 2D detectors will probably be used in the future. Whatever the method, it is absolutely necessary to know, as precisely as possible, the crystal orientation. In the case of well defined external crystalline morphology, it can be attained optically within a few degrees before any X-ray exposure. It is, however, very difficult, and often impossible, to achieve this with many crystals, especially those with high symmetry. Numerous still exposures are then required to determine the crystal orientation. However, in all cases, it is highly desirable
*Drpartement Informatique de l'Universit6 Louis Pasteur, 7 rue Ren6 Descartes, 67084 Strasbourg, France. 0021-8898/86/010028-06501.50
to minimize, as much as possible, the radiation damage incurred during the preliminary crystal setting: for some compounds the lifetime of the crystals in the beam is so short that only one good exposure can be recorded. This care has been explicitly formalized in the so-called 'American method' (Rossmann & Erickson, 1983) where crystal orientation is determined by 'measuring the lengths and orientations of the major axes of the ellipses on two ... still photographs'. We present here an alternative method to solve the problem that does not require any preliminary exposure to determine crystal orientation. We first made use of our colour graphics system for a matching procedure based on visual inspection of the observed and calculated diffraction patterns. The necessity to compute the calculated patterns on the host computer made an interactive process rather slow and prompted us to search for a true real-time procedure. This method is described as follows.
Principle of the method The PS300 can translate, rotate and scale in real time objects made of as many as 40000 vectors. Furthermore, it can modify the appearance of an image by the use of clipping planes. For example, one may decide to clip all vectors or points out of the volume delimited by a front and a back plane, so only the portions of the image falling between these two planes are visible. It should be emphasized that clipping planes are adjustable in real time as well. It is therefore obviously desirable to apply a geometrical transformation upon the reciprocal lattice (RL) and the Ewald sphere (ES) to change the condition of reflection for each reciprocal-lattice point (RLP) from crossing a sphere into crossing a plane. A simple way of transforming a sphere into a plane is an inversion through a pole belonging to the sphere. By choosing the RL origin O as the pole, and a proper inversion parameter, the ES is transformed into the plane of the film. Furthermore, with such a pole, rotating the RL and inverting it is equivalent to rotating the previously inverted RL. At this point, we can easily use the clipping capabilities to display on the screen, at any time, only those RLPs situated near © 1986 International Union of Crystallography
29
PHILIPPE DUMAS AND RAYMOND RIPP
to this plane. As a consequence, only the RLPs corresponding to a spot on the film will be visible. In the case of a correct orientation of the RL, the static 'inverted' film image and the moving inverted RL image superimpose. Obviously, this description is rather idealistic because of some practical drawbacks. These will be considered in the following sections.
Geometrical description and precision of the method For the system of coordinates X, Y, Z in which the crystal orientation is defined (Fig. 1) we have chosen Wonacott's conventions (Arndt & Wonacott, 1977). The unknown parameters, determining the true orientation matrix R, are taken as the rotation angles ~Px, q)y, (Pz about the axes 0X, 0Y, 0Z defined by R = RzRyRxRO,
(1)
where R0 is the given initial orientation matrix and R x , Ry, R z the rotation matrices corresponding to the angles (Px, (Py, (Pz. The ES radius is taken as D/2, where D stands for the crystal-to-film distance C H , thus defining a unit of length in reciprocal space. This, in turn, determines the inversion parameter as p=OH.OH=
-D2/2,
(2)
where the bar stands for the algebraic value of the segment. Thus, any point M is transformed into m' so that M, O, m' are aligned and O M . O m ' = p.
(3)
circles that do not pass through the origin are transformed into circles. Straight lines passing through the origin are unchanged, while circles are transformed into straight lines. Fig. 2 shows an example of a film and of its inverted picture illustrating all these properties. Because of this inversion, the accuracy of both the crystal-to-film distance, D, and the coordinates of spots obtained after film scanning is of most importance. Coordinate errors are taken into account by displaying small rectangles instead of points. Error in D is easy to detect and to correct. By differentiating (5), we get d ( H m ' ) / H m ' ~- 2d(D)/D = est.
It is seen that, for a given film, an error in D leads to an incorrectly transformed film picture simply deduced from the correct one by a scaling. If that is the case, one notices immediately that almost all the RL inverted points fall outside the rectangles of error. The straightforward solution is a rescaling of the film image alone after fixing the origin. This is done by attaching the corresponding scale factor to a dial on the PS300.
The problem of clipping The availability of real-time clipping cannot be overemphasized with regard to the practical usefulness of this method. The possibility of removing the inverted RLPs that fall too far from the plane of the film provides a good illustration of the continuous motion
In the case where M lies on the ES, its transformed m' lies on the film. If we want to compare the RL image with the film it is straightforward to show that we have to apply on each spot m (corresponding to the RLP M) the following transformation leading to m': H m ' = - D Z / [ H m (1 - tan20)].
(6)
//
(4)
Because the term tan20 is always small, the transformation to be applied on the film is close to the planar inversion: ( E S ) ~
Hm'~_ - D 2 / H m .
(5)
This simplified form (used only for the following discussion) easily allows a few important points to be stressed. At low resolution the approximation is excellent and the distance H m ' is nearly proportional to the lattice plane spacing d (Angstr6ms). The result is an inverted picture of the film: low resolution on the outside, high resolution on the inside. However, some simple rules simplify the recognition of different features from the original film. Since the transformation (4), which is actually used, is nearly a planar inversion through the film origin H, straight lines and
Fig. 1. Geometrical description of the method. The trace of the ES and of the film are displayed; CH: crystal-to-film distance D; O: origin of the RL; CO: radius of the ES taken arbitrarily as D/2; M is a R L P crossing the ES giving a spot m on the film; m' is the transform of M by the inversion. Hm' is nearly proportional to the resolution (in Angstr6ms) of the R L P M. To determine which RLPs are likely to cross the ES during oscillation, the RL orientation is defined with the following axes: X along X-rays, Y vertical, Z horizontal (axis of oscillation).
30
A REAL-TIME INTERACTIVE G R A P H I C S P R O G R A M
of these points through the ES while the crystal is rotating. We wish to determine which clipping it is necessary to use in order to simulate accurately the effective size of the RLPs or, expressing this in another way, the effective thickness of the ES. Several factors must be taken into account to determine it: mosaic spread, wavelength spread and finite source size (Arndt & Wonacott, 1977, p. 7). Both mosaic spread and finite source size give rise to an infinite number of possible ES, all rotated from the ideal one around the RL origin O by an angle /~ whose value lies between zero and a maximum of about 0"2° for synchrotron radiation• The wavelength spread, 62/2, is of the order of 0-1% and can be described by an infinite number of homothetic ES with O as centre. These situations are easily described in the
frame of our transformation, the former giving rise to a set of planes passing close to the point H and enveloping a flat cone (Fig. 3a), the latter to two planes parallel to the film and separated by (D/2)(62/2) (Fig. 3b). If the latter situation is exactly described by a double plane clipping, it is seen that it is impossible to account in the same way for crystal mosaicity over the whole resolution range. However, this can be overcome by choosing a depth of clipping h proportional to the distance between the centre H and the zone of interest. This is done by attaching to the mean radius r of a circular window (governed by a dial) the value h(r) given by (Fig. 3a):
h(r) = 2 tan(/~)r ~ 2pr.
(7)
Finally, the two effects are taken into account by
considering for h(r) the relationship (8)
h(r) = 21ar + (D/2)(62/2).
The angular mosaic spread /~ can be modified independently in real time with another dial. In this manner, considerable flexibility is preserved. The only real problem that cannot be ruled out is a deficiency when the depth of clipping is too narrow• In
'1/
(a) 0 •
° •
•
....
°
0
1
?. ..
••
(a)
..
t~
%
a
(b) Fig. 2. (a) Untransformed image of a film, spots are represented by circles independent of their intensity. For each spot the position is taken as the geometrical centre of rasters corresponding to an optical density above a background threshold. The origin is represented as a black circle. Maximum resolution is 4"5 A. (b) Inverted image of the same film. Notice how the circle passing through the origin in (a) is transformed into a straight line while the others remain circles. The error limits of the scanned coordinates of a spot m are shown by a rectangle around m'. Its size depends mainly upon its distance from the origin H (black circle), while its orientation is always the same relative to the line Hm'. In this case, the rectangles oferrors were calculated by considering an error of 0.01 cm (i.e. one scan step) on both coordinates. It has to be kept in mind that the geometrical inversion results in an upside-down image compared to the original film, with low resolution on the outside and high resolution on the inside.
(b)
Fig. 3. (a) Geometry of the clipping corresponding to broadening of the ES due to both mosaicity and finite source size. Two extreme limiting spheres, rotated from the ideal one by /a and -/~, are displayed (see text)• Such a rotation acts in exactly the same way in the inverted space, so that these two spheres are transformed into the rotated film planes about O. Since the angle/1 is small these planes pass very near to H. The figure has revolution symmetry around C H so thai the clipping that should be considered is the one defined by the volume outside a flat cone. Such a clipping is impossible to achieve, so one simulates it by defining a circular window of mean radius r in which clipping is nearly correct. The corresponding depth clipping is given by h(r) = 2t~r. Both the radius r and the angle/~ can be modified in real time by attaching their value to a dial. (b) Geometry of the clipping corresponding to broadening of the ES due to the chromaticity defined by 62/2. This wavelength spread corresponds to an infinite number of homothetic ES all passing through O. The limiting spheres are transformed into two parallel planes equidistant from the film and separated by `5R = 13( 1/;t)l = ,52/2.2 = R,52/;t = (D/2)(,52/2). This kind of situation is mimicked precisely by the graphic system's plane clipping•
PHILIPPE DUMAS AND RAYMOND RIPP such a case a deformation of the displayed image is observed that is due to the PS300 internal coordinates representation. The three coordinates of each point are stored as a 16-bit mantissa (five to six significant decimal digits) sharing the same eight-bit exponent. As a consequence, when the individual components X, Y, Z of a coordinate location differ significantly, the normalization to a common exponent decreases the precision of the one having the smaller magnitude. Unless this problem is technically solved, the method does not appear to be applicable at high resolution where very thin depth clipping is required. This problem is already noticeable when working at low resolution (with a mosaicity of 0.2°), but is really very significant when looking at zones above 5 A resolution. At first sight, this may appear to be a serious limitation of the technique, but on closer examination it is mitigated because of two reasons. Firstly, the main interest of the method lies in its efficiency in putting right large crystal misorientation and, to do that, low and medium resolution only are concerned. Furthermore, even when the image is significantly affected by deformations, it is still possible to work efficiently by looking at the gross features (disk,
straight lines, circles) as a whole and not at each point separately. Once a correct clipping has been determined a final problem has to be solved. Many RLPs are continuously entering or exiting the ES while the crystal is being oscillated: their image is thus continuously appearing on or disappearing from the film. For obtaining the same 'time summation' effect as with the real photograph, it is insufficient to display a single image corresponding to a mean orientation. So the oscillation angle is divided into n steps (we use n = 5 for a whole angle of about 1°) and n + 1 pictures are simultaneously displayed, each of them corresponding to a very small oscillation angle. The result is excellent in the case of a reasonable number of points, but if this number increases, so does the screen flickering, which can become very unpleasant. In such a case, one is forced to switch off this possibility. It is thus necessary to display each orientation one after the other by pressing a button on the keyboard. It should be noticed that, if the 'ad hoc planes' method described below is used, the number of points lies within such limits (between 5000 and 10 000) that this drawback is largely acceptable, if not completely absent.
h o s t ~1"] computer I terminal
31
ROTATION OF THE INVERTED
RECP I ROCALSPACE
I
_L.
co,o.,
I
screen
/~dials
/ l /
I
~.
I\~MODIFICATION OFTHEMOSAICITY ~PARAMETER
P,R vectors
i
I
question ?
~
orientation matrix
>
/
IPr°cess°rF--~
/
REINITIALIZATION
/SAVING
OF THE
OF AN ORIENTATION
DIFFERENT ORIENTATIONS SIMULATING THE WHOLE RANGE OF OSCILLATION ANGLE
Fig. 4. Flowchart of the program. "A-host computer: VAX 11/750, I, F, R, P, A, N, S are the initials of the different options one can call from the host computer. I: reading of numeric input data (cell parameters, crystal-to-filmdistance, initial orientation matrix etc.). F: calculation and downloading of the 'inverted' film spots. R: calculation and downloading of the inverted reciprocal-lattice points ('batch' method). P: calculation and downloading of the inverted reciprocal-lattice points belonging to specific planes (ad hoc planes method). A: reading of the orientation matrix from the PS300 and calculation of the corresponding q~, q~y,q~=angles. N: reading of the orientation matrix from the PS300 and calling of the option R to obtain a new inverted reciprocal-space image. S: Stop.
32
A REAL-TIME INTERACTIVE GRAPHICS PROGRAM
Use of the method: downloading of the RLPs to the graphics system Despite the high capacity of the PS300 concerning the number of points it can handle, it is unrealistic to display an image containing the total number of RLPs within the resolution limits given by a normal film recorded with a large-unit-cell crystal. For example, for low- and medium-resolution data from tRNA (Asp)-aspartyl tRNA synthetase complex crystals in the orthorhombic form ( a = 2 2 2 , b=206"7, c = 137"5,~, maximum resolution 4-5 A) (Moras et al., 1984, and references therein), up to several hundred thousand RLPs would have to be considered. It is necessary to sort out in advance those reflections that are likely to cross the ES, by taking into account the supposed orientation, the amplitude of probable errors in this orientation and the oscillation angle. This is done with a specific part (option R) of the Fortran program (Fig. 4). The algorithm divides the RL into elementary bricks to avoid testing each reflection separately: if one brick centre is found to be too far away, all the reflections within it are rejected. With this method, for the above crystals, one obtains a set of about 20 000 points if angles of misorientation are in the range 2-5-3 ° about X, Y, Z axes. In the case of greater errors it is better to decrease the resolution limits. This method could be referred to as the "batch method'. If the crystal is grossly misoriented, the number of points that should be considered is far too large and it is necessary to use another method to determine which RLPs are to be downloaded to the graphics system. An alternative way, which could be referred to as the 'ad hoc planes' method, is to identify which kind of RL planes give rise to the different features seen on the film. For example, in the case of the pattern displayed in Fig. 2(a), the. planes corresponding to the different lunes and to the small disk are easily recognizable as (h, k, n) with n = + 1 or - 1 for the disk, n = 0 for the first lune, etc. So it is clear that the RLPs belonging to the planes h, k, - 1 ; h, k, 0; h, k, 1 are the only ones likely to be transformed respectively into the disk, the horizontal straight line and the large circle shown in Fig. 2(b). This method is advantageous for the number of points that are to be downloaded to the graphics system. Another part of the Fortran program (option P) allows selection of such planes and, more generally, of any kind of RL planes (Fig. 4). Once a first orientation has been determined, one could imagine refining it with the 'batch' method, using a small amplitude of error. Our experience shows that this iterative procedure (option N), though always possible, is not necessary in practice. Furthermore, precision was found to be good enough to permit using only a part of all the necessary RL planes. For example, considering again the case shown
in Fig. 2, there is no particular advantage in downloading all the planes necessary to reproduce the whole film. Thus, the second method (ad hoc planes) is the most useful. Whatever method for initial homing in on film orientation, the different refinement procedures (Arndt & Wonacott, 1977; Rossmann, Leslie, AbdelMeguid & Tsukihara, 1979; Wincler, Schutt & Harrison, 1979) can be used subsequently.
Results This program has been successfully used to determine the crystal orientation for one film of the tRNA(Asp)-aspartyl tRNA synthetase complex in a case where it was initially unknown. The ad hoc planes method was used after the b* alignment in one direction had been recognized and, in the perpendicular direction, a spacing corresponding to a * + c*. Only the planes of type (h, k, ! = h + n), with n = - 1, 0, +1, were taken into consideration. This procedure allowed a very fast orientation determination. The angles ~Px, ~Py, ~Pz consequently found were within 0-1, 0.15, 0.01 ° of their final refined values. In order to check the intrinsic accuracy of the method we tested it by considering films for which an accurate orientation had been determined earlier. We could thus use the best values, obtained after refinement, for all the significant parameters: crystal-to-film distance and cell parameters. We found in most cases an orientation corresponding to angles ~Px, %. and ~p~ at less than 0-1 ° from their refined values. The authors thank J. Blacker, D. Moras, B. Rees and J. C. Thierry for skillful reading of the manuscript. They are especially indebted to J. Cavarelli and to J. C. Thierry for stimulating discussions that permitted them to debug the program. This research was supported by grants from the Centre National de la Recherche Scientifique (CNRS), the Minist6re de l'Industrie et de la Recherche (MIR) and the Universit6 Louis Pasteur, Strasbourg.
APPENDIX Programming considerations All the code specific of the host computer is written in VAX Fortran 77. Very little change would be necessary to match it with another computer. All the codes specific to the PS300 are stored in disk files. These are simply copied from the host computer to the PS300 prior to any running of the program. Fig. 4 describes how the computation is divided between the host computer and the PS300. The program is available on request from the authors.
PHILIPPE DUMAS AND RAYMOND RIPP References
ARNDT, U. W. ~ WONACOTT, A. J. (1977). The Rotation Method in Crystallography. Amsterdam: North-Holland. MORAS, D., DUMAS, P., THIERRY, J. C., WESTHOF, E., LORBER, B., EBEL, J. P. & GIEGE, R. (1984). Natural Products Chemistry, edited by R. I. ZALEWSKI ¢Yg J. J. SKOLIK, pp. 407-419. Amsterdam: Elsevier Science Publishers.
33
ROSSMANN, M. G. & ERICKSON, J. W. (1983). J. Appl. Cryst. 16, 629-636. ROSSMANN, M. G., LESLIE, A. G. W., ABDEL-MEGUID, S. S. TSUKIHARA, T. (1979). J. Appl. Cryst. 12, 570-581. WINKLER, 1~. K., SCHUTT, C. E. & HARRISON, S. C. (1979). Acta Cryst. A35, 901-911.