6. Averaging of cathepsin-B The procedure described below minimizes the `human' work of refinement, which in turn should minimize editing errors and reduce the overall time needed to 'execute' the task. The input data in this case were the model's atomic coordinates (RCB.RDI), the cell constants and crystal symmetry operations (HEAD.RMAP), and the reflection file with Fobs ([-.DAT]CBRANA100.FAO). In order to start the averaging procedure parameters for the local symmetry transformations, the mask(s), and an initial electron density map are required. 1.1. Local symmetry parameters Since the positions of all three molecular models in this case are related by so called improper local symmetry, we have to prepare 6 rotation matrices and translation vectors relating each pair of the molecules (1-2, 2-1, 1-3, 3-1, 2-3, 3-2). The local symmetry translational and rotational parameters required to average the density from equivalent areas are obtained from the atomic model by a RMS fitting procedure, where different molecules are rotated and translated so that the RMS deviation of the distances between the atom pairs of the two molecules is minimized. The following command file (RMS.COM) calculates the required rotational matrices (3x3) and translational vector for all six possible transformations between the three different molecules and stores the resulting rotational matrix and translational vector in the file RMS.DAT assigned to unit 10. For computational efficiency, only CA atoms were included in the fitting procedure. The default center of rotation is set to coordinate system origin (0.0, 0.0, 0.0). RMS.COM: $ main > read file rcb_040.rdi coordinates diamond > key ca select atom name CA end > key mol_1 select sequence 7 212K end > key mol_2 select sequence 307 512K end > key mol_3 select sequence 607 812K end > open unit 10 file rms.dat write > rms coordinates all select mol_1 .and. ca end select mol_2 .and. ca end > show unit 10 rms matrices > rms coordinates all select mol_2 .and. ca end select mol_1 .and. ca end > show unit 10 rms matrices > rms coordinates all select mol_3 .and. ca end select mol_1 .and. ca end > show unit 10 rms matrices > rms coordinates all select mol_1 .and. ca end select mol_3 .and. ca end > show unit 10 rms matrices > rms coordinates all select mol_3 .and. ca end select mol_2 .and. ca end > show unit 10 rms matrices > rms coordinates all select mol_2 .and. ca end select mol_3 .and. ca end > show unit 10 rms matrices > quit The file RMS.DAT serves as an input to the MAKE_TRAN procedure, $ @MAKE_TRAN RMS.DAT which prepares the files [-.SET]SET_MATR_*_TO*.COM files. These are read by ROTA_MAPS.COM, defining the rotational matrix and translational vector for each particular density transformation. MAKE_TRAN.COM: $ ass/user 'p1 for001 $ r make_tran The program MAKE_TRAN.EXE reads the file RMS.DAT and creates the SET_MATR... files. The source code of the MAKE_TRAN.FOR must be tailored for each problem separately (the list of molecule pairs in the character array) so that the rotational matrices and translational vectors are stored in the correct file names. MAKE_TRAN.FOR: program make_tran character*132 filnam, rd_line character*6 list(6) data list / '1_to_2', '1_to_3', '2_to_1', * '2_to_3', '3_to_1', '3_to_2' / c do 1 ii = 1, 6 filnam(1:16)='[-.set]set_matr_' filnam(17:22) = list(ii) filnam(23:26) = '.com' open( unit=2, file=filnam(1:26), status='new' ) do kk = 1,14 read( 1, '(a132)', end=2 ) rd_line end do write( 2, * ) ' set mat 2 number -' read( 1, '(a132)', end=2 ) rd_line write(2,*) rd_line(40:72), ' -' read( 1, '(a132)', end=2 ) rd_line write(2,*) rd_line(40:72), ' -' read( 1, '(a132)', end=2 ) rd_line write(2,*) rd_line(40:72) read( 1, '(a132)', end=2 ) rd_line read( rd_line( 50:82), * ) xt, yt, zt write(2,11) ' set variable xt', xt write(2,11) ' set variable yt', yt write(2,11) ' set variable zt', zt 11 format( a12, f12.5 ) write(2,*) ' return' close ( unit = 2 ) 1 continue stop ' O.K.' 2 stop ' END OF FILE ?' end 1.2. Masks Masks are created from the current atomic models. A map for a mask must be placed so that the volume filled by each molecule can be completely contained within it. The borders of a map are specified in grid coordinates. The borders are defined for each molecule separately and automatically during the MAKE_MASKS.COM procedure. Molecular cartesian coordinates are converted to grid coordinates. Their borders (minimum and maximum value) are increased by 8 to 10 grid points. The number of added grid points should sufficient to cover the whole space inside the region of applied atomic radii. MAKE_MASKS.COM: $ main > read file rcb_040.rdi coordinate diamond > key mol_1 select sequence 7 212K end > key mol_2 select sequence 307 512K end > key mol_3 select sequence 607 812K end First the atomic coordinates are read from the file rcb_040.rdi. The coordinate file in this case is in Diamond format. Then each molecule is assigned to a KEY (mol_1, mol_2 and mol_3). The assignment is done on the bases of their sequence names (7 212K, 307 512K and 607 812K). >read file head.map map number For conversion of orthogonal atomic coordinates to grid coordinates and the selection of the appropriate grid size, the origin of a map and its size must be known to the program. The cell constants, the number of grids per unit cell length and the crystal symmetry operations are read from the file HEAD.RMAP. The file HEAD.RMAP is a header of a density map with only one grid point. The file is ASCII and can be edited. HEAD.RMAP: 0.59980E+02 0.12801E+03 0.59120E+02 0.90000E+02 0.12147E+03 0.90000E+02 60 120 60 0 0 0 1 1 1 2 1 1.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 2 -1.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 -1.000 0.000 0.500 0.000 -0.54990E+01 0.54704E+01 0.43018E-01 1111 The first line contains the cell constants (a, b, c, alpha, beta, gamma) written in 6E12.5 format. The second line contains 3 groups of 3 integer numbers. The first group specifies the number of grid points per unit cell length, the second the origin of the map in grid coordinates and the third the size of the map in grid points. The tenth integer is the number of crystal symmetry operations which follow in the subsequent lines. The second line integers are written with the (10I5) format. After the symmetry operations, the minimum and maximum value of the map grid points and the accuracy of the character*1 maps are specified. All this is followed by the grid points values that are written in Z layers with X index changing fast and Y index changing slowly. The character*1 maps are written with (80a1) format and real*4 maps with (20a4) format. Masks for each molecule are created separately. After reading the first map \\ (HEAD.RMAP) in the floating format (real*4), the second map is created from it by copying the cell constants, grid sizes and numbers and symmetry operations. The values of all grid points in the newly created map 2 are set to -9999 (the input is an integer which is converted by the program to real*4). The grid points with values below -9999.0 are empty points. Map 2 is derived from map 1 (the header) by expanding 10 grids around the selected atoms. The grid points closer then 4.5A to any selected atom (mol_1, mol_2 or mol_3) are masked (grid point values are set to 9999.0). The resulting masks are then stored (written) to the files (MASK_01.RMAP, MASK_02.RMAP, MASK_03.RMAP) for each molecule respectively. (When using character*1 maps, then the map should be initialized to 0 and the masked grid points obtain the value 255.) > make map 2 from 1 initialize -9999 around 10 atom 4.5 select mol_1 end > write file mask_01.rmap map 2 > make map 2 from 1 initialize -9999 around 10 atom 4.5 select mol_2 end > write file mask_02.rmap map 2 > make map 2 from 1 initialize -9999 around 10 atom 4.5 select mol_3 end > write file mask_03.rmap map 2 > quit The MAKE_MASKS.COM procedure can be included in the DO_ALL.COM procedure. 1.3. Electron density Initial electron density is calculated from the model using FFTFC_ATOM.COM and FOURIER.COM command files which are already part of the usual procedure enclosed in the DO_ALL.COM. The procedure is supposed to run in batch mode in the directory created so that only one version of a file is allowed. Otherwise it is easy to exceed the disk quota or to fill the disk. DO_ALL.COM is a command procedure that calls each particular step in cyclic averaging and controls the resolution ranges and number of cycles. Each command file included in DO_ALL.COM is taking the input from the results of the previous command file. The LOOP: is the starting label for the cyclic averaging and is repeated 7 times. The loop counter variable is II. The label HERE: serves as a auxiliary label for the cases of errors and program or computer crashes. With GOTO HERE: execution of the procedure can continue at the place where it has crashed. In the following directories\\ MAIN$EXA:[AVER.CATHB.REAL_LONG],\\ MAIN$EXA:[AVER.CATHB.REAL_FAST],\\ MAIN$EXA:[AVER.CATHB.CHAR_LONG] and\\ MAIN$EXA:[AVER.CATHB.CHAR_FAST]\\ command files for different procedures are stored. The REAL and CHAR denote use of real*4 and character*1 maps, while the LONG and FAST denote the kind of procedure. By the LONG one, density of each separate molecule is averaged, while by the FAST one, density on place of only one molecule is averaged and the other are derived by transforming the averaged density to the areas of other molecules applying local symmetry operations. The example for REAL_LONG is described in detail. The others (REAL_FAST, CHAR_LONG and CHAR_FAST) are described only at the places where they differ from the REAL_FAST procedure. 1.2. REAL_LONG procedure DO_ALL.COM: $ setup protein $ cd main$exa:[aver.cathb.real_long] $ ii = 0 $ !goto here $ !cd [-.mask] $ !@[-.mask]make_masks ! make masks (only the first time) $ !cd [-.real_long] $ $ @[-.create]create_p1sf ! prepares the command input for P1SF (FFTFC.COM) $ @[-.create]create_merge ! prepares the command input for PROTEIN $ ! (phase merging) $ @fftfc_atom ! calculates Fcalc and phases from the model $ ! and merges them with Fobs $ @fourier ! calculates the electron density map $ !here: $ loop: $ @rota_maps ! transforms density from local symmetry. equivalent molecules $ ! to the mask of molecules $ @aver_maps ! averages the density in place of all 3 molecules $ @cell ! fills the cell from the averaged densities applying $ ! crystal symmetry operations $ @fftfc ! calculates Fcalc and phases from averaged electron density $ @fourier ! calculates the electron density map $ delete scr:hkl.'tmp'.* $ purge scr: $ ii = ii + 1 ! increases the loop counter $ if ii .lt. 7 then goto loop The CREATE_P1SF.COM is a command file that combines information from files (LOOP.DAT, RESOL.DAT, P1SF.ORIG) into the P1SF.INP. CREATE_P1SF.COM: $ ass/user loop.dat for001 $ ass/user resol.dat for002 $ ass/user p1sf.orig for003 $ ass/user p1sf.inp for004 $ r create_p1sf LOOP.DAT is a file where the integer counter tells to the program CREATE_P1SF.EXE which line in the file RESOL.DAT should be taken as the current resolution range. P1SF.ORIG is the pattern file. The line with resolution range is replaced by the current range defined in the RESOL.DAT. P1SF.ORIG: $ RUN disk$Huber:[JD.DEISENHOF]P1SF P1SF RCB 59.98 128.01 59.12 90. 121.47 90. 8. 3.0 0.0 60 120 60 -99,-99 The CREATE_MERGE.COM prepares command input for PROTEIN in order to merge the Fcalc and phases with Fobs. The files LOOP.DAT, RESOL.DAT and MERGE.ORIG are combined as above by the CREATE_P1SF.COM to create the MERGE.INP file. CREATE_MERGE.COM: $ ass/user loop.dat for001 $ ass/user resol.dat for002 $ ass/user merge.orig for003 $ ass/user merge.inp for004 $ r create_merge MERGE.ORIG: WORK LABEL 'RACATHB' FILES (A 11 B 12 INPUT 20) NATIVE 'RANA' (S 0.005) COPY A B (MERGE C '(5A4)') RESOL 10. 3.5 (SHELL 20) CHECK B (RFAC (RR 2. RESC O B)) FINISH FFTFC_ATOM.COM controls the calculation of Fcalc from the molecular model, sorts the Fcalc according to H,K,L, and prepares the file (HKL.'TMP'). This is read by PROTEIN to merge reflections and Fcalc and to calculate the R-factor and needed scaling factors for Fcalc, which in turn are needed to perform the density calculation in next step controlled by the command file FOURIER.COM. The scaling factors are obtained from the file RFAC.LOG and written to the file SIN_K.DAT. SIN_K.DAT is used as input for CREATE_FOURIER.COM. The RFAC.LOG is copied to the RFAC_ALL.LOG in which the whole history of R-factor calculations through the cyclic averaging procedure are stored. FFTFC_ATOM.COM: $ COORDS :==rcb_040.RDI ! Coordinate input in DIAMOND format - deorthogonal $ FILEA :== scr:CBRANA100.FAO ! Fobs file $ FILEB :== scr:RCB_AC_2.FFT ! Fobs merged with Fcalc and phases $ ASSIGN/USER 'COORDS' FOR001 ! (diamond)COORDINATES IN $ ASSIGN/USER scr:HKL.'TMP' FOR004 ! Fcalc file (scratch) $ run disk$Huber:[jd.deisenhof]fftsf 59.98 128.01 59.12 90. 121.47 90. 2 P2 X, Y, Z -X, Y+1/2, -Z 60 120 60 -99 -99 25.0, 5.0, 8.0, 3.0 $! $! sort the Fcalc file according to H, K, L $ SORT scr:HKL.'TMP' scr:HKL.'TMP' - /KEY=(BIN,POS:11,SIZ:4)/KEY=(BIN,POS:7,SIZ:4)/KEY=(BIN,POS:3,SIZ:4) $ $ ASSIGN/USER scr:HKL.'TMP' FOR001 $ ASSIGN/USER scr:HKL.'TMP' FOR002 $ ! writes the Fcalc file into the form read by the protein $ RUN disk$Huber:[JD.DEISENHOF]FORMAT $ $ ASSIGN/USER 'FILEA' FOR011 ! input Fobs $ ASSIGN/USER 'FILEB' FOR012 ! resulting merged Fobs with Fcalc $ ASSIGN/USER scr:HKL.'TMP' FOR020 ! input Fcalc with phases $ ASSIGN/USER summary.dat FOR099 $ ASSIGN/USER rfac.log sys$output ! the current R-factor list file $ ASSIGN/USER merge.inp for005 ! command input for protein $ ! merge the Fcalc with phases to Fobs $ RUN mpi$prot:[exe]PROTEIN $ DELETE/LOG scr:*.'TMP'.* $ DELETE/LOG *.'TMP'.* $ $ ! search in rfac.log for the Fcalc scaling constants $ sea/out=sin_k.dat rfac.log "*EXP(-B*SIN2T/L2) WITH K" $ cop rfac.log rfac_all.log ! create R-factor summary file The command file FOURIER.COM controls the calculation of electron density from Fobs, Fcalc and phases. First, the command input for PROTEIN is created by CREATE_FOURIER.COM. This file combines files LOOP.DAT, SIN_K.DAT, RESOL.DAT and FOURIER.ORIG into FOURIER.INP (similar to CREATE_P1SF.COM and CREATE_MERGE.COM) by writing appropriate resolution range and scaling constants for Fcalc into the FOURIER.INP. The result of the procedure FOURIER.COM is the PROTEIN electron density file RCB.DIZ. FOURIER.COM: $ ! creates the command input file for protein (FOURIER.INP) from FOURIER.ORIG $ ! changing Fcalc scaling factors and resolution range if necessary. $ @create_fourier $ $ ! Creates the electron density file of the complete crystal cell from $ ! Fobs, Fcalc and phases $ ASS/USER scr:rcb_ac_2.fft FOR020 ! Fobs, Fcalc and phases input $ ASS/USER scr:BROL22.'TMP' FOR022 $ ASS/USER scr:BROL23.'TMP' FOR023 $ ASS/USER scr:TB.'TMP' FOR024 $ ASS/USER scr:TB2.'TMP' FOR026 $ ASS/USER rcb.diz FOR025 ! resulting electron density $ ASS/USER fourier.inp FOR005 ! command input for protein $ ASS/USER SUMMARY.'TMP' FOR099 $ run mpi$prot:[exe]protein $ DELETE/log scr:*.'TMP';* CREATE_FOURIER.COM: $ ass/user loop.dat for001 $ ass/user sin_k.dat for002 $ ass/user resol.dat for003 $ ass/user fourier.orig for004 $ ass/user fourier.inp for007 $ r create_fourier FOURIER.ORIG: WORK LIST I LABEL 'RACATHB' NATIVE 'RANA' RESOL 8.0 3.5 FILE ( A=20 C=22 D=23 E=24 F=26 ) TITLE 'CS' BEFOUR 'RANA' 65.4000015 -20.2000008 (DIFF 2.0 1.0) FOUR (FFT GRID 60 120 60 LAYOUT 0 59 0 119 0 59 SCF 1. ) CHECK E (DENSITY) COPY E F (SECTION 0 59 0 119 0 59 G) FILE ( E=26 F=25) COPY E F (DIREC Z) FINISH The next step is the first in the cyclic averaging procedure. It is controlled by the file ROTA_MAPS.COM. The files ROTA_MAPS.COM and the AVER_MAPS.COM can be combined together if the allocated memory by the program allows storage of two mask maps \\ (MASK_*.RMAP) in addition to the complete cell (RCB.DIZ). This is shown in the following examples of riboflavin synthase and carbamoylsarcosine hydrolase, where density was rotated and immediately added to the previous ones, so that only averaged densities were stored to disk. (Use of MAIN_MAP instead of MAIN is recommended when page file quota allows it. MAIN_MAP has 5 times larger arrays for density maps.) In this case (cathepsin B) each transformed density was first written to a file (by ROTA_MAPS.COM) and afterwards averaged (by AVER_MAPS.COM). The last calculated electron density of the cell (RCB.DIZ) is rotated and translated from the equivalent areas (map 1) to the currently masked regions (map 2). When the center of rotation is not explicitly defined, it is placed at origin of coordinate system. All the rotational and translational parameters should be given in orthogonal space. The order of rotation and translation operation in the command sentence defines also the order of their application. When in the command sentence rotation is specified before the translation, it is also applied first and vice versa. After each transformation the resulting electron density is written to the disk. When masked region is filled with density and written to the disk, the next mask is read to the same memory address (the old density is overwritten). All together 9 files, denoted as MOL_01_TO_01.RMAP, MOL_02_TO_01.RMAP, MOL_03_TO_01.RMAP, etc..., are created. The first index in file names denotes the area from which the density is taken and the second denotes the area to which the density is transformed. ROTA_MAPS.COM: $ ! transforms the density (from rcb.diz) by rotational and translational $ ! parameters (set_matr*.com) into the masks (mask_*.rmap) and writes $ ! the masked densities into mol_*_to_*.rmap $ $ $ main Reads the complete cell density from protein density file. The density is scaled so that 1.0 sigma of the map is the unit. > read file rcb.diz map protein MOLECULE 1: Read mask for molecule in real number format (real*4). > read file mask_01.rmap map number Copy the density from the cell (map 1) to the masked area (map 2) Since it is the identity operation, no rotation and translation is applied. > make map 2 from 1 copy Store the resulting density (map 2) to the file MOL_01_TO_01.RMAP. > write file mol_01_to_01.rmap map 2 The rest of the ROTA_MAPS.COM procedure does the same as above with the two differences:\\ 1. the map 2 is overwritten by the read map statement\\ 2. the mask is filled with density by rotating each masked point by matrix 2 and translation vector as specified by the command files SET_MATR*.COM. The density of the masked point is then obtained by linear interpolation from the 8 surrounding density points in map 1. > @[-.set]_tran_01_to_02 > read file mask_01.rmap map number overwrite 2 > make map 2 from 1 rotate matrix 2 translate vector xt yt zt > write file mol_02_to_01.rmap map 2 > @[-.set]_tran_01_to_03 > read file mask_01.rmap map number overwrite 2 > make map 2 from 1 rotate matrix 2 translate vector xt yt zt > write file mol_03_to_01.rmap map 2 MOLECULE 2 > read file mask_02.rmap map number overwrite 2 > make map 2 from 1 copy > write file mol_02_to_02.rmap map 2 > @[-.set]_tran_02_to_01 > read file mask_02.rmap map number overwrite 2 > make map 2 from 1 rotate matrix 2 translate vector xt yt zt > write file mol_01_to_02.rmap map 2 > @[-.set]_tran_02_to_03 > read file mask_02.rmap map number overwrite 2 > make map 2 from 1 rotate matrix 2 translate vector xt yt zt > write file mol_03_to_02.rmap map 2 MOLECULE 3 > read file mask_03.rmap map number overwrite 2 > make map 2 from 1 copy > write file mol_03_to_03.rmap map 2 > @[-.set]_tran_03_to_01 > read file mask_03.rmap map number overwrite 2 > make map 2 from 1 rotate matrix 2 translate vector xt yt zt > write file mol_01_to_03.rmap map 2 > @[-.set]_tran_03_to_02 > read file mask_03.rmap map number overwrite 2 > make map 2 from 1 rotate matrix 2 translate vector xt yt zt > write file mol_02_to_03.rmap map 2 > quit The translation and rotation parameters are transferred to the program by the files [-.SET]SET_TRAN_*_TO_*.COM. Notation of the indices corresponds to the MOL_*_TO_*.RMAP files. The rotation matrix is read directly to the matrix number 2 and the translational vector is transferred through the variables xt, yt and zt. [-.SET]SET_TRAN_*_TO_*.COM: > set variable xt 13.940 > set variable yt 42.265 > set variable zt 24.158 > set mat 2 number - > -0.404457 0.018350 -0.914373 - > -0.017489 0.999461 0.027794 - > 0.914390 0.027233 -0.403918 > return After transformation governed by the ROTA_MAPS.COM the resulting densities of the same area (MOL_*_TO_01.RMAP, MOL_*_TO_02.RMAP, MOL_*_TO_03.RMAP) are added together and averaged (divided by 3.0) by the command file \\ AVER_MAPS.COM. AVER_MAPS.COM: $ main > read file mol_01_to_01.rmap map number > read file mol_02_to_01.rmap map number The command word ADD tells the program to add two maps together and stores the result in map number 1. > make map 1 from 2 add > read file mol_03_to_01.rmap map number overwrite 2 > make map 1 from 2 add Scales all the density points in map 1 by 1/3. > scale 1. / 3. map 1 > write file mol_01_aver.rmap map 1 > read file mol_01_to_02.rmap map number overwrite 1 > read file mol_02_to_02.rmap map number > make map 1 from 2 add > read file mol_03_to_02.rmap map number overwrite 2 > make map 1 from 2 add > scale 1. / 3. map 1 > write file mol_02_aver.rmap map 1 > read file mol_01_to_03.rmap map number overwrite 1 > read file mol_02_to_03.rmap map number > make map 1 from 2 add > read file mol_03_to_03.rmap map number overwrite 2 > make map 1 from 2 add > scale 1. / 3. map 1 > write file mol_03_aver.rmap map 1 > quit The resulting averaged maps (MOL_*_AVER.RMAP) are used to fill the unit cell (CELL.FFT) applying crystal symmetry operations (HEAD.RMAP). The procedure is controlled by the command file CELL.COM. First the map header (HEAD.RMAP) is read. The file HEAD.RMAP includes also all crystal symmetry operations. From this map (1) the empty map 2 is created. The size and position of the map 2 corresponds to the unit cell. Then all three averaged maps (MOL_*_AVER.RMAP) are read (into map 3) one after the other and the crystal cell is filled with their densities by the 'make map 2 from 3 cell' command statement applying the crystal symmetry operations. The averaged maps can be placed anywhere in space. The only limitation is that they ought to have the same grid size and cell constants as the generated cell. Finally the remaining empty grid points of the cell (map 2) are set to zero and written in the Lyn Ten Eyck format to the file CELL.FFT which serves as input for FFTFC.COM that calculates the the structure factors (Fcalc and phases). CELL.COM: $ main Read the map where only cell constants and symmetry operations are stored > read file head.rmap map number reserves the space for the cell and fills it with -9999.0 (empty map) > make map 2 from 1 initialize -9999 box 0 0 0 59 119 59 Reads the first averaged density > read file mol_01_aver.rmap map number builds the cell from averaged density > make map 2 from 3 cell > read file mol_02_aver.rmap map number over 3 > make map 2 from 3 cell > read file mol_03_aver.rmap map number over 3 > make map 2 from 3 cell sets the density of all empty grid points to zero > make map 2 set -10000 -9900 0.0 Writes the cell in fft (Lyn Ten Eyck) format (input for Fcalc calculation with P1sf). > write file cell.fft map fft > quit The FFTFC.COM performs the same task as the FFTFC_ATOM.COM with the following differences: - the input for the Fcalc calculation is the electron density of the unit cell (CELL.FFT) and not the atomic model, - the P1SF.INP command file is updated automatically (by CREATE_P1SF.COM), while FFTFC_ATOM.COM should be edited, when the resolution range is modified, - the RFAC.LOG is appended to the already existing file RFAC_ALL.LOG, where the previous R-factor calculations are stored. P1SF.COM: $ FILEA :== scr:CBRANA100.FAO ! Fobs file $ FILEB :== scr:RCB_AC_2.FFT ! Fobs with merged Fcalc $ ASSIGN/USER CELL.FFT FOR001 ! electron density file $ ASSIGN/USER scr:C.'TMP' FOR002 ! scratch file for Fcalc $ ASSIGN/USER scr:HKL.'TMP' FOR004 ! another scratch file for Fcalc $ @p1sf.inp ! calculates Fcalc and phases from electron density $ $! sort the Fcalc file according to H, K, L $ SORT scr:HKL.'TMP' scr:HKL.'TMP' - /KEY=(BIN,POS:11,SIZ:4)/KEY=(BIN,POS:7,SIZ:4)/KEY=(BIN,POS:3,SIZ:4) $ $ ASSIGN/USER scr:HKL.'TMP' FOR001 !<<<<<<<<<<<<<<<<<>>>>>>>>> $ ASSIGN/USER scr:HKL.'TMP' FOR002 $ $ ! writes the Fcalc file into the form read by the protein $ RUN disk$Huber:[JD.DEISENHOF]FORMAT $ $ ASSIGN/USER 'FILEA' FOR011 ! input Fobs $ ASSIGN/USER 'FILEB' FOR012 ! resulting merged Fobs with Fcalc $ ASSIGN/USER scr:HKL.'TMP' FOR020 ! input Fcalc with phases $ ASSIGN/USER summary.dat FOR099 $ ASSIGN/USER rfac.log sys$output ! the current R-factor list file $ ASSIGN/USER merge.inp for005 ! command input for protein $ ! merge the Fcalc with phases to Fobs $ RUN mpi$prot:[exe]PROTEIN $ DELETE/LOG scr:*.'TMP'.* $ DELETE/LOG *.'TMP'.* $ $ ! search in rfac.log for the Fcalc scaling constants $ sea/out=sin_k.dat rfac.log "*EXP(-B*SIN2T/L2) WITH K" $ append rfac.log rfac_all.log ! accumulating R-factor list file The FOURIER.COM, following the FFTFC.COM, was described already above. Then the loop counter is increased. After a sufficient number of cycles the DO_ALL procedure is terminated. 1.5. CHAR_LONG procedure The differences between procedure described above (REAL_LONG) and this one (CHAR_LONG) arise from the nature of storing the density values. The character*1 can accept values in range between 0 and 255 that span the map density over an interval defined by its minimum and maximum value. It is not allowed to mix real*4 and character*1 maps during averaging procedure. When preparing character*1 masks two changes to the file MAKE_MASKS.COM must be introduced, as it can be seen in the [.MASK]MAKE_MASKS_CHAR.COM. First the map header (HEAD.MAP) should be read with the character format (default) and second the the empty area of a character*1 map is denoted with 0 and not with -9999 as in the case of the real*4 map (initiate 0). MAKE_MASKS_CHAR.COM: $ main > read file rcb_040.rdi coordinates diamond > read file head.map map ... > make map 2 from 1 initialize 0 around 10 atom 4.5 select mol_1 end > write file mask_01.map map 2 ... Read directly, as in [.REAL_LONG]ROTA_MAPS.COM, PROTEIN maps are converted to real*4 maps. In order to use them in a character*1 averaging, they should be converted to character*1 map (RCB.MAP) with the program called PROMAP (see [.MAPS]IO.TEX) or MAIN. $ promap rcb.diz rcb.map The file ROTA_MAPS.COM differs from the one used in REAL_LONG procedure only by the format of the read-write map command sentences and the file names. ROTA_MAPS.COM: $ main >read file rcb.map map >read file mask_1.map map >make map 2 from 1 copy >write file mol_1_orig.map map 2 ... >read file mask_1.map map over 2 >@[-.set]_matrix_1_to_2 >make map 2 from 1 rotate matrix 2 translate vector xt yt zt >write file mol_2_to_1.map map 2 ... Averaging the maps is different. Adding more than 2 character*1 maps would require accessing the same grid point in all maps at once. With increasing number of equivalent maps it would be quite easy to reach the borders of the available computer memory. Therefore an alternative way is chosen. The maps are averaged by a separate program in an integer*2 array map that can accept 127 maps with no danger of numerical overflow. As long as the -1 is not reached the program AVEMAP expects density files and add them one to the other. The density files should have the same size, position and minimum and maximum density value. After -1 the resulting averaged maps are written to the output files (MOL_*_AVER.MAP). AVER_MAPS.COM: $ avemap mol_1_orig.map mol_2_to_1.map mol_3_to_1.map -1 mol_01_aver.map $ avemap mol_2_orig.map mol_1_to_2.map mol_3_to_2.map -1 mol_02_aver.map $ avemap mol_3_orig.map mol_2_to_3.map mol_1_to_3.map -1 mol_03_aver.map The CELL.COM from REAL_LONG was changed so that the input density files are read as character*1 files and the empty grid points labeled with character 0 are set to the 0.0 density. CELL.COM: $ main > read file head.map map > make map 2 from 1 initialize 0 box 0 0 0 59 119 59 reads the first averaged density > read file mol_01_aver.rmap map > make map 2 from 3 cell > read file mol_02_aver.map map over 3 > make map 2 from 3 cell > read file mol_03_aver.map map over 3 > make map 2 from 3 cell sets the density of all empty grid points to zero > make map 2 set 0 0 0.0 > write file cell.fft map 2 fft > quit 1.3. REAL_FAST procedure The difference between the FAST and LONG procedure is that in the FAST procedure density of only one molecule area is averaged; the others are derived from it by the local symmetry transformation parameters. The ROTA_MAPS.COM is therefore shortened, and additional command procedure (MAKE_LOCAL.COM) has to be included into the cycle. The procedure MAKE_LOCAL.COM reads the averaged density of the molecule 1 area (MOL_01_AVER.RMAP) and creates from it the other averaged areas (MOL_02_AVER.RMAP and MOL_03_AVER.RMAP). MAKE_LOCAL.COM: $ main >read file mol_01_aver.rmap map number > @set_matrix_02_to_01 > read file mask_02.rmap map number > make map 2 from 1 rotate matrix 2 translate vector xt yt zt > write file mol_02_aver.rmap map 2 > @set_matrix_03_to_01 > read file mask_03.rmap map number over 2 > make map 2 from 1 rotate matrix 2 translate vector xt yt zt > write file mol_03_aver.rmap map 2 > quit 1.4. CHAR_FAST procedure CHAR_FAST procedure is not described since it can easily be combined from the ones described above.