[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: xplor to mtz format



***  For details on how to be removed from this list visit the  ***
***    CCP4 home page http://www.dl.ac.uk/CCP/CCP4/main.html    ***

Balaji Bhyravbhatla wrote:

>> I would like to know how to convert a XPLOR reflection file to CCP4 mtz
>> format. I have done this using f2mtz before but at that stage I had 
>> only one line per index. Now I have an additional FPART and WEIGHT 
>> which are on a second line....
>> 
>>  INDE     6    0    0 FOBS=   106.000     0.000 SIGMA=     1.300
>>                    FPART=    30.653     0.000 TEST=         0
>> WEIGHT=     1.000
>> 
>> I am sure people have done this, I am not sure how to do it myself!!!

I have a command file and nawk script to do just that, copied below.
These also let you get the FPART into an MTZ form for use in map
calculation, REFMAC, etc.:

***** FILE fpart_merge.com

#!/bin/csh -f
#
# Convert the bulk SF's from xplor...
#
nawk -f ../fpart.nawk ${bulkfile} > temp.bulk
#
f2mtz           hklin   temp.bulk \
                hklout  tempb1.mtz \
                >>      fpart_merge.log \
                <<      EOF_mtz
TITLE "Bulk solvent partial SF's calculated by XPLOR (${bulkfile})"
CELL ${cell}
SYMMETRY ${spgp}
LABOUT H K L FPART PHIP
CTYPOUT H H H F P
FORMAT '(3F6,2F12.4)'
SKIP 1
END
EOF_mtz
#
sortmtz hklout  tempb2.mtz \
        >>      fpart_merge.log    \
        <<      EOF_sort
H K L
tempb1.mtz
EOF_sort
#
#
rm temp.bulk tempb1.mtz
#
# Combine bulk SF's with observed data...
#
cad     hklin1  ${sffile} \
        hklin2  tempb2.mtz \
        hklout  temp0.mtz \
        >>      fpart_merge.log \
        <<      EOF_cad
TITLE Combine observed F's with Xplor bulk solvent partial SFc's
CELL ${cell}
LABIN   FILE 1 E1=FXTAL${xtal} E2=SIGFXTAL${xtal} E3=FreeR_flag
CTYPIN  FILE 1 E1=F E2=Q E3=I
LABOUT  FILE 1 E1=FXTAL${xtal} E2=SIGFXTAL${xtal} E3=FreeR_flag
LABIN   FILE 2 E1=FPART E2=PHIP
CTYPIN  FILE 2 E1=F E2=P
LABOUT  FILE 2 E1=FPART E2=PHIP
END
EOF_cad
#
rm tempb2.mtz
#
exit

(put this at the top of a map calc. command file, or to get the
xplor-calculated
bulk SF into refmac, etc.)

****** FILE fpart.nawk

# THIS IS A NAWK SCRIPT
#
# This nawk script reads a bulk solvent structure factor file output by
XPLOR,
# and puts H K L and FPART (F and PHI) on one line (throws away the
rest).
#
#-----------------------------------------------------------------------
------
# Typical input lines (they come in pairs):
#
# INDE     4    0    0 FOBS=  3996.500     0.000 SIGMA=    97.100
#                   FPART=  1315.550     0.000 TEST=         0 WEIGHT=
  1.000
#
BEGIN   {count = 0.
        printf "     H     K     L    PARTFC     PARTPHIC\n"
        }
{
        { if ($1 == "INDE" )
                {
                count = count + 1
                h = $2
                k = $3
                l = $4
                        { while (index($0,"FPART") == 0)
                                {
                                getline
                                }
                        }
                $0 = substr($0,match($0,"FPART"),length($0))
                partfc = $2
                partphic = $3
                printf "%6i%6i%6i%12.4f%12.4f\n", h, k, l, partfc,
partphic
                }
        }
}

This should help.

Dave

-----
David Borhani                   borhani@sri.org
Southern Research Institute     Tel: (205) 581-2555
2000 Ninth Avenue South         Fax: (205) 581-2877
Birmingham, AL 35205 U.S.A.
>