2.17                      *******************
                                  *  GREF WRITE-UP  *
                                  *******************
        
        
           GREF is program for the refinement of rigid groups against x-ray 
        diffraction data. It can be used to refine entire protein domains, 
        substructures or even individual atoms.  It is space group general and 
        can refine up to 24 groups with a total of up to 20000 atoms in the 
        asymmetric unit.  Each input atom must belong to a group, but the 
        atoms can be partitioned into groups in any possible manner.  The 
        program is also used to refine heavy atom positions by defining each 
        heavy atom to be a "one atom group", and refining only the group 
        centroid position, occupancy and  (possibly) thermal factor (e.g. omit 
        refinement of the group orientation parameters). The program can read 
        any of the "merged" reflection files input to PHASIT (for heavy atom 
        refinement against isomorphous or anomalous scattering differences) or 
        a general file for protein group refinement against native data. 
        Scattering factors can be either the normal type for refinement 
        against native data or isomorphous differences, or 2*delta f" for 
        refinement against anomalous scattering differences. One can select 
        all data, only centric data, or only acentric data for the 
        calculations. The output refined coordinate file can be used as input 
        to PHASIT for subsequent phase calculations.
        
        INPUT DATA (UNIT 5)
        
        CARD 1  PAMFIL                   (free format)
        
                PAMFIL = Name of input file containing cell parameters, 
                         symmetry information etc.
          
        
        CARD 2  INPCDS                   (free format)
        
                INPCDS = Name of file containing input atomic coordinates.   
        
                                                                          
        CARD 3  INPREF                   (free format)  
        
                INPREF = Name of file containing input reflection data.
                
        
        CARD 4  NCYCLS,IFOUR,SC,TO,CUTS,CUTMN,CUTMX,IWGHT,NXSCAT  (free format)
        
                                NCYCLS = # of refinement cycles (= 0 for
                                         a single structure factor calculation)
        
                                 IFOUR = 0 for no Fourier coefficient output.
                                       = 1 to write final Fourier coefficients
                                         to file.
        
                                    SC = scale factor, such that Fobs=SC*Fcalc.
        
                                    TO = Overall isotropic thermal factor. If
                                         zero, then individual thermal factors
                                         for each group must be supplied. If
                                         non-zero, applies to all atoms, and
                                         thermal factors for each group SHOULD
                                         NOT be input.
        
                                  CUTS = Data selection cutoff. Rejects data
                                         with Fobs < CUTS*Sig(Fobs).
        
                                 CUTMN = Data selection cutoff. Rejects data
                                         with sin(theta)/lambda < CUTMN.
        
                                 CUTMX = Data selection cutoff. Rejects data
                                         with sin(theta)/lambda > CUTMX.
        
                                 IWGHT = Weighting factor indicator.
                                       = 0 for weights of 1./Sig(Fobs)**2
                                       = 1 for unit weights.
        
                                NXSCAT = number of additional atomic
                                         types for which scattering
                                         factors will be input. Note
                                         that 20 types are already
                                         stored in the program (see
                                         below), thus this is usually
                                         nonzero only for exotic
                                         atoms or wavelengths other
                                         than CU K alpha.             

 
        CARD 4A OUTREF                   (free format)
        
                     ***** Include this card ONLY if IFOUR=1 *****
       
 
        OUTREF = Name of output phased reflection file
        
                                                              
        CARD 4B OUTCDS                   (free format)
        
                   ***** Include this card ONLY if NCYCLS > 0 *****

        
        OUTCDS = Name of output coordinate file
       

        CARDS 4C     Extra scattering factors      (all free format)

                   ***** Include this set of records ONLY if NXSCAT > 0 *****

            Up to 5 additional atomic types may be input.  For each additional
            atomic type, include the following 3 records

        REC 1     (A(J),J=1,4)                       (free format)

                                             A(J) = Coefficients for analytical
                                                    approximation to scattering
                                                    factors, as in Int. Tables,
                                                    Vol IV, pages 99-101.

        REC  2    (B(J),J=1,4) , C                   (free format)

                                             B(J) = Coefficients for analytical
                                                    approximation to scattering
                                               C  = factors, as in Int. Tables,
                                                    Vol IV, pages 99-101.

        REC 3     DEL f' , DEL f''                   (free format)

                                         DEL f'  = real part of anomalous
                                                   scattering correction term.

                                         DEL f'' = imaginary part of anomalous
                                                   scattering correction term.
 
        
        CARD 5 IFLTYP,ICLTYP,ISFTYP,MINCEN,IMODE     (free format)
        
                                       These parameters indicate what type of
                                       reflection file is input, what type of
                                       data is to be used, and what scattering
                                       factors are to be used.
        
                                IFLTYP = 0 for h,k,l,FO,Sig(FO) input, uses
                                         FOBS=FO and SIG= Sig(FO).
        
                                       = 1 for h,k,l,FP,Sig(FP),FPH,Sig(FPH)
                                         input, uses FOBS=ABS(FP-FPH) and
                                         SIG=mean Sig.
              
                                       = 2 for h,k,l,FP+,Sig(FP+),FP-,Sig(FP-)
                                         input, uses FOBS=ABS(FP+ - FP-) and
                                         SIG=mean Sig.
        
                                       = 3 for h,k,l,FP,Sig(FP),FPH+,Sig(FPH+),
                                         FPH-,Sig(FPH-) input, uses
                                         FOBS=ABS(FPH+ - FPH-) and SIG=
                                         (Sig(FPH+)+Sig(FPH-))/2.
        
                                ICLTYP = 0 to use all data types.
                                       = 1 to use only centric data.
                                       = 2 to use only acentric data.
        
                                ISFTYP = 0 to use normal scattering factors.
                                       = 1 to use only 2.*delta f" as 
                                         scattering factors.
        
                                MINCEN = minimum number of centric reflections
                                         to be used without including 25%
                                         strongest differences for acentric
                                         reflections. Applied only if ICLTYP=1
                                         (suggested value=75, but space group
                                         considerations may dictate otherwise,
                                         see NOTES).
        
                                 IMODE = 0 If atom types derived from first
                                         character in atom name (only C,N,O,S,
                                         Fe recognized).
                                       = 1 If atom type code number explicitly
                                         input for each atom.
               
        
        CARD 6  (NGP, NAG(I), I=1,NGP)     (free format)
        
                                   NGP = # of groups (each atom must belong to
                                         a group)
                                NAG(I) = # of atoms in group I. It is assumed
                                         that the first NAG(1) atoms form group
                                         1, the next NAG(2) atoms form group 2
                                         etc.
        
        
        CARD 7  (OCC(I), I=1,NGP)          (free format)
        
                                 OCC(I) = Occupancy factor for group I.
               
        
        CARD 8  (BETA(I), I=1,NGP)         (free format)
        
                               BETA(I) = Isotropic thermal factor for group I.
                                         NOTE! Include this card only if TO
                                         is zero.
                                 
        
          FOLLOWING CARDS ARE TO BE INCLUDED ONLY IF REFINING ( NCYCLS > 0 )
        
               
        CARD 9  ISC,ITO                    (free format)
        
                                   ISC = 0 to hold scale factor fixed.
                                       = 1 to refine
        
                                   ITO = 0 to hold overall thermal factor
                                         fixed.
                                       = 1 to refine. (it can be refined only
                                         if TO > 0 ).
        
              The following card must be repeated for each of the NGP groups.
        
        CARDS 10  ITX,ITY,ITZ,IRX,IRY,IRZ,IBT,IOC    (free format)
        
                                  ITX =  0 to hold group centroid fixed 
                                         at respective x,y, or z coordinate.
                                  ITY =  1 to refine group centroid
                                         translation for respective coordinate.
                                  ITZ =   
        
                                  IRX = 0 to hold group orientation angle
                                        fixed with respect to x,y,or z
                                  IRY = axis (orthogonal axes).
                                        1 to refine group rotation angle  
                                  IRZ = about corresponding axis (all
                                        rotations about group centroid).
        
                                  IBT = 0 to hold group thermal factor
                                        fixed.
                                      = 1 to refine. (applicable only if
                                        TO is non zero.)
        
                                  IOC = 0 to hold group occupancy factor
                                        fixed.
                                      = 1 to refine.
        
        
                                  *****  FILES  *****
        
        INPREF -   INPUT REFLECTION DATA           (free format)
        
           This file can have any of 4 types of structures, with the particular
        type designated by IFLTYP.  All types are read in free format, i.e.
        each item must be separated by at least one blank or a comma. For all
        types there should be data for one reflection in each record.
        
        For IFLTYP=0    records with h, k, l, FP, Sig(FP)  and the data used
                        as input. Typically native data for protein refinement.
        
        For IFLTYP=1    records with h, k, l, FP, Sig(FP), FPH, Sig(FPH) and
                        the data used is ABS(FP-FPH), mean Sigma. Typically
                        isomorphous replacement data for heavy atom refinement.
        
        For IFLTYP=2    records with h, k, l, FP(h,k,l), Sig( FP(h,k,l) ),
                        FP(-h,-k,-l), Sig( FP(-h,-k,-l) ) and the data used
                        as ABS( FP(h,k,l) - FP(-h,-k,-l) ), mean Sigma.  
                        Typically native anomalous scattering data for heavy
                        atom refinement.
        
        For IFLTYP=3    records with h,k,l,FP,Sig(FP),FPH(h,k,l),
                        Sig( FPH(h,k,l) ),FPH(-h,-k,-l), Sig( FPH(-h,-k,-l) )
                        and the data used is ABS( FPH(h,k,l) - FPH(-h,-k,-l) )
                        and (Sig( FPH(h,k,l) ) + Sig( FPH(-h,-k,-l) ) )/2.
                        Typically derivative anomalous scattering data for
                        heavy atom refinement.  
        
                 
        INPCDS -  INPUT ATOMIC PARAMETERS  FORMAT (1X,A1,5X,A1,I3,A4,5F10.5,I5)
        
            One atom per record, containing CHN,RTYPE,IRES,ATOM,X,Y,Z,B,OC,ITYP
        
            
                                  CHN  = Single character chain identifier (not
                                         used)
             
                                 RTYPE = One letter amino acid code (not used)
        
                                  IRES = Sequence number (not used)
        
                                  ATOM = Atom name (used only if IMODE=0)
        
                                     X =
        
                                     Y =  Fractional atomic coordinates
        
                                     Z =
        
                                     B = Isotropic thermal factor (not used as
                                         TO or BETA values superseed it)
        
                                    OC = Occupancy factor (not used as OCC
                                         value superseeds it)
        
                                  ITYP = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
                                         16,17,18,19 or 20 for C,N,O,S,Fe,Pt,
                                         Hg,Au,Pb,Os,I,Zn,Ca,Mg,Cd,U,P,Br,Cl,
                                         or Sm, respectively. ITYP= 21
                                         through 20+NXSCAT for the additional
                                         types, in same order as originally
                                         input.  (This field used only if
                                         IMODE=1)
        
        
        OUTCDS - OUTPUT ATOMIC PARAMETER FILE  (same data and format as INPCDS)
        
           Generated only if NCYCLS > 0. Contains the new parameters. If heavy
        atom refinement was done this file can be inserted in a PHASIT deck
        for phase calculations. It can also be input back into GREF for
        further refinement. The format is compatible with the Hendrickson-
        Konnert program PROTIN, or with PHASIT's structure factor calculation
        mode.
                 
           Note that this file may have the same name as INPCDS, although
           the original contents will then be destroyed.
        
        OUTREF -  OUTPUT FOURIER COEFFICIENTS         (BINARY)
        
           Generated following last structure calculation only if IFOUR=1.
        
        Contains records of  h, k, l, FOBS, FCAL, PHI      where the indices 
        are INTEGERS and the other data REALS. PHI is in degrees. This file 
        can be used in program FSFOUR for Fourier calculations, and converted 
        to ASCII by program RD31.
        
        
                                   ***** NOTES *****
        
        1) Generally when refining heavy atom parameters against isomorphous 
        differences only centric data is used. In space groups where there is 
        an insufficent number of centric reflections to refine all needed 
        parameters, the program will include the 25% strongest differences for 
        acentric reflections. The input parameter MINCEN determines how many 
        acceptable centric reflections MUST be found to SUPPRESS the automatic 
        inclusion of the acentric data. A good value of MINCEN is 75, but in 
        some space groups it may be necessary to set it to a large 
        (unobtainable) number to force automatic inclusion of the strongest 
        differences for acentric data. An example of this would be space group 
        P2(1) with more than one heavy atom input. In that case there might be 
        a hundred or more centric reflections, but all will be h,0,l 
        reflections, thus the y coordinate of the second atom can not be 
        refined without including some acentric data.  Similarly, in space 
        group P1 only centric reflections should be requested (even though 
        there aren't any), but MINCEN should be nonzero. This will force ONLY 
        THE 25% LARGEST ACENTRIC DIFFERENCES to be used.  For orthorhombic 
        space groups there generally are enough centric reflections to refine 
        all parameters, thus MINCEN=75 is usually sufficient. The MINCEN 
        parameter is used only if ICLTYP=1, i.e when only centric reflections 
        are requested.
        
        2) When refining heavy atom parameters against anomalous scattering 
        differences, one should use only a certain percentage of the largest 
        differences. If ICLTYP=2 and ISFTYP=1, then heavy atom refinement 
        against anomalous scattering differences is assumed and the program 
        will automatically select the 25% strongest Bijvoet differences for 
        use in the calculations.
        
        3) If anomalous scattering data is used (ISFTYP=1), then the output 
        phases on file 31 are not correct as they are 90 degrees less than 
        their true values. This results from use of scattering factors of 
        2*delta f" instead of i*(2*delta f").  The computed structure factor 
        amplitudes however, are correct thus the refinement is still valid. 
        Note also that the structure factor calculation is insensitive to the 
        hand of the heavy atoms.
        
        4) Although the refined values of the thermal factors and occupancies 
        are output on the new parameter file, they are ignored on input as 
        these parameters are set based on values in the input control file. 
        Accordingly, one must update the control file if additional cycles are 
        to resume where previous cycles left off. Only the new positional 
        parameters are used from the input coordinate file.  One must also 
        update the scale factor in the input control file in a similar manner. 
        The new values of the scale, thermal and occupancy factors are listed 
        on the log file.
        
        5) If a group contains only a single atom, then the three orientation 
        angles can not be refined. If a group contains only two atoms, then 
        only two of the orientation angles can be refined (it usually doesn't 
        matter which two, although it may if the inter-atom vector happens to 
        be parallel to one of the orthogonal axes ). If only one atom is 
        input, then the scale factor and occupancy factor can not both be 
        refined as they are identical in that situation.
        
        6) With low resolution data, occupancy and thermal factors are highly 
        correlated and often can not be refined simultaneously.