MIR - automated heavy atom search and phasing

Version 4.2.0 /05.06.2000/ - Features

(This document is not completely ready)
There are three super_programs for Isomorphous replacement method: MIR, MIR_II, TRAHALO. Main program is MIR. Others may be used for semi-automated solution or if you like to play with parameters of program. These prorams are the auxiliary programs. Their input files have BLANC format. You can have these files after program MIR.

       TRAHALO       TRAslation function Heavy Atom LOcation.
                   * performs automated heavy atom  search and phasing 
                     for one derivative.  
                   * Program supports SAD,SIR,SIRAS cases.
                   * can use the phases from other sources.
                   * can manage pseudo-translation.
                     / also is the part of MIR /

       MIR_II        performs automated phasing: computes the phases of 
                     native structure factors by using information of several
                     derivatives (structure factors and coordinates). 
                     Can refines phases by  density modification  
                     /solvent flattening/
                     / this program is auxiliary program, just refines
                       heavy atom position, computes ABCD coefficients
                       and combines its. /                                     

MIR is an automated program for heavy atom/anomalous scatterers location and subsequent phasing of multiple isomorphous and/or anomalous X-ray data. It is based on the translation function approach for heavy atom (HA) location as implemented in the program TRAHALO [1] which forms part of the program MIR.

In the first step, HA search is performed for each derivative separately. A full-symmetry translation function (TF) [2] is calculated using a one-atom probe model. This gives a primary list of HA selected on the basis of the highest phasing power (PP). For each of these HA sites the TF search for the second site is performed using a model consisting of a one-atom probe and one atom in the fixed position. The sites thus found are checked against the primary list and a pair of HA with the highest PP is considered to be the best solution. Note that the pair of HA will have a common coordinate origin and hand. The HA search goes on until the addition of a new atom does not increase the PP.

In the second step, cross-difference Fourier syntheses are calculated to verify the HA sites located in the first step and to find additional sites. Thus, phases from derivative 1 are used to locate HA sites in derivative 2 which are then used for HA location in derivative 1. If these HA-1-NEW sites coincide (at least partially) with the original set of sites for derivative 1, the sites used for phase calculation (derivative 2) are considered to be correct. This procedure helps to detect some additional sites which were missed in the first step and at the same time to avoid incorporation of a large number of false sites.

Third step is a density modification (solvent flattening) to produce the final phases. Additionally, MIR can use external phases, e.g. the molecular replacement phases.

Anisotropic scaling and correction of the experimental data have been introduced in MIR. Although anisotropic scaling of derivatives data is relatively common, the native data could be anisotropic as well, which could adversely affect the results of HA location.


   Author:      A.A.Vagin
                email: alexei@yorvic.york.ac.uk

    Reference:

    A.Vagin,A.Teplyakov, A Translation-Function Approach for Heavy-Atom
    Location in Macromolecular Crystallography. Acta Cryst. (1998).
    D54, 400-402 

C =========================================================================


I. Installation.


   Copy file mir.tar.gz

      and uncompress it (`gunzip mir.tar.gz')  

      After untaring `mir.tar' ( command: tar xvf mir.tar ) 
      you will get a mir directory, with src, doc, dic, data and bin 
      subdirectory. To build the executable, go to src and then you will have 
      following options:

     1. `make mir', the executable (mir) will finish up in the bin
         directory; providing the full pathname (.../mir/bin/mir) one 
         can execute it from anywhere without having to define and 
         environmental variable.

     2. `make mir_ccp4' ( CCP4 distribution which can read MTZ file ) 
         the executable (mir) will finish up in the bin directory; 
         providing the full pathname (.../mir/bin/mir) one can execute 
         it from anywhere without having to define and environmental variable,
         except variable CLIB which defines directory of CCP4 libraries.

     3.  `make trahalo'      the executable file is trahalo.  

     4.  `make trahalo_ccp4' the executable file is trahalo.  
                             compatiable with ccp4 distribution

     5.  `make mir_II'       the executable file is mir_II.  

     6.  `make mir_II_ccp4'  the executable file is mir_II.  
                             compatiable with ccp4 distribution

     7.  `make mir_lnx`      Linux distribution 

     8.  `make mir_lnx_ccp4` Linux distribution with ccp4
     
     9.  `make trahalo_lnx`  Linux distribution 

    10.  `make trahalo_lnx`  Linux distribution

    11.  `make mir_lnx_ccp4` Linux distribution with ccp4
     

C ==========================================================================

II. Input/output files


    Input file formats.

      Input Structure factor file formats is CIF or BLANC or MTZ.

      Input formatted file of structure factors (CIF) contains indices 
      and structure factors or intensities. 

      Input ABCD_coefficient file has BLABC format. Programs MIR, TRAHALO
      create this file 

      You can find some examples of input files in Appedix B.

    Output files 

        mir.doc            -  protocol. This file wiil be created if
        /or trahalo.doc/      keyword DOC = 'Y' or 'A'.

        mir.bat            -  batch file.  This file wiil be created if
        /or trahalo.bat/      keyword DOC = 'Y' or 'A'. You can repete 
                              calculation using this file:
                                   cp molrep.bat bat 
                                   sh bat

        mir_fobs.dat       - F_obs (BLANC format)
        mir_der1.dat       - F derivative (BLANC format)
        mir_der2.dat         ...
        ............
        mir_der1.crd       - heavy-atom coordinates (ortog. coord. system)
        mir_der2.crd         ...                    (CIF)
        ............
        mir_der1_fract.crd - heavy-atom coordinates (fract. coord. system)
        mir_der2_fract.crd    ...                   (CIF)
        ............

        mir_abc.dat        - output file of ABCD coefficients (BLANC format)
        /or trahalo_abc.dat/ This file can be used sa input for MIR/TRAHALO


        denmod_ai.dat      - ABCD coefficients after density modification 
                             procedure

        mir_ph.dat         - final phases 

      In SAD case the solution is in:

        mir.crd            - heavy-atom coordinates (ortog. coord. system)
        mir_fract.crd      - heavy-atom coordinates (fract. coord. system)

      If input file was MTZ:

        mir.mtz - New MTZ file /Fp,Ph,FOM/ or /Fp(hkl),Fp(-h-k-l),Ph,FOM/

C ==========================================================================


III. How to use MIR , TRAHALO and MIR_II


    * You can use these programs by dialogue or by batch file. 

    * Simple way to use these programs is to define input files and use
      default values for all parameters.


    * Output files of MIR have BLANC format and they can be used for
      TRAHALO and MIR_II. If you have BLANC you can also use other useful 
      blanc's programs (see Appendix E.)


    Dialogue and Keywords


     For any program you have to answer for first question:

     Do you want to have FILE-DOCUMENT /mir.doc/ ? /<N>/Y/A :
       N - means without DOC-file
       Y - with new contents
       A - means to keep old contents and add new information
          with DOC-file program creates batch file: mir.bat
    _DOC:

       DOC-file contains protocol of program running. 
       If this file is exist and the answer is "A" program
       will add information to the end of file.


MIR  / for ccp4 version MIR see below /


     Input file Fobs or file for SAD case:  <-- tape name 

                          - name of formatted file of structure factors
                            / CIFile of structure factors/
                                       or 
                            internal BLANC file of structure factors

     Keywords:

     RESOL: MIN,MAX - resolution, default: 10 - 3 A

                   Program uses all data up to resmax, default = 3 A
                   Input value resmin program transforms to Boff=4*resmin^2 and
                   uses all data. Default value resmin = 10 A ,i.e. Boff=400.

     FILE_A:  < >   - intput file of phases, " " means without this file
                                                  (BLANC format)
     FILE_D1: < >   - intput file of derivative_1 (format as Fobs)
     FILE_D2: < >   - intput file of derivative_2 (format as Fobs)
     FILE_D3: < >   - intput file of derivative_3 (format as Fobs)
     FILE_D4: < >   - intput file of derivative_4 (format as Fobs)
     FAST:  <F>,M,S - There are tree modes to run:

                      F means "FAST" mode, M - "MIDDLE" , S - "SLOW"

                         Resolution/max/  Npeaks  Trans_Func
                      F      5              4        T  (standard)
                      M      3              6        T  (standard)
                      S      3              8        Ta (advanced)
            where 

            Npeaks         -    number of peacks which will be checked by
                                program TRAHALO.

            Trans.Function -    kind of Translation function which program
                                TRAHALO will be used.

     H2O:     <0>   - percent of solvent, for density modification procedure
                      0 - choice of program
                      default: without density modification procedure
     ANISO:  <N>/Y  - Y means anisoscaling Fnat and Fder.
     PST:    <N>,Y  - Y means to use pseudo-translation vector VPST. 
     VPST: <0,0,0>  - vector of pseudo-translation /in fract./ which will be 
                      used if PST = 'Y'. 

#       output files:
#
#      mir_fobs.dat - F_obs (BLANC format)
#      mir_der1.dat - F derivative (BLANC format)
#      mir_der2.dat
#      ............
#      mir_der1.crd - heavy-atom coordinates (ortog. coord. system)
#      mir_der2.crd
#      ............
#      mir_der1_fract.crd - heavy-atom coordinates (fract. coord. system)
#      mir_der2_fract.crd
#      ............
#      mir.crd       - heavy-atom coordinates for SAD case(ortog. coord. system)
#      mir_fract.crd - heavy-atom coordinates for SAD case(ortog. coord. system)
#      mir_abc.dat   - output file of ABCD coefficients
#      denmod_ai.dat - ABCD coefficients after density modification procedure


TRAHALO

   input file F_derivative:  <-- name
   input file Fobs /for Anom. Diff. Patteson search press "CR"/: <-- name

   Format of these files is internal BLANC format for structure factor file.

     Keywords:

   RESOL: MIN,MAX    - resolution <default from FILE_Fobs>
   NP:       <8>     - number of peaks to check, MAX =20, =3 for FAST
   GAUSS:   <Y>,N    - N means a sphere, Y - gaussian.
   RAD:     <2.5>    - radius of sphere of model of heavy atom or width
                       of gaussian /in angstroms/.
   BOFF:    <400>    - 400 corresponds to RESmin=10A, BOFF=4*RESmin^2
   BADD:     <0>       BOFF and BADD mean :
                       !F!new = !F!input *EXP(-BADD*RSQ)*(1-EXP(-BOFF*RSQ)
                       BADD = -1 means automatical choice
   SORT:  <P>/D/M    - sort the list of atom positions according to:
                       P - phasing power, D - density , M - mixed.
   SPEC:    <Y>/N    - Y means to use peaks in special  position.
   PACK:    <Y>/N    - N means Translation function without Packing function.
   SLIM  :  <1.0>    - limit for DEL=Fder-Fnat. !DEL!>sd(DEL)*SLIM will used
   CLIM  :  <3.0>    - limit for DEL=Fder-Fnat. !DEL!< DEL_MAX will used
                       DEL_MAX = <DEL> + DEL_rms * CLIM, 0 means no this limit
   TRANS:   <Y>/N    - Y means advanced translation function, N standard
   FAST:    <F>/S    - F fast mode, automatical choice parameter for FAST run:
                       NP=3, TRANS="N", res_max=5
   SCALE:   <Y>/N    - N means without scaling Fnat and Fder.
   ANISO:   <N>/Y    - Y means anisoscaling Fnat and Fder.
   PST:     <N>,Y    - Y means to use pseudo-translation vector VPST. 
   VPST:   <0,0,0>   - vector of pseudo-translation /in fract./ which will be 
                      used if PST = 'Y'. 
   REMOV:   <N>/Y    - remove origin peak
   COMB:    <N>/Y    - use combined diff. patterson (D_iso + Kemp * D_ano)
   FILE_A:   < >     - intput file of ABCD     (BLANC format)
   FILE_O:   name    - output file of heavy atoms in ortog.coord. system,
                       default: trahalo.crd (CIF)

MIR_II

   Input file Fobs:  name

   Format of this file is internal BLANC format for structure factor file.

      Keywords:

   RESOL: MIN,MAX - resolution, default: 10 - 3 A
   FILE_D1: < >   - intput file of derivative_1 (BLANC format)
   FILE_D2: < >   - intput file of derivative_2 (BLANC format)
   FILE_D3: < >   - intput file of derivative_3 (BLANC format)
   FILE_D4: < >   - intput file of derivative_4 (BLANC format)
   FILE_C1: < >   - intput coordinate file of derivative_1 (CIF)
   FILE_C2: < >   - intput coordinate file of derivative_2 (CIF)
   FILE_C3: < >   - intput coordinate file of derivative_3 (CIF)
   FILE_C4: < >   - intput coordinate file of derivative_4 (CIF)
   H2O:     <0>   - percent of solvent, for density modification procedure
                      0 - choice of program
                      default: without density modification procedure

            output files:

           <file_derivative-name>.crd - heavy-atom coordinates
           mir_abc.dat                - output file of HL_coefficients. 
                                        Use progrram ABCDPH' to compute 
                                        from ABCD or to combine ABCD files
           denmod_ai.dat              - ABCD coefficients of refined phases

  MIR version for CCP4.


    1. You can have CCP4 version of MIR which can read MTZ file.

 
    2. This possibility uses CCP4 libraries. 
       You must define the path to this libraries by variable CLIB.
       Give command: setenv CLIB <path_to_lib>

    3. Keywords for reading MTZ file.


      Input Fobs file or MTZ file (extension "mtz")
      FILE_F:
                          - name of formatted file of structure factors
                            / CIFile of structure factors/
                                       or 
                            internal BLANC file of structure factors
                                       or
                            MTZ file which must have extension "mtz"
       
       #     Next keywords are necessary only for MTZ file
       #
       #
       #FP:       < >   - label of Fobs or Fobs(+)
       #SIGFP:    < >   - label of sigma Fobs or sigma Fobs(+)
       #FP-:      < >   - label of Fobs(-)
       #SIGFP-:   < >   - label of sigma Fobs(-)
       #DP:       < >   - label of delta_anom Fobs
       #SIGDP:    < >   - label of sigma of delta_anom Fobs
       #
       #FPH1:     < >   - label of Fder1 or Fder1(+)
       #SIGFPH1:  < >   - label of sigma Fder1 or sigma Fder1(+)
       #FPH1-:    < >   - label of Fder1(-)
       #SIGFPH1-: < >   - label of sigma Fder1(-)
       #DPH1:     < >   - label of delta_anom Fder1
       #SIGDPH1:  < >   - label of sigma of delta_anom Fder1
       #
       #FPH2:     < >   - label of Fder2 or Fder2(+)
       #SIGFPH2:  < >   - label of sigma Fder2 or sigma Fder2(+)
       #FPH2-:    < >   - label of Fder2(-)
       #SIGFPH2-: < >   - label of sigma Fder2(-)
       #DPH2:     < >   - label of delta_anom Fder2
       #SIGDPH2:  < >   - label of sigma of delta_anom Fder2
       #
       #FPH3:     < >   - label of Fder3 or Fder3(+)
       #SIGFPH3:  < >   - label of sigma Fder3 or sigma Fder3(+)
       #FPH3-:    < >   - label of Fder3(-)
       #SIGFPH3-: < >   - label of sigma Fder3(-)
       #DPH3:     < >   - label of delta_anom Fder3
       #SIGDPH3:  < >   - label of sigma of delta_anom Fder3
       #
       #FPH4:     < >   - label of Fder4 or Fder4(+)
       #SIGFPH4:  < >   - label of sigma Fder4 or sigma Fder4(+)
       #FPH4-:    < >   - label of Fder4(-)
       #SIGFPH4-: < >   - label of sigma Fder4(-)
       #DPH4:     < >   - label of delta_anom Fder4
       #SIGDPH4:  < >   - label of sigma of delta_anom Fder4
       #
       #    for SAD case use: FP, SIGFP,...
       #

     RESOL: MIN,MAX - resolution, default: 10 - 3 A

                   Program uses all data up to resmax, default = 3 A
                   Input value resmin program transforms to Boff=4*resmin^2 and
                   uses all data. Default value resmin = 10 A ,i.e. Boff=400.

     FILE_A:  < >   - intput file of phases, " " means without this file
                                                  (BLANC format)
     FAST:  <F>,M,S - There are tree modes to run:

                      F means "FAST" mode, M - "MIDDLE" , S - "SLOW"

                         Resolution/max/  Npeaks  Trans_Func
                      F      5              4        T  (standard)
                      M      3              6        T  (standard)
                      S      3              8        Ta (advanced)
            where 

            Npeaks         -    number of peacks which will be checked by
                                program TRAHALO.

            Trans.Function -    kind of Translation function which program
                                TRAHALO will be used.

     H2O:     <0>   - percent of solvent, for density modification procedure
                      0 - choice of program
                      default: without density modification procedure
     ANISO:  <N>/Y  - Y means anisoscaling Fnat and Fder.
     PST:    <N>,Y  - Y means to use pseudo-translation vector VPST. 
     VPST: <0,0,0>  - vector of pseudo-translation /in fract./ which will be 
                      used if PST = 'Y'. 

#       output files:
#
#      mir_fobs.dat - F_obs (BLANC format)
#      mir_der1.dat - F derivative (BLANC format)
#      mir_der2.dat
#      ............
#      mir_der1.crd - heavy-atom coordinates (ortog. coord. system)
#      mir_der2.crd
#      ............
#      mir_der1_fract.crd - heavy-atom coordinates (fract. coord. system)
#      mir_der2_fract.crd
#      ............
#      mir.crd       - heavy-atom coordinates for SAD case(ortog. coord. system)
#      mir_fract.crd - heavy-atom coordinates for SAD case(ortog. coord. system)
#      mir_abc.dat   - output file of ABCD coefficients
#      denmod_ai.dat - ABCD coefficients after density modification procedure




  Batch file


     Best way to prepare batch-file is to run mir once by dialogue.
     If "mir.doc" file was defined (keyword DOC = 'Y' or 'A') program creates 
     "mir.bat" batch-file automatically.

     See some examples of batch files in Appendix C.


  Notes.

    1. After first use MIR it is possible to make second round
       of MIR with phases from previous run.

    2. We can start from to use TRAHALO ( not MIR) for each
       derivative. But in this case you can not combine its
       phases because its origines are different. 
       Use TRAHALO for one derivative with phases
       from another after that we can combine new phases with
       phases which was used.

    3. Result of TRAHALO is always bad if you use bad phases.
       For example from one derivative. If you have only
       two derivative use combine phases for TRAHALO. But in this
       case pay attention - we have correlation between
       heavy atom parameters and phases.

    4. MIR program computes list of peaks of Patterson
       and writes to mir.doc. It may be useful to detect pseudo-translation.

C ==========================================================================

VI. testing 

     In directory "../mir/doc/" there are three files:
 
        .../mir/doc/test.bat - batch file of the test 
        .../mir/doc/test_mtz.bat - batch file of the test with input MTZ file 
        .../mir/doc/test.doc - protocol of this test

     In directory "../mir/data/" there are six files for test:

        .../mir/data/nat.hkl   
        .../mir/data/der1.hkl      
        .../mir/data/der2.hkl
        .../mir/data/der3.hkl
        .../mir/data/der4.hkl

        Fobs and derivatives for testing program MIR / ASCII files /

        .../mir/data/test.mtz

     1. copy files nat.hkl, der1.hkl, der2.hkl, der3.hkl, der4.hkl,
        test.mtz, test_mtz.bat and test.bat to some directory

     2. check and correct path to program "mir" in the file "test.bat"
        and "test_mtz.bat"
 
     3. run test:   sh test.bat and test_mtz.bat
 
     4. compare result with ".../mir/doc/test.doc" and 
                            ".../mir/doc/test_mtz.doc"

C ==========================================================================

Appendix A.  Description of super-programs

     
  #
  #    TRAHALO -  basic program of this package.
  #               solution of heavy-atom structure. Reciprocal space search 
  #               for heavy atom(s) positions by program TRPACK -
  #               translation function + packing function.


                  Input: !F!_obs and !F!_der or only !F!_der (SAD case)
                  Output: coordinates of heavy atoms.

                  Additional input: 
                    Phase ( some phases. For example for another derivative)


    What program is doing:


 I. without input phases.

    Part 1.

    1. scales Fobs and Fder and computes (Fobs-Fder)^2 coefficients.

    2. computes Translation function using Diff. Patterson
       coefficients. Model is a sphere or Gaussian.
       If there are known  atoms program uses its as second fixed model.
       ( up to 9 atoms). 

    3. Searches and creats list of expected atoms - "self_list".
       DLIM=RESmin/2 A. DLIM - minimal distance between two peaks which
       program recognize as different peaks.
       Refines (unphased) each atom of self_list.

    4. Sorts self_list by power.
   
    Part 2.

    1.a For fist NP (input parameter) peaks of self_list computes Translation
       and Packing function for Diff. Patterson coefficients with a second
       fixed model as current peak (i) from self_list.

    1.b For current peaks (i) of self_list creates cross_list(i),
       refines (unphased) all peaks of cross_list and sorts by power.
 
    1.c Chooses additional peak with number (NP+1) and repeates 1.b.

       For it program chooses additional peaks (I_add) for each 
       cross_list(i) which is peak with maximal density and is not
       among fisrt NP peaks in self_list. Program uses as additional
       peaks the peak with maximal power.

    2. Searchs expected pairs of atoms using self_ and cross_lists.
         Two atoms are a pair if :
          a Pair of atoms: I and J must be in self_list. 
          b Cross_list (I) must have J_peak  and cross_list(J) must 
             have I_peak.  
          c Transformation from I_peak to I_peaks of cross_list(J)
             applying to J_peaks of cross_list(I) gives J_peak. 
       Refines (unphased) all pairs.

    3. Searchs expected triples of atoms using all pairs.

    4. Trying to find more atoms.
       Using the best pair (or triple) as fixed model program computes 
       Translation function to search next atom. The search for further 
       atoms goes on until the addition of the new atoms does not increase 
       the power.

 II. with input phases.

     1. creats self_list (see part 1 above) 

     2. computes phases from input ABCD_coefficients.

     3. computes diff. fourie map and creates list of expected atoms
        four_list.

     4. rejects atoms from four lists which has density < dens_limit.
        Dens_limit = rms(density) * 6.0 computed for all atom in
        four_list.

     5. search common atoms in self and four lists.

     6. writes common atoms to output file of coordinates 
  

     Also TRAHALO is a part of MIR.
     These are a lot of parameters. Many of them useful for experimental
     calculation. For usual calculation the easy way is to use
     another superprogram (MIR).
      



                """"""""""""""""""""""""""
                "        TRAHALO         "
                "                        "
                """"""""""""""""""""""""""



      ------             ------
     ( Fder )   +------ ( Fnat )
      ------    .        ------
          .     .           .
          v     v           v
      +------------+        .
      .  PSCALE    .        .         scaling by Patterson
      +------------+        .   
      . ANISOSCL   .        .         anisothermal scaling   
      +------------+        .   
              .             .
              v             v
            ----------      .
           ( Fder_scl )     .
            ----------      .
                   .        .    
                   v        v
                  +----------+  
                  .   coef   .         coefficients for diff. Patterson
                  +----------+         or combined diff Patterson
                       .               (i.e. + anom diff patterson)      
                       v           
                    -------     
                   ( coef  )    
                    -------     
                       .        
                       v        
               +---------------+    Translation and Packing Function.
               .    TRPACK     .    one-atom probe model 
               +---------------+    (a sphere with radius =  2.5)        
                       v                        
                     -----                   
                    ( Map )                  
                     -----                   
                       v                  
               +---------------+        
               .    PEAKSRCH   .       search heavy atom positions
               +---------------+
                       .   
                       v   
                   -----------    
                  ( coords_ha )   Self_List: expected heavy atom position.
                   -----------
                        .        
                        v

            ----  Variant without phases ----
                        .
                        v        
     + ---------->------.    For each peak of Self_List.    
     !                  .        
     !                  v        
     !          +---------------+
     !          .    TRPACK     .    model is a sphere with radius = 2.5 A
     !          +---------------+    fixed model_2 is sphere with coordinates
     ^                  v            for peak of Self_List            
     !                -----                   
     !               ( Map )                  
     !                -----                   
     !                  v                  
     !          +---------------+        
     !          .    PEAKSRCH   .       search heavy atom positions
     !          +---------------+
     ^                  v   
     !              -----------    
     !             ( coords_ha )    Cross_List(I): expected heavy atom position
     !              -----------             for each peak of Self_List
     !                  .     
     !   next peak      v
     +----------<-------
                        .  
                        v                  
            +-----------------------------------+  
            . Analysis Self_List and Cross_List .  cross validation all pairs
            +-----------------------------------+
                        v   
                   -----------    
                  ( best_pair )   
                   -----------
                        .
                        v   
                +---------------+
     +--->------.    TRPACK     .    fixed model is all found atoms. 
     !          +---------------+    
     !                  v            f            
     !                -----                   
     ^               ( Map )                  
     !                -----                   
     !                  v                  
     !          +---------------+        
     !          .    PEAKSRCH   .       search next heavy atom which
     !          +---------------+       increase power
     ^                  .
     !                  v
     !             -----------    
     +--------<-- ( coords_ha )   Output file of expected heavy atom position.
                   -----------

            ----  Variant with phases ----

                after preparation Self_List

                    ---------------   -------    --------
                   (    ABCD       ) ( F nat )  ( Fder   )
                    ---------------   -------    --------
                           .           .   .        .
                           v           .   v        v
                   +--------------+    .  +------------+    
                   .    ABCDPH    .    v  .  PSCALE    .  Scaling by Patterson
                   +--------------+    .  +------------+
                           .           .        .
                           v           .        v
                       --------        .     ----------
                      ( mi Phi )       .    ( Fder_scl )
                       --------        .     ----------
                           v           .        .
                           .           .        v
                           v           v        .
                       +----------------------------+
                       .            CFFT            .  Diff. Fourie
                       +----------------------------+
                                  .
                                  .        
                                  v
                               -------
                              (  Map  )
                               -------
                                 .
                                 .                       
                                 v                  
                       +---------------+        
                       .    PEAKSRCH   .       search heavy atom positions
                       +---------------+
                             .   
                             v   
                       -----------    
                      ( coords_ha ) Four_List: expected heavy atom position.
                       -----------
                             .        
                             .
                             v                  
            +----------------------------------+        
            . Analysis Self_List and Four_List .  search common atoms
            +----------------------------------+
                          .   
                          v   
                   -----------    
                  ( coords_ha )   Output file of expected heavy atom position.
                   -----------



  #
  #    SIR      - sub-program of MIR and MIR_II which uses TRAHALO
  #               for given F_obs, F_derivative ( with or without anomalous
  #               scattering ) searchs heavy-atom positions, refines 
  #               (unphased or phased if there is input phases)
  #               and computes the phases of native structure factors.
  #               Without F_obs and with anomalous signal of F_derivative 
  #               - SAD case.


          Var. 1  Input: !F!_obs and !F!_der
                  Output: refined coordinates of heavy atoms and
                          file of Hendrickson-Lattman coefficients (ABCD).

                  Additional input: 
                    1. coordinates of known atoms.

                 Program searches atoms in diff Patteson / TRAHALO /,
                 refines its (unphased) and computes the phases of native
                 structure factors.

          Var. 2  Input: !F!_obs , !F!_der and Phase ( some phases. For example:
                                                  phases of another derivative)
                  Output: refined coordinates of heavy atoms or
                          file of Hendrickson-Lattman coefficients (ABCD).

                  Additional input: 
                    1. coordinates of known atoms.
                    2. coordinates corresponded on input phases. 


                 Program searches atoms in diff Patteson / TRAHALO / using
                 input phases refines its and computes the phases
                 of native structure factors.
                 Refinement is phased if input parameter RMOD='P'

          Var. 3  Input: !F!_obs , !F!_der , coordinates of heavy atoms

                  Additional input: 

                    1. file of input phases. 

                  Output: refined coordinates of heavy atoms and
                          file of Hendrickson-Lattman coefficients (ABCD).

                 Program just refines coordinates of atoms.
                 and computes the phases of native structure factors.
                 Refinement is phased if there is input phases and
                 input parameter RMOD='P'

          Var. 4  Input: !F!_der with anomalous signal.
                  SAD case.

                  Output: refined coordinates of heavy atoms and
                          file of Hendrickson-Lattman coefficients (ABCD).


                """""""""""""""""""""""""""""
                "          SIR              "
                "                           "
                """""""""""""""""""""""""""""

   ---------              ----------   ----------    <-- Start is here if
  (   Fder  )            (   Fnat   ) (  Phases  )       there is not input file
   ---------              ---------    ----------        of heave atoms.
    .     .                    .       .    .     / var 1 and var2 /
    .     v                    v       V    .
    .    +------------------------------+   .
    .    .          TRAHALO            .   . 
    .    +------------------------------+   .
    .                   .                   .
    v                   v                   v
    .                   .                   .      <-- Start is here for 
   ---------       ---------    ----------  .       variant with input file
  (   Fder  )     ( COORD.HA ) (   Fnat   ) .       of heavy atoms.
   ---------       ---------    ----------  .       / var 3 /
    .     .             .          .       /.
    .     .             .          .      / .     
    .     .             .          .     /  .     
    .     .             .          .    /   .     
    .     v             v          v   .    .
    .     .             .          .   v    .     
    .    +------------------------------+   .
    .    .           REFINE             .   .  Unphased or phased refinement
    .    +------------------------------+  /  in the first cycle refine Scale2
    .                  .                  /   after that refine XYZ and Occ.
    .                  v                 /
      \          -------------------    /
        \       ( refined COORD.HA  )  /
          \      -------------------  /
           .            .            .
           v            v            v
         +------------------------------+
         .         PHASE                .
         +------------------------------+
                        .
                        v  
                     --------
                    ( PHabcd )  
                     --------

  #
  #    MIR           performs automated heavy atom search and phasing:
  #                  computes the phases of native structure factors by use
                     information of several derivatives. Can use the phases
                     from other sources. Can refine phases by density 
                     modification  /solvent flattening/

    What program is doing:

 I. variant without input phases

    Part 1.

           For each derivative (i) program uses program SIR and
           stores coordinate "coord_i(i)", ABCD coefficients: "abcd_i(i)",
           power: "power_i(i)".
         
    Part 2.

          For a pair /i(j)/ of coordinates of i-th derivative and ABCD
          coefficients j-th derivative program uses SIR and store new
          coordinates: "coord_i(j)", ABCD coefficients: "abcd_i(j)",
          power: "power_i(j)".

          For mode FAST = "F" program choose best derivative / with
          maximal power: i_max / and uses SIR only for pairs j(i_max)

    Part 3.

         a. makes choice of best pair: j_best(i_best) and
            combines phases i_best and j_best(i_best) --> sum_ABCD

         b. using sum_ABCD applies SIR for next derivative j with
            abcd_j(i_best), coord_j(i_best). 

         c. combines ABCD of j-derivative with sum_ABCD and repeats b.
            for next derivative.

    Part 4.

         applies density modification procedure: DENMOD.

 II. variant with input phases

    Part 1.

           For each derivative (i) program uses program SIR ( with input
           phases) and stores coordinate "coord_i(i)", ABCD coefficients:
           "abcd_i(i)", power: "power_i(i)". 
         
    Part 2.

           Combines ABCD of all derivative with input_ABCD.

    Part 3.

         applies density modification procedure: DENMOD.


    Program produces several output files:

     <file_derivative-name>.crd - file of heavy-atom coordinates for all
                                  derivative
     mir_abc.dat                - output file of HL_coefficients. Use program
                                  ABCDPH  to compute phases from ABCD or
                                  to combine ABCD files
     denmod_ai.dat   - ABCD coefficients of refined phases



                """""""""""""""""""""
                "       MIR         "
                "                   "
                """""""""""""""""""""

 I. variant without input phases


   ---------   -------       -------   --------
  ( Fder_1  ) ( Fder_2) ... ( Fder_4) ( Fnat   )
   ---------   -------       -------   --------
          .        .          .         .      
          v        v          v         v     
         +--------------------------------+    
         .            SIR                 . SIR separately for each derivative
         +--------------------------------+   
                        .                    
                        v              
        ---------    ---------        --------       
       (  ABCD_1 )  (  ABCD_2 )  ... ( ABCD_4 )  ABCD,Power and HA coords for
        ---------    ---------        --------   each derivative. 
        ----------   ----------      ----------       
       ( COOR.HA_1) ( COOR.HA_2) ...( COOR.HA_4)  
        ----------   ----------      ----------   
           .            .              .
           v            v              v
         +--------------------------------+    
         .            SIR                 . SIR for each pair derivatives  
         +--------------------------------+ searchs heavy-atom positions and 
           .            .           .       computes ABCD for first using 
           v            v           v       phases from second.  
       ----------   ----------   ----------
      (PHabcd_1_2) (PHabcd_1_2) (PHabcd_1_2) ... ABCD, coords and power 
       ----------   ----------   ----------      for all pair derivatives   
                             


         ----------------     ---------------
        ( PHabcd_j_i_best)   (PHabcd_i_i_best)  best pair (i-j) of derivatives
         ----------------     ---------------
                    .                 .
                    v                 v         
                 +-----------------------+    
                 .         ABCDPH        .      combine phase information 
                 +-----------------------+
                         .     
                         v     
                     ---  for all rest derivatives ---
                         .     
                         .               current k-derivative
                         v               ---------------
                         .              (COOR.HA_k_i_best) 
                         .               ---------------- 
                         .                     .
                         v                     v
                   -----------        +------------------+
    combined ABCD ( SUMabcd   )------>.       SIR        .       
                   -----------        +------------------+
                      .                     .
                      .                     .
                      .                 ----------
                      ^                (   ABCD_k )  for k-derivative
                      .                 ----------
                      .                     .
                      .                     v
                   ---------        +------------+
                  ( SUMabcd )   --> .   ABCDPH   .   combine phase information
                   ---------        +------------+
                      !                   .
                      ^                   v
                      !            -------------
                      --------<---( SUMabcd-new )   combined ABCD
                                   -------------
                                          .
                                          .
                                          v            
                                       +--------+    
                                       . DENMOD .     
                                       +--------+   
                                          .           
                                          v
                                        --------
                                       (  ABCD  )    refined phases
                                        --------
 II. variant with input phases


 -------   ------     -------   ------   ------------
( Fder_1) (Fder_2)...( Fder_4) ( Fnat ) (input phases)
 -------   ------     -------   ------   ------------
      .       .          .         .      .  
      v       v          v         v      V
     +-------------------------------------+    
     .              SIR                    . SIR separately for each derivative
     +-------------------------------------+   
                        .                    
                        v              
        ---------    ---------        --------       
       (  ABCD_1 )  (  ABCD_2 )  ... ( ABCD_4 )  ABCD,Power and HA coords for
        ---------    ---------        --------   each derivative. 
        ----------   ----------      ----------       
       ( COOR.HA_1) ( COOR.HA_2) ...( COOR.HA_4)  
        ----------   ----------      ----------   
           .            .              .
           v            v              v

                              
                           for all derivatives
                              
                                       current i-derivative
                   ----------            ---------
                  (input ABCD)          (COOR.HA_i) 
                   ---------             --------- 
                      .                     .
                      v                     v
                   -----------        +------------------+
    combined ABCD ( SUMabcd   )------>.       SIR        .       
                   -----------        +------------------+
                      .                     .
                      .                     .
                      .                 ----------
                      ^                (   ABCD_i )  for i-derivative
                      .                 ----------
                      .                     .
                      .                     v
                   ---------        +------------+
                  ( SUMabcd )-----> .   ABCDPH   .
                   ---------        +------------+
                      !                   .
                      ^                   v
                      !            -------------
                      --------<---( SUMabcd-new )   combined ABCD
                                   -------------
                                         .
                                         .
                                         v            
                                     +--------+    
                                     . DENMOD .     
                                     +--------+   
                                         .           
                                         v
                                      --------
                                     (  ABCD  )    refined phases
                                      --------

  #
  #     DENMOD  - sub-program of MIR and MIR_II which uses TRAHALO
  #               phase refinement by density modification /solvent flattening/
  #               Program uses Packing function and can computes expected
                  percent of solvent.            


                """""""""""""""""""""""""""""""""""""""""""""
                "       DENMOD       / SOLVENT FLATTENING / "
                """""""""""""""""""""""""""""""""""""""""""""



                    ---------------   -------
                   ( ABCD nat      ) ( F nat )
                    ---------------   -------
                           .           .
                           v           .
                   +--------------+    .
                   .    ABCDPH    .    v
                   +--------------+    .
                           .           .
      i = i + 1            v           .
   / next cycle /      --------        .
 +------------------->( mi Phi )       .
 .                     --------        .
 .                         v           .
 .               +---<-----.           .
 .               .         v           v
 .               .         +-----------+
 .               .         .  CFFT     .
 .               .         +-----------+
 ;               v               .
 .               .               .        
 .               .               v
 ;               v            -------
 .               .           (   Ri  )
 .               .            -------
 .               .               .
 .               .               .
 .               .               V
 .               .               .    +-----------+
 .               .               .    .  TRPACK   .  Packing function
 .               .               .    +-----------+
 .               .               .         .
 .               .               .         V
 ;               v               .      -------
 .               .               .     ( Pdens )  file of Packing function 
 .               .               .      -------
 .               .               .         .
 .               .               v         V        
 .               .    +------------------------------------+
 .               .    .    MODDEN . multiplication density .
 .               .    +------------------------------------+
 .               .               . 
 .               .               .       /remove density from bad regions/  
 .               .               v
 ;               v            -------
 .               .           (   Ri  )
 .               .            -------
 .               .               .
 .               .               v                  /remove negative density/
 .               .  +-----------------------------+
 .               .  . MODDEN . "C" . Rmax > Ri > 0.  truncates density
 .               .  +-----------------------------+
 .               .               .                    
 .               .               .                     """"""""""""
 .               .               v      ------>------->" ENVELOPE "
 .               .             -------/      +--<------"          "
 .               .            (  R'i  )      .         """"""""""""
 ;               v             -------       V
 .               .               .        -------
 .               .               .       (  Renv )  file with envelope
 .               .               .        -------  
 .               .               .          .    
 .               .               .          .    
 .               .               v          v   
 .               .   +---------------------------------+
 .               .   . MODDEN .  "W"  . with CONST_H2O .   filter procedure
 .               .   .        .       .                .
 .               .   +---------------------------------+
 .               .              .
 .               .              .
 .               .              v
 .               .              .
 ;               v              .
 .               .              .
 .               .              .
 .               .              v    
 .     -------   .           -------
 .    ( F nat )  .          (   Ri  )
 .     -------   .           -------
 .        .      .              .
 ;        v      v              v
 .  +-------------+      +--------------+
 .  .   FPLUSFOM  .      .     RFFT     .
 .  +-------------+      +--------------+
 .        .                .           .
 .        v                v           v
 .   ------------       -------    --------
 .  ( mi + F nat )     ( F i+1 )  ( Ph i+1 )
 .   ------------       -------    --------
 .        .                .           .
 .        v                v           .
 .        .            +-------+       .
 .        .---->---->  .PSCALE .       v
 .        .            +-------+       .
 .        v                .           .
 ;        .                v           v
 .        .            ----------      .     ----------
 .        v           ( F i+1 sc )     .    ( ABCD iso )
 .        .            ----------      .     ----------
 .        .                .           .          .
 .        v                v           v          v
 .        .              +---------------+        .
 .        .              .   PHABCD      .        .
 .        .              +---------------+        .
 .        .                     .                 .
 .        .                  ----------           v
 .        v                 ( ABCD i+1 )          .         
 .        v                  ----------           .
 .        v                      v                v
 .        .              +--------------------------+
 .        +----->----->  .          ABCDPH          .
 .                       +--------------------------+
 .                                     . /phase combination/
 +                                     v
 .                            -------------------
 .                           ( mi+1 Ph i+1 comb  )
 .                            -------------------
 .   i=i+1                             .
 +-------------<-----------------<-----+     /next cycle/




            """""""""""""""""""""""""
  -->----> "------------+ ENVELOPE "
  --<---<- " --+        .          "
           """ . """""""""""""""""""
               .        .
               ^        v
               .   +--------------+
               .   .     RFFT     .
               .   +--------------+
               .     .        .
               .     .        .
               ^     v        v
               .  -------   ------
               . (  Fm   ) ( Phm  )
               .  -------   ------
               .     .        .
               ;     .        .
               .     .        .
               ^     v        v
               .   +-----------------+
               .   . CFFT .  Badd    .  Badd = Benv= 500 -additional thermal
               .   +-----------------+         factor for envelope 
               .          .
               .          v
               .    +--------------+    Computes expacted solvent percent
               .    .  HISTOGRM    .    and defines corresponding level
               .    +--------------+    of electron density COSNST_H2O
               .          .
               .          v
               .      -------
               +--<--( R env )   mask_file
                      -------



  #
  #    MIR_II        performs automated phasing: computes the phases of 
  #                  native structure factors by use information of several
                     derivatives (structure factors and coordinates). 
                     Can refine phases by density modification /solvent 
                     flattening/
                     / this program is auxiliary program, just refines
                       heavy atom position, computes ABCD coefficients
                       and combines its. /                                     


                """""""""""""""""""""
                "       MIR_II      "
                "                   "
                """""""""""""""""""""
   ---------   -------       -------   --------
  ( Fder_1  ) ( Fder_2) ... ( Fder_4) ( Fnat   )
   ---------   -------       -------   --------
          .        .          .         .      
          v        v          v         v     

                and

   ---------   -------       -------  
  ( coord_1 ) (coord_2) ... (coord_4) 
   ---------   -------       -------  
          .        .          .               
          v        v          v              
         +--------------------------------+    
         .            SIR                 . SIR separately for each derivative
         +--------------------------------+ only refinement  
                        .                    
                        v              
        ---------    ---------        --------       
       (  ABCD_1 )  (  ABCD_2 )  ... ( ABCD_4 )  ABCD,Power and HA coords for
        ---------    ---------        --------   each derivative. 
        ----------   ----------      ----------       
       ( COOR.HA_1) ( COOR.HA_2) ...( COOR.HA_4)  
        ----------   ----------      ----------   
           .            .              .
           v            v              v




                          ----------
                         (   ABCD_i )  for all derivative
                          ----------
                               .
                               v
                               .
         ---------        +-----------+
        ( SUMabcd )-----> . ABCDPH    .
         ---------        +-----------+
             !                  .
             ^                  v
             !            -------------
             --------<---( SUMabcd-new )   combined ABCD
                          -------------
                                .
                                v            
                           +--------+    
                           . DENMOD .     
                           +--------+   
                                .           
                                v
                            --------
                           (  ABCD  )    refined phases
                            --------



    How to combine phase information and compute phases:
    Use programs ABCDPH and PHABCD

                             --------
                            ( PHabcd )  input file of ABCD
                             --------
                                .
                                .
 input file of sum_ABCD         .
 / if you want to sum /         v
         ---------        +-----------+
        ( SUMabcd )-----> . ABCDPH    .
         ---------        +-----------+
                                .
                                v
                            -------------
                           ( SUMabcd-new )   combined ABCD
                            -------------
                                .
                                v            
                            +--------+    
                            . PHABCD .     
                            +--------+   
                                .           
                                v
                             --------
                            ( PHsum  )      combined phases
                             --------



C ==========================================================================


Appendix B.


       Example of CIfile of amplitudes:

         data_structure_9ins
         _struct.title ' insuline 9ins' 
         _cell.length_a      100.000
         _cell_length_b      100.000
         _cell.length_c      100.000
         _cell.angle_alpha    90.000
         _cell.angle_beta     90.000
         _cell.angle_gamma    90.000
         _symmetry.space_group_name_H-M  'P 1 21 1'
         loop_
         _refln.index_h
         _refln.index_k
         _refln.index_l
         _refln.F_meas_au
         _refln.F_meas_sigma_au
            2  3   4    12.3   1.2
           -2 -3  -4    11.4   1.1
          . . . . . . . . . . . . .

               or just:

         data_structure_9ins
         loop_
         _refln.index_h
         _refln.index_k
         _refln.index_l
         _refln.F_meas_au
         _refln.F_meas_sigma_au
            2  3   4    12.3   1.2
           -2 -3  -4    11.4   1.1
           . . . . . . . . . . . . .

          For intensities use:

          _refln.intensity_meas 
          _refln.intensity_sigma 

C ========================================================================

Appendix C. Examples of batch file



   MIR


# --------------------------------
mir <<stop
# --------------------------------
# first line :   "_DOC  <N>,Y,A "
#   N - means without DOC-file: "mir.doc"
#   Y - create new file or rewrite if it is old file
#   A - means to keep old contents and add new information
#
_DOC  Y
#
#
_FILE_F nat.hkl
#
#     Keywords:
#
#RESOL: MIN,MAX - resolution, default: 10 - 3 A
#D1:      < >   - intput file of derivative_1
#D2:      < >   - intput file of derivative_2
#D3:      < >   - intput file of derivative_3
#D4:      < >   - intput file of derivative_4
#FAST:  <F>,M,S - F means "FAST" mode, M - "MIDDLE" , S - "SLOW"
#                    Resolution  Npeaks  Trans_Func
#                 F      5         6        T  (standard)
#                 M      3        10        T  (standard)
#                 S      3        20        Ta (advanced)
#FILE_A:  < >   - intput file of abcd (BLANC format)
#H2O:     < >   - percent of solvent, for density modification procedure
#                 0 - choice of program
#                 default: without density modification procedure
#ANISO:  <N>/Y  - Y means anisoscaling Fnat and Fder.
#PST:    <N>/Y  - Y use pseudo-translation vector VPST
#VPST:  <0,0,0> - vector of pseudo-translation /in fract./
#
#       output files:
#
#      mir_fobs.dat - F_obs (BLANC format)
#      mir_der1.dat - F derivative (BLANC format)
#      mir_der2.dat
#      ............
#      mir_der1.crd - heavy-atom coordinates
#      mir_der2.crd
#      ............
#      mir_abc.dat   - output file of ABCD coefficients
#      denmod_ai.dat - ABCD coefficients after density modification procedure
#
_D1   der1.hkl
_D2   der2.hkl
_D3   der3.hkl
_D4   der4.hkl
_END
stop


   MIR (ccp4 version)


# --------------------------------
mir  <<stop
# --------------------------------
# first line :   "_DOC  <N>,Y,A "
#   N - means without DOC-file: "mir.doc"
#   Y - create new file or rewrite if it is old file
#   A - means to keep old contents and add new information
#
_DOC  Y
#
_FILE_F pap.mtz
#
#     MTZ file keywords:
#
#FP:       < >   - label of Fobs or Fobs(+)
#SIGFP:    < >   - label of sigma Fobs or sigma Fobs(+)
#FP-:      < >   - label of Fobs(-)
#SIGFP-:   < >   - label of sigma Fobs(-)
#DP:       < >   - label of delta_anom Fobs
#SIGDP:    < >   - label of sigma of delta_anom Fobs
#
#FPH1:     < >   - label of Fder1 or Fder1(+)
#SIGFPH1:  < >   - label of sigma Fder1 or sigma Fder1(+)
#FPH1-:    < >   - label of Fder1(-)
#SIGFPH1-: < >   - label of sigma Fder1(-)
#DPH1:     < >   - label of delta_anom Fder1
#SIGDPH1:  < >   - label of sigma of delta_anom Fder1
#
#FPH2:     < >   - label of Fder2 or Fder2(+)
#SIGFPH2:  < >   - label of sigma Fder2 or sigma Fder2(+)
#FPH2-:    < >   - label of Fder2(-)
#SIGFPH2-: < >   - label of sigma Fder2(-)
#DPH2:     < >   - label of delta_anom Fder2
#SIGDPH2:  < >   - label of sigma of delta_anom Fder2
#
#FPH3:     < >   - label of Fder3 or Fder3(+)
#SIGFPH3:  < >   - label of sigma Fder3 or sigma Fder3(+)
#FPH3-:    < >   - label of Fder3(-)
#SIGFPH3-: < >   - label of sigma Fder3(-)
#DPH3:     < >   - label of delta_anom Fder3
#SIGDPH3:  < >   - label of sigma of delta_anom Fder3
#
#FPH4:     < >   - label of Fder4 or Fder4(+)
#SIGFPH4:  < >   - label of sigma Fder4 or sigma Fder4(+)
#FPH4-:    < >   - label of Fder4(-)
#SIGFPH4-: < >   - label of sigma Fder4(-)
#DPH4:     < >   - label of delta_anom Fder4
#SIGDPH4:  < >   - label of sigma of delta_anom Fder4
#
_FP       F
_SIGFP   SIGF
_FPH1     F_hg
_SIGFPH1   SIGF_hg
_DPH1     DELFANO_hg
_SIGDPH1   SIGDELF_hg
_END    <--- end of MTZ block
#
#     Keywords:
#
#RESOL: MIN,MAX - resolution, default: 10 - 3 A
#FAST:  <F>,M,S - F means "FAST" mode, M - "MIDDLE" , S - "SLOW"
#                    Resolution  Npeaks  Trans_Func
#                 F      5         6        T  (standard)
#                 M      3        10        T  (standard)
#                 S      3        20        Ta (advanced)
#FILE_A:  < >   - intput file of abcd (BLANC format)
#H2O:     < >   - percent of solvent, for density modification procedure
#                 0 - choice of program
#                 default: without density modification procedure
#ANISO:  <N>/Y  - Y means anisoscaling Fnat and Fder.
#PST:    <N>/Y  - Y use pseudo-translation vector VPST
#VPST:  <0,0,0> - vector of pseudo-translation /in fract./
#
#       output files:
#
#      mir_fobs.dat - F_obs (BLANC format)
#      mir_der1.dat - F derivative (BLANC format)
#      mir_der2.dat
#      ............
#      mir_der1.crd - heavy-atom coordinates
#      mir_der2.crd
#      ............
#      mir_abc.dat   - output file of ABCD coefficients
#      denmod_ai.dat - ABCD coefficients after density modification procedure
#
_H2O  0
_END
stop


   TRAHALO


# --------------------------------
trahalo  <<stop
# --------------------------------
# first line :   "_DOC  <N>,Y,A "
#   N - means without DOC-file: "trahalo.doc"
#   Y - create new file or rewrite if it is old file
#   A - means to keep old contents and add new information
#
_DOC  Y
#
_FILE_D der1
_FILE_F nat
#
#     Keywords:
#
#RESOL: MIN,MAX    - resolution <default from FILE_Fobs>
#NP:      <20>     - number of peaks to check, MAX =20, =6 for FAST
#GAUSS:   <Y>,N    - N means a sphere, Y - gaussian.
#RAD:     <2.5>    - radius of sphere of model of heavy atom or width
#                    of gaussian /in angstroms/.
#BOFF:    <400>    - 400 corresponds to RESmin=10A, BOFF=4*RESmin^2
#BADD:     <0>       BOFF and BADD mean :
#                    !F!new = !F!input *EXP(-BADD*RSQ)*(1-EXP(-BOFF*RSQ)
#                    BADD = -1 means automatical choice
#SORT:   P/D/<M>   - sort the list of atom positions according to:
#                    P - phasing power, D - density , M - mixed.
#SPEC:    <Y>/N    - Y means to use peaks in special  position.
#PACK:    <Y>/N    - N means Translation function without Packing function.
#PST:     <N>/Y    - Y use pseudo-translation vector VPST
#VPST:  <0,0,0>    - vector of pseudo-translation /in fract./
#SLIM:    <1.0>    - limit for DEL=Fder-Fnat. !DEL!>sd(DEL)*SLIM will used
#CLIM:    <3.0>    - limit for DEL=Fder-Fnat. !DEL!< DEL_MAX will used
#                    DEL_MAX = <DEL> + DEL_rms * CLIM, 0 means no this limit
#TRANS:   <Y>/N    - Y means advanced translation function, N standard
#FAST:    <F>/S    - F fast mode, automatical choice parameter forFAST run:
#                    NP=6, TRANS="N", res_max=5
#SCALE:   <Y>/N    - N means without scaling Fnat and Fder.
#ANISO:   <N>/Y    - Y means anisoscaling Fnat and Fder.
#REMOV:   <N>/Y    - remove origin peak
#COMB:   N/A/<Y>   - Y use combined diff. patterson (D_iso + Kemp * D_ano)
#                  - A use Anomalous diff. patterson
#FILE_A:   < >     - intput file of ABCD
#FILE_O:   name    - output file of heavy atoms, default: trahalo.crd
#
#           trahalo_abc.dat - output file of HL_coefficients.
#           Use program ABCDPH to compute phases from ABCD or to combine ABCD.
#
_COMB  y
_END
stop


   MIR_II


# --------------------------------
mir_II  <<stop
# --------------------------------
# first line :   "_DOC  <N>,Y,A "
#   N - means without DOC-file: "mir_II.doc"
#   Y - create new file or rewrite if it is old file
#   A - means to keep old contents and add new information
#
_DOC  Y
#
_FILE_F nat
#
#     Keywords:
#
#RESOL: MIN,MAX - resolution, default: 10 - 3 A
#D1: < >   - intput file of derivative_1
#D2: < >   - intput file of derivative_2
#D3: < >   - intput file of derivative_3
#D4: < >   - intput file of derivative_4
#C1: < >   - intput coordinate file of derivative_1
#C2: < >   - intput coordinate file of derivative_2
#C3: < >   - intput coordinate file of derivative_3
#C4: < >   - intput coordinate file of derivative_4
#H2O:     < >   - percent of solvent, for density modification procedure
#                 0 - choice of program
#                 default: without density modification procedure
#ANISO:  <N>/Y  - Y means anisoscaling Fnat and Fder.
#PST:    <N>/Y  - Y use pseudo-translation vector VPST
#VPST:  <0,0,0> - vector of pseudo-translation /in fract./
#FILE_A:  < >   - intput file of abcd
#
#       output files:
#
#      <file_derivative-name>.crd - heavy-atom coordinates
#      mir_abc.dat   - output file of ABCD coefficients
#      denmod_ai.dat - ABCD coefficients after density modification procedure
#
_D1  der1
_C1  der1
_D2  der2
_C2  der2
_END
stop

C ========================================================================


Appendix D. Additional remarks.


  1. Unphased Refinement /without to use phases of native structure/ 
     heavy-atom parameters of some derivative and compute phases  of native
     structure.         

         Refinement minimize SUM(((!Fph(obs)!-!Fp!)-D)^2)

                where D=!Fph-Fp!calc=Scale2*EXP(-Toverall*RSQ)*Fh
                     Fp - structure factors of native crystal.
                     Fph- structure factors of derivative.
                     Fh - structure factors of heavy atoms.

         If we use anomalous scattering: 

                minimize SUM((DEL-D)^2)

                where DEL = sqrt(DEL_iso^2 + 0.75*DEL_ano^2)
                      DEL_iso = Fph(obs) - Fp(obs)    
                      DEL_iso = Fph(obs)(+) - Fph(obs)(-)    

  2. Phased Refinement / with to use phases of native structure / heavy-atom
     parameters of some derivative and compute phases  of native structure.

         Refinement minimize SUM((Fph(obs)-D)^2)  / vector difference /

                where  D=!Fph!calc=Scale1*(Fp+Scale2*EXP(-Toverall*RSQ)*Fh)
                       Fp - structure factors of native crystal.
                       Fph- structure factors of derivative.
                       Fh - structure factors of heavy atoms.

         
  3. Because the derivateves are independent of each other the simple way
     of Isomorphous replacement method is to use its separately and to combine
     its phase information by adding Hendrickson-Lattman coefficients in any
     combination. After that you can repeat calculation with new phases.
         
  4. There are two kinds of representation of phases:
              1. by angles - mcos(phi),msin(phi) , where m - figure of merit 
              2. by Hendrickson_Lattman coefficients ABCD.
     You can have HL cofficients:
              1. from program PHASE for heavy atom derivative.
              2. to transform the phases by program PHABCD.
     You can transform HL coefficients to the phases by program  ABCDPH. 
     Coefficients ABCD are very usefull to combine phase information. You
     can do it by programs ABCDPH.

  5. File of coordinates of heavy atoms has the same format that usual file of
     coordinate. But this file contains additional information:

     _derivative.scale1     1.00000
     _derivative.scale2     1.51493
     _derivative.Toverall   0.00000

     Additional atomic types. You need to define that only for wavelength
     other then Cu K alpha or for exotic atoms.

     loop_
     _atom_type.symbol
     _atom_type.scat_Cromer_Mann_a1
     _atom_type.scat_Cromer_Mann_a2
     _atom_type.scat_Cromer_Mann_a3
     _atom_type.scat_Cromer_Mann_a4
     _atom_type.scat_Cromer_Mann_b1
     _atom_type.scat_Cromer_Mann_b2
     _atom_type.scat_Cromer_Mann_b3
     _atom_type.scat_Cromer_Mann_b4
     _atom_type.scat_Cromer_Mann_c
     _atom_type.scat_dispersion_real
     _atom_type.scat_dispersion_imag
      AB    12.21261   3.13220   2.01250   1.16630
             0.00570   9.89331  28.99754   0.58260
           -11.52901   0.03110   0.01800
      CD    12.21261   3.13220   2.01250   1.16630
             0.00570   9.89331  28.99754   0.58260
           -11.52901   0.03110   0.01800

        Example of file of heavy atoms:

        These file must have extention "crd".

data_structure_2SAR
_entry.id             2SAR
_database_PDB.name   'HYDROLASE (ENDORIBONUCLEASE)'
_audit.creation_date 13-DEC-90
_struct.title         '---'
_file_creation_date  'D:15.41.27/ 4. 5.96 '
_cell.length_a       64.900
_cell.length_b       78.320
_cell.length_c       38.790
_cell.angle_alpha    90.000
_cell.angle_beta     90.000
_cell.angle_gamma    90.000
_symmetry.space_group_name_H-M  'P 21 21 21'
_symmetry.Int_Tables_number        19
_symmetry.cell_setting_number       1
loop_
_symmetry.equiv_pos_as_xyz
    +X,+Y,+Z,
    1/2-X,-Y,1/2+Z,
    -X,1/2+Y,1/2-Z,
    1/2+X,1/2-Y,-Z,
_derivative.scale1     1.00000
_derivative.scale2     1.51493
_derivative.Toverall   0.00000
loop_
_atom_type.symbol
_atom_type.scat_Cromer_Mann_a1
_atom_type.scat_Cromer_Mann_a2
_atom_type.scat_Cromer_Mann_a3
_atom_type.scat_Cromer_Mann_a4
_atom_type.scat_Cromer_Mann_b1
_atom_type.scat_Cromer_Mann_b2
_atom_type.scat_Cromer_Mann_b3
_atom_type.scat_Cromer_Mann_b4
_atom_type.scat_Cromer_Mann_c
_atom_type.scat_dispersion_real
_atom_type.scat_dispersion_imag
   AB    12.21261   3.13220   2.01250   1.16630
          0.00570   9.89331  28.99754   0.58260
        -11.52901   0.03110   0.01800
loop_
_atom_site.atom_number
_atom_site.label_atom_id
_atom_site.type_symbol
_atom_site.atom_type
_atom_site.label_alt_id
_atom_site.label_corr_id
_atom_site.label_res_id
_atom_site.label_seq_id
_atom_site.label_entity_id
_atom_site.cartn_x
_atom_site.cartn_y
_atom_site.cartn_z
_atom_site.occupancy
_atom_site.B_iso_or_equiv
_atom_site.thermal_displace_type
_atom_site.symmetry_multiplicity
    1 PT01 PT   . . . HA     1  1   62.734   13.515    7.247   0.79  15.00 . .
    2 PT02 AB   . . . HA     1  1   33.713   56.017    0.622   0.73  15.00 . .
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 


C ========================================================================


Appendix E.

  Other useful blanc's programs:  

      readPDB               converts PDB cooordinates file to BLANC/CIF
      writePDB              converts cooordinates to PDB file
      TOBLANC               converts structure factors & phases to BLANC format
      FROMBL                converts structure factors & phases to CIF
      LOOKFL                internal files lookup
      PRINTD                converts maps to simple ASCII file
      ISOLINE               draws maps in isolines (Postscript format)
      PSCALE                Patterson origin peak scaling 
      ANISOSCL              calculates anisothermal scaling of two files
      COPYFL                changes file titles, scale, etc.
      CONCRD                modifies cooordinate files, convert fractional
                            to ort. and vice versa,...
      MTZ2CIF               reads MTZ file of CCP4
      DNS2CCP4              converts density map to CCP4 format
      BLANC2MTZ             converts Fobs, Fcalc and phases to MTZ file

  
      see also "blanc/doc/blanc_descr.txt" about BLANC


C ========================================================================