MIR using CCP4, using L9 as an example:

(mtz data files and scripts for this example are on hermione in
   /home/dave/ccp4_examples)

Start with 4 mtz files:

L9 native data           = e100c_nat3.mtz
L9 iodine derivative  = e100c3i.mtz
L9 Hg derivative #1  = thim.mtz
L9 Hg derivative #2  = pcmb4.mtz

1) Merge the 4 mtz files into one mtz file using CAD
using the script "cad_L9.sh". The output mtz file containing
all 4 data sets is called "L9_merge.mtz".

2) Scale the 4 data sets using SCALEIT using the script "scaleit.sh"
The scaled mtz file is called "L9_merge_scale.mtz".

3) Use mlphare to do the phase calculation, using the script "mlphare_L9.sh".
The output mtz file with the new phases is called "L9_phase_mir.mtz".

4) Use DM to do solvent flattening, and FFT to calculate an electron density map.
The script to do both of these is called "L9_solflt.sh".
The output electron density map is called "L9_solflt.map".

 Solvent flattened MIR map calculated in this example using CCP4

==================================================

Here are the CCP4 scripts:

1) cad_L9.sh:

#!/bin/sh

cad             \
HKLIN1 e100c_nat3.mtz   \
HKLIN2 e100c3i.mtz   \
HKLIN3 thim.mtz         \
HKLIN4 pcmb4.mtz     \
HKLOUT L9_merge.mtz \
<< END-cad

LABIN FILE 1 E1=Fnat E2=Snat
LABIN FILE 2 E1=Fiod E2=Siod
LABIN FILE 3 E1=Fthim E2=Sthim
LABIN FILE 4 E1=Fpcmb4 E2=Spcmb4

Title L9 native, iod, thim, pcmb, merged data

END
END-cad
#
======================================================

2) scaleit.sh:

#!/bin/sh

set -e

scaleit    \
HKLIN L9_merge.mtz    \
HKLOUT L9_merge_scale.mtz    \
<< END-scaleit
TITLE FPHs scaled to FP
reso 90 2.2
refine isotropic

LABIN FP=Fnat SIGFP=Snat -
  FPH1=Fiod SIGFPH1=Siod -
  FPH2=Fthim SIGFPH2=Sthim -
  FPH3=Fpcmb SIGFPH3=Spcmb

CONV ABS 0.0001 TOLR  0.000000001 NCYC 4

END

=======================================================

3) mlphare_L9.sh:

#!/bin/sh

set -e

mlphare HKLIN L9_merge_scale.mtz \
       HKLOUT L9_phase_mir.mtz   \
 << eof-phare
TITLE  Phasing of L9 with mlphare using Iodine and Hg derivatives
RESO 95.0 2.2
CYCLE 10
ANGLE 10
LABIN FP=Fnat   SIGFP=Snat -
      FPH1=Fiod  SIGFPH1=Siod -
      FPH2=Fthim SIGFPH2=Sthim -
      FPH3=Fpcmb SIGFPH3=Spcmb
LABOUT ALLIN
FHOUT DERIV 1 2 3

 DERIV iod
 DCYCLE PHASE ALL REFCYC ALL KBOV ALL
 RESO 90.0 2.4
 ATOM   I     0.053  0.188  0.206  1.000   BFAC   25.000
 ATREF X ALL Y ALL Z ALL # OCC ALL
 ATOM   I     0.064  0.233  0.132  1.000   BFAC   25.000
 ATREF X ALL Y ALL Z ALL # OCC ALL

 DERIV thim
 DCYCLE PHASE ALL REFCYC ALL KBOV ALL
 RESO 90.0 2.4
 ATOM   HG    0.918  0.049  0.235  1.000 BFAC   25.000
 ATREF X ALL Y ALL Z ALL # OCC ALL

 DERIV pcmb
 DCYCLE PHASE ALL REFCYC ALL KBOV ALL
 RESO 90.0 2.4
 ATOM   HG    0.917  0.052  0.230  1.000 BFAC   25.000
 ATREF X ALL Y ALL Z ALL # OCC ALL

END
eof-phare
#

============================================

4) L9_solflt.sh:

#! /bin/sh

set -e

dm hklin L9_phase_mir.mtz hklout L9_phase_solflt.mtz \
   solout $CCP4_SCR/solvent.msk <<+
solc 0.55
mode solv hist mult
NCYC AUTO
SCHEME ALL
COMBINE OMIT SETS 10
LABIN FP=Fnat SIGFP=Snat PHIO=PHIB FOMO=FOM
LABOUT PHIDM=PHI1 FOMDM=W1
+

# Calculate map from density modified map.

fft hklin L9_phase_solflt  MAPOUT L9_solflt.map << +
TITLE Map from solvent flattening
reso 90.0 2.2
XYZLIM  0.0 1.0 -0.2 0.5 0.0 1.0
LABIN F1=Fnat SIG1=Snat PHI=PHI1 W=W1

END
#

============================================