next up previous contents
Next:  Words of FFTW's wisdom Up:  Using the program Previous:  The normal probability plot   Contents


 Working with X-PLOR and CNS

I can see at least three possible basic strategies when it comes to interfacing X-PLOR and GraphEnt. The first is to tell X-PLOR to (i) expand your reflections to P1, and (ii) to write them out in an ASCII X-PLOR reflection format. Then (and assuming that your text editor can record macros), edit this ASCII file and convert it to the format that GraphEnt expects. I wouldn't suggest this method for any but the simplest cases.

A second possible way is to use xdlmapman to convert an X-PLOR reflection file to a .mtz file. This may not work very well if your X-PLOR file contains weights and/or a figure-of-merit column.

A third, more reproducible way to do the trick, is to use f2mtz to convert the X-PLOR reflection file to .mtz, and then use the .mtz wrapper of GraphEnt to do the calculation. I will illustrate this with an example based on the nfo-mfc_phicalc_map.inp file distributed with X-PLOR 3.851, and assuming that you want to calculate a sigmaA-weighted 2mFo - DFc map.

The first step is to add the following bold lines in the X-PLOR script :


...........
...........
   do (fcalc=$k2*fcalc) (all)            { apply scaling to all reflections }
   declare name=diff   domain=reciprocal type=complex end

declare name=testamp domain=reciprocal type=complex end


   if ($sigmaa_flag=true) then
                           {* Compute sigmaa weights. *}
      declare name=eobs   domain=reciprocal type=real end
.............
.............
      do (diff = combine($nn * fom * ampl(fobs) - $mm * dd * ampl(fcalc), phase(fcalc)) )
         ( acentric and sel=1 )
      do (diff = combine(fom * ampl(fobs), phase(fcalc)) ) ( centric and sel=1  )

do (testamp = combine($nn * ampl(fobs) - $mm * dd * ampl(fcalc) / fom, phase(fcalc)) )

( acentric and sel=1 )

do (testamp = combine( ampl(fobs), phase(fcalc)) ) ( centric and sel=1 )


      undeclare name=eobs     domain=reciprocal end
      undeclare name=ecalc    domain=reciprocal end
      undeclare name=sigmaa   domain=reciprocal end
      undeclare name=dd       domain=reciprocal end
   else
                                      {* Compute unweighted n fo-m fc difference. *}
      do (diff = combine($nn * ampl(fobs) - $mm * ampl(fcalc), phase(fcalc)) )  ( sel=1 ) 
   end if

do (SIGMA = $nn * SIGMA)(acentric and sel=1)

write reflection output=GraphEnt.hkl testamp SIGMA fom end


   declare name=map1   domain=real end   
   do (map1=ft(diff))  ( sel=1 )    
   remarks  ($nn fo- $mm fc, phicalc) map  
   write map                                        
...............
...............

Please note that the assignment of standard deviation for the quantity $nn * ampl(fobs) - $mm * dd * ampl(fcalc)/fom is wrong in this example. If you are fluent with error propagation and you have derived the correct expression, please do mail it to me as well. When you execute the script, and in addition to the map file, you should also get a reflection file with the name GraphEnt.hkl which would look like this :


 NREFlection=      7271
 ANOMalous=FALSe { equiv. to HERMitian=TRUE}
 DECLare NAME=TESTAMP      DOMAin=RECIprocal   TYPE=COMP END
 DECLare NAME=SIGMA        DOMAin=RECIprocal   TYPE=REAL END
 DECLare NAME=FOM          DOMAin=RECIprocal   TYPE=REAL END
 INDE     2    0    0 TESTAMP=    37.700   360.000 SIGMA=     2.050
                   FOM=     0.878
 INDE     4    0    0 TESTAMP=    43.500     0.000 SIGMA=     1.710
                   FOM=     0.099
..........................

You can now convert this to .mtz with f2mtz :


f2mtz hklin GraphEnt.hkl hklout GraphEnt.mtz << eof
TITLE           2fo-fc coefficients from X-plor
CELL            54.476   42.565   51.722   90.000  104.684   90.000
SYMMETRY        5
LABOUT          H K L  FP PHIB SIGFP FOM
CTYPOUT         H H H  F  P    Q     W
SKIP            5
FORMAT          '(6X,3F5.0,9X,2F10.3,7X,1F10.3/23X,1F10.3)'
END
eof

Before running GraphEnt with this file, you need one additional step in order to put the columns in the order that GraphEnt expects to find them. You can do this with CAD, or mtzutils, or interactively with sftools :


Origin ~/trm6/17
Origin ~/trm6/17 d *.mtz
-rw-r--r--   1 glykos   user       205508 Mar  3 17:12 GraphEnt.mtz
Origin ~/trm6/17
Origin ~/trm6/17 sftools


OPTIONS ARE:

    ABSENT      MODE      CALC  CHECKHKL  COMPLETE    CORREL
    DELETE    EXPAND       FFT    FOURPT    HLCONV       I2F
      LIST       MAP    MAP2SF     MAPIN  MAPLIMIT    MAPOUT
   MAPSTAT     MERGE   OPTION1   PHASHFT      PLOT     PURGE
      READ    REDUCE   REINDEX     RFREE    SELECT       SET
      SORT      STOP    WINDOW     WRITE

>> give your option (or hit <return> to list options)
read GraphEnt.mtz

selected: READ    


 User:   glykos               Logical Name: GraphEnt.mtz
 Status: READONLY   Filename: GraphEnt.mtz

Reading file : GraphEnt.mtz                                                     
With format  : MTZ

  !!! WARNING, sort order improper !!!

  Sort order will be set to 1 2 3
  Use option SORT [h k l] later if needed
The following columns will be read:

TYPE  LABEL
===========

  F   FP                                                                        
  P   PHIB                                                                      
  Q   SIGFP                                                                     
  W   FOM                                                                       
  now sorting the reflections
  now merging the reflections

  7271 reflections read from file
     0 reflections appended to existing data
  7271 reflections newly created
  7271 reflections now stored in memory


>> give your option (or hit <return> to list options)
write ready.mtz column 1 3 2 4

selected: WRITE   



Writing file : ready.mtz                                                       
With format  : MTZ

Columns used :
 1 3 2 4                                                                        
The following columns will be written :

TYPE  LABEL
===========

  F   FP                                                                        
  Q   SIGFP                                                                     
  P   PHIB                                                                      
  W   FOM                                                                       

  (Q)QOPEN allocated #  1
 User:   glykos               Logical Name: ready.mtz
 Status: UNKNOWN    Filename: ready.mtz

>> give your option (or hit <return> to list options)
exit

selected: EXIT    



Normal end program sftools

Origin ~/trm6/17
Origin ~/trm6/17
Origin ~/trm6/17 d *.mtz
-rw-r--r--   1 glykos   user       205508 Mar  3 17:12 GraphEnt.mtz
-rw-r--r--   1 glykos   user       205508 Mar  3 17:13 ready.mtz


next up previous contents
Next:  Words of FFTW's wisdom Up:  Using the program Previous:  The normal probability plot   Contents
NMG, Nov 2002