INTRODUCTION The first part of this document is to introduce a principal math of calculating the lattice parametters of thin 3-d crystals, which is based on the Ca-ATPase 3-d crystal with C2 symmetry. The experimental data was collected by taking tilt series (5 - 7 films/crystal) from cryo-em, the increanments of each tilt was about 2-5 degree. All of the data has been processed by mrc program to refine the 2d parameters for each individual film. To calculate the 3-d lattice parameters, two more steps have to be done: 1) using program cstardir/cstarfit to obtain c* direction, real tilt axis and tilt angle on first film, and relative tilt axes and tilt angles of each films in the tilt series to untilted coordinator system. 2) using program linefit to calaulate the 3-d lattice parametters which includes a*, b* and c* (vectors). The second part will describe more detail about the programs, and how to use them. 1. PRINCPLE 1). C* direction searching. The goal of this program is to obtain the tilt axis of EM for each tilt series and C* vector direction, afterward, calculates the effective tilt axes and tilt angle of the films in tilt series, which are relative to the A* and C* in reciprocal space. The main point is that h,k of the reflections recorded by tilt series would be kept the same for the pile of films during the crystal was seriesly tilted. That means Rn(h,k,ln)-R1(h,k,l1)=(ln-l1)*Cn*, n=2,2,... 5 or 7 the Rn, R0 and C* are vectors in 3-d space. It is not nessecery for ln-l1 being integer. The Cn*(n=2,...5 or 7) were averaged to obtain one C* vector relative to the film coordinator system. The C* would be affected by tilt axis' choosing. All the reflections of electron beam suppose to fall on the lines which are along the C* direction, and cross (h,k,l0) on the first film (this is arbitrary, you can choose other film). Based on this theory, the theoretic reflection position recorded by films could be solved the equations of line (along c* direction) and planes (recorded by films) in 3-d space. Next step is to calculate the residue of observed reflections which are determined by a*, b* on each films in tiltseries and tilt angles and theoretic positions, and to do this, a big range of tilt axes was searched to find a tilt axis, which is corresponding to the minimum residue, and the tilt axis was supposed to be the real one relative to the first film's coordinator system. The new method is to use non-linear least square fit to calculate tilt-axis and c* direction, the program is called cstarfit, and it includes two maijor subroutines. The first one is called residue, which calculates the standard residue of observation and theoretic c* parameter, the princepl is similar to the old method, but just use a*, b* (not all the reflections), and tilt angles in a tilt series as input data. The second subroutine called lmdiff to do nonlinear least square fitting to minimize the residue. The program would outputs the final unit vector along c* and the tilt axis of EM goniemeter for the tilt series. Once the tilt axis of EM and C* have been obtained, next step is to calculate the effective tilt axes and angles for each film. The princeple is to use one tilt add another tilt, if you know the angle between two tilt axes, tilt angles, you can calculate the effective tilt axis and tilt angle. The first tilt axis is the cross line of first film and untilted crystal's a-b plne, it can be can calculated by fomula: alpha=arctan(cy*/cx*)+90.0 (degree) and the the tilt angle: delta=arccos(cz*/|c*|). The second tiltaxis is the EM goniemeter's tilt axis, and the tilt angle is read from goniemeter. To get the effective tilt axis and tilt angle, we can rotate the y-axis of the untilted system to the first tilt axis, tilt the crystal/film delta degree, then rotate the new y-axis called y'-axis) to second tilt axis, and tilt the crystal/film again. Finaly, rotate the coordinator system back. 2). Refinment of C*, A* and B*. This step is going to find a set of lattice parameters (A*,B* and C*) to fit the observation. Based on last step, the reflections which have the same (k,h) should fall on a line along C* vector, first of all is based on last step to search the peak center positions of the reflections, which are manually choosen falling into separated peaks, and the peak shape is assumed as a sinc function. The thickness of crystal can be choosen as different unit cells, the centers of the peaks are searched within a range, and the intensities of the peaks are released for best fitting. After having obtained the peaks' positions, the C* length could be calculated by using the peaks which have the same (h,k) but different l. Then the A* can be theoretically calculated by following formula: A*=[R1(h1,k,l1)-R2(h2,k,l2)-(l1-l2)C*]/(h1-h2) (in case of h1>h2,l1>l2) in which A*, R1 and R2 are vectors in 3d space, and k is kept the same for R1 and R2. Because l1 and l2 are unknown so far, we use m replace l1-l2, m=(-5,-4,...,4,5) to obtain a batch of possible A*'. A batch of possible B*' could be obtained by the same way, just exchanging h's and k's situation in above equation. Next thing is to find the real one set of A*, B* and C* which could fit all the observations. The formula A*=A*'+delta*C* in which A*'=[R1(h1,k,l1)-R2(h2,k,l2)-mC*]/(h1-h2), m=-5,-4,...4,5, delta=-0.5,....,0.5, is being used for searching the A*, the same way for B*, to find best fitting of A*, B* and C* for observation data, that gives the minimum residue between lattice positions (R=hA*+kB*+lC*) and the sync function peaks' positions . 2. INSTRUCTION FOR PROGRAM 1.) Program cstardir is for searching the tilt axis of EM with certain camera length and lenses current, which gives the minimum residue for the experimental data of tilt series, and calculates the effective tilt axes to a* in the reciprocal space coordinator system, in which the a-b* plane is x*-y* plane and c* is parallel to z*, and the tilt angles for the films in tiit series respectively. The input data includes (a) Tilt angle, a*, b* on each film which are obtained from mrc program pickauto (b) Reflection list files named as *.spt. (c) Tilt angles in tilt series The program will creat some files to store the input data they are calst - reflection data, sttheta - tilt angle, lattmeter - a* and b* translat is a* and b* parameter after rotated the y axis to em tilt axis. The control parameter (a) c* cutoff to control minimum z* used for calculating c* direction, but you can type 0.0. (b) Intensity cutoff was used to control reflections used for calculating, now just type 0. (c) Tilt axis, type in a estimated angle from tiltaxis to x-axis on film, for example, cm200-feg at 200 kv camera length at 2500 mm, tiltaxis was around 45 degree. (d) job is an integer to control read input data (e) The number of tilt axes to be searched. (f) Step size for searching tiltaxis, you can choose a large value for first time, and small value for second time. The output files are: (a) Unitcell, a*, b* on the first film, unit vector along c* relatted to first film, and tilt-axis, last one is the minimum residue of tiltaxes searched by the program. This data will be read by linefit. (b) Gunitcell lists all the a*, b*, unit vectors, tiltaxes and corresponding residues. (c) Rltltanax list the real tilt axex and tilt angles for each films in tilt series, the tilt axes are the angles of the projection of a* onto untilted plane and tilt axes, positive direction is from a* to b*. These parameters will be used merging. To run: (a) enter number of films in tilt series (b) control value for zstar, 0.0 - 60.0 (c) enter a reasonable value of the angle between tilt axis and x-axis. (d) if this is the first time to run the program, and have to enter tilt angles, a*, b* and reflection data, enter 1 (job=1). if you have type in tilt angle, and just need to type in a*, b* and reflections' data, enter 2 as job=2, if you have typed in a*, b*, and need to enter tilt angles and reflections' data type 3 in. if you have run this tilt series one time already, enter 4, go to next step. (e) control value for intensity, type 0 in. (f) control number for tiltaxis searching. (g) control value for searching stepsize. 2.) Program cstarfit's goal is the same as above program, but it is more powerful, this program calls a subroutine lmdif to do non-linear least-square fitting to find out c* direction and tilt axis. Input data includes: (a) All of a* and b* measured from each films of a tilt series, which now is read in from a data file called 'lattmeter', and has been transfered to C2 symmetry, the length unit is in pixel. (b) tilt angle also is read in from a data file called sttheta, using degree as unit. (c) Initial tilt axis, read in from key board in degree, the angle from x-axis to tiltaxis clockwise as positive. (d) x* and y* components of unit vector along c*, usually type in from keyboard 0.0 and 0.0. Output data (a) Tilt axis output on screen. (b) Unit vector along c* output on screen. (c) tltaxang is the file including (a) and (b) To run: (a) Type the number of films in a tilt series. (b) Enter the data file's name of tilt angle (c) Enter the file's name of a* and b* (d) type in tilt axis (in degree), the x, y components of the unit vector along c* direction. To obtain c*, tilt axis and final tilt angles and tilt axes for each films, we should run both cstardir and cstarfit: First run cstarfit to get c* and tilt axis of EM goniemeter, then run cstardir to get tilt angles and tilt axes for each film. 3.) Program linefit1 is a program to calculate the unit cell in reciprocal space, for 3d crystals. Subroutines included: (a) searchexp calculates the positions of all reflections in a tilt series, along c* lines, i.e. (h,k,z*) (b) Leastsq using linear least-square method fits sync-function to obtain peak's positions along c*. (c) abcstarcal roughly calculates the a*, b* and c* based on the theory described above (d) searchucl is for searching unitcell parameters (a*, b* and c*) around the values got from subroutine abcstarcal to obtain a minimum residue. (e) rvctout will output the observed peaks' coordinators in 3-d reciprocal space. Input data: (a) a*, b* measured from first film, and unit vector along c* are included in data file unitcell. (b) reflections list was stored in calst. (c) if you run the tilt series first time, you have to selecte the peaks by yourself, and at second time you can read in the peak positions from file peaknum, (d) reflections list used for calculating lattice parameter, if you run this tilt series first time, you should selecte the reflections youself, at second time, read from file hkrflct. Control data: (a) intensity cutoff is the amplitude limitation for the peaks (b) character n is used to control if you don't want to use reflections for fitting or you have selected the reflections. (c) character yes or no are used for controling first or second time processing the same tilt series. (d) c* increament is to set the searching stepsize along c*. Output data: (a) bestabc includes a*, b* and length of c*. (b) ucellvct lists the x, y, and z components of a* in 3-d space, c* and beta* which is the angle of a* and c* against residues. (c) residual table for peak's fitting, the file name can be choosen by user. (d) residr is the residual table for reflections' fitting. (e) acstarnew is the file having a*, c* and beta* obtained from reflection fitting. (f) angstrom lists the positions along c* direction against intesities for all the reflections in a tilt series along c* direction Creat a file for peaks choosen from cstarseries, the file name is peaknum with format 2I5,I6,2I5, and the title lists the spt file. To run: (a) type in the number of films in one tilt series. (b) enter thickness of the crystals, which is number of unit cell along c. (c) type in the amplitude cutoff. (d) type in the file name for output residual table (e) type in the title for the table (f) if you have selected the reflections for fitting, type in n or following the instruction appearing on screen. (g) if you run this tilt series first time, type in no, otherwise type yes. (h) enter the increament of c* for peaks' fitting, first time running, the increament should be bigger than 1/400 (enter a number less than 400), second time, can enter a number bigger than 400. (i) enter a* increament, 20 - 60 for first running, 40 - 100 for second time. (j) enter c* search range for reflections' fitting. (k) enter a* search range for reflections' fitting. (l) enter (h,k,l) to calculate the angle of c* and vector (h,k,l), if you want to stop, enter 100 0 0. ********************************************************* Programs used: cstarfit cstardir linefit tseriefit ********************************************************* To conver residual file to postscript format: 1. generate a residual file by linefit program 2. run residimg to convert ASCII file to MRC file, you can routate the image by shifting x and y 3. use pltresid to convert MRC file to countor map To plot tilt series *.spt file: 1. run tseriesfit, which generates a file called tseriesfit.plt to plot tilt series, this program will read a data file of reflections intensities, positions along c* and hk0 position, in current case, the file name is called positions generated by linefit. 2. convert tiltseries.plt to postscript format by running mrcplt2ps program.