diff options
author | Thomas White <taw@physics.org> | 2010-07-30 18:45:46 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:55 +0100 |
commit | 0bcabd65823ae0d86096f0877735bea4f3b95502 (patch) | |
tree | cda7abccc6ebe70cdd100b346c6fbaf166cf4082 /scripts/create-mtz | |
parent | 79fbfcf29a0ca1b84befab6214178e9885efde6a (diff) |
Improve scripts/create-mtz
Diffstat (limited to 'scripts/create-mtz')
-rwxr-xr-x | scripts/create-mtz | 57 |
1 files changed, 51 insertions, 6 deletions
diff --git a/scripts/create-mtz b/scripts/create-mtz index 6d38f704..366125f4 100755 --- a/scripts/create-mtz +++ b/scripts/create-mtz @@ -1,16 +1,61 @@ #!/bin/sh -f2mtz HKLIN $1 HKLOUT $1.mtz << EOF +OUTFILE=`echo $1 | sed -e 's/\.hkl$/.mtz/'` +TMPFILE=`echo $1 | sed -e 's/\.hkl$/.temp.mtz/'` +echo " Input: $1" +echo "Output: $OUTFILE" +if [ -e $TMPFILE -o -e $OUTFILE ]; then + echo " I'm about to write to the following files, but one or more" + echo " of them already exist:" + echo " " $TMPFILE + echo " " $OUTFILE + echo " To confirm that you want to continue, which will DESTROY the" + echo " current contents of these files, type 'y' and press enter." + read conf + if [ $conf != y ]; then + echo "Not confirmed." + exit 1 + else + echo "Proceeding" + fi +fi + +# Start by putting the CrystFEL intensities into an MTZ file +echo "Running 'f2mtz'..." +f2mtz HKLIN $1 HKLOUT $TMPFILE > out.html << EOF TITLE Reflections from CrystFEL NAME PROJECT wibble CRYSTAL wibble DATASET wibble - CELL 281 281 165.2 90 90 120 SYMM P63 +SKIP 1 +LABOUT H K L IMEAN SIGIMEAN +CTYPE H H H J Q +FORMAT '(F3.0,1X,F3.0,1X,F3.0,1X,F10.2,10X,F10.2)' +EOF + +if [ $? -ne 0 ]; then echo "Failed."; exit; fi + + +# Get the unit cell contents +echo "Running 'rwcontents'..." +rwcontents XYZIN ../../1JB0.pdb >> out.html << EOF +NHOH 2.3 lowt +EOF + +if [ $? -ne 0 ]; then echo "Failed."; exit; fi -SKIP 2 -LABOUT H K L I SIGMA -CTYPE H H H J Q -FORMAT '(F3.0, 1X, F3.0, 1X, F3.0, 1X, F10.2, 3X, F10.2, 1X, F11.2)' +# Run 'truncate' to turn Is into Fs +echo "Running 'truncate'..." +truncate HKLIN $TMPFILE HKLOUT $OUTFILE >> out.html << EOF +TRUNCATE NO +LABIN H=H K=K L=L IMEAN=IMEAN SIGIMEAN=SIGIMEAN +LABOUT H=H K=K L=L IMEAN=IMEAN SIGIMEAN=SIGIMEAN F=F SIGF=SIGF +CONTENTS C 16938 N 3310 O 3548 MG 96 P 3 S 89 CA 1 FE 12 H 17645 EOF + +if [ $? -ne 0 ]; then echo "Failed."; exit; fi + +rm -f $TMPFILE +echo "Done." |