Misc commands
HA_PDB: Write out a heavy atom solution in PDB format
COMPARE_SOLN: Comparing two heavy-atom input files
FRACT_TO_CART and CART_TO_FRACT: Converting between fractional and Cartesian coordinates
MATH: simple operations on a dataset
GETISO: Get isomorphous differences
GETANOM: Get anomalous differences
GETPHASES: Get phase and F from A, B
Solve will write out your current heavy-atom model in PDB format if you simply specify the command HA_PDB. This can be done, for example at the very end of an automated run of SOLVE to output the final heavy-atom model in pdb format.
The output file will be called "ha.pdb".
Compare_soln reads in heavy atom sites from 2 files and compares them. It tests all possibilities for inversion and origin shifts that could make the solutions indistinguishable. It reports back if the solutions are the same and how many sites are the same if not . The files need to be in the format used by HEAVY and SOLVE. All lines in the 2 files except those that say "DERIVATIVE" or "XYZ" or "INANO" are ignored. Each time "DERIVATIVE" is encountered, a new derivative is started. Each XYZ is read as a keyword for xyz of a new atom in the current derivative. If "INANO" is specified for a derivative then the handedness of the solution is considered in comparing the solutions. Otherwise mirror images are considered the same. In all cases solutions that simply differ by an origin shift are considered the same. The grid used for FFT calculations is used to determine how close atoms must be to be considered the same, and the cutoff is 1 to 2 grid units. If you have a PDB file with your coordinates for one derivative, you can substitute PDB_XYZ_IN filename instead of the XYZ lines. You still need the DERIVATIVE statement.
For example:
If xyz1.dat looks like:
Derivative 1 xyz 0.45 0.93 .33 and xyz2.dat looks like Derivative xyz .51 .48 .93 derivative xyz .44 .351 .31then use a script like this:
!----------Script to compare to heavy-atom input files ------------------- infile(1) xyz1.dat infile(2) xyz2.dat compare_soln !-------------------------------------------------------------------------
FRACT_TO_CART converts from fractional to Cartesian coordinates. CART_TO_FRACT converts from Cartesian to fractional coordinates. In each case, coordinates are read from the file defined by INFILE and written to the file defined by OUTFILE. Coordinates are read in free-format.
The Cartesian coordinate system is the PDB default: X is along a and Z is along c*; X Y and Z are mutually perpendicular and right-handed.
Use a script like this:
!----------Script to convert from fractional to Cartesian coords---------- infile fract.xyz outfile cart.xyz fract_to_cart !-------------------------------------------------------------------------MATH
MATH is a routine that is useful for generating test data, for converting
I,sig to F,sig, and other simple conversions. In most cases, the routine
takes an input file and column numbers for the input data and writes out
an output file.
KEYWORDS for routine MATH:
KEYWORD parameters description GENF_PHI SCALE B Generates an asymmetric unit of data in this space group based on resolution limits set by DMIN DMAX. The rms F will be SCALE at low resolution and will decrease according to the thermal factor B. Output file has F, PHI. F and Phi are distributed according to Wilson statistics. I_TO_F ncolI ncolSIGI Convert from I, sigma to F, sigma SIGMA_SCALE xx scale all input intensity sigmas * xx A_B_TO_F_PHI ncolA ncolB Convert from (REAL,IMAGINARY) to (F,PHI) (phi in degrees). F_PHI_TO_A_B ncolF ncolPHI Convert from (F,PHI) to (REAL,IMAGINARY) FOBS_SIG_FROM_F_ERR ncolF ERR Add "measurement error" on to values of F. % error in F will be about ERR. Uses error model of: sigma(I)=sqrt(I+0.5*(ERR/100)*I**2), where I=F**2. SUM ncol1 ncol2 Output column 1 is sum of data in ncol1 and ncol2 in input file VECTORSUM ncol1A ncol1B ncol2A ncol2B Output column 1 = ncol1A+ncol2A Output column 2 = ncol1B+ncol2B SEPARATEANO ncolF ncolsig Read in hkl, F,Sig from file defined by INFILE and write out the reflection to the file defined by FPLUSFILE if this is F+, or the file defined by FMINUSFILE if this is F-. A reflection is F+ in this definition if it is in the asymmetric unit as defined by HEAVY or it can be rotated into the asymmetric unit with reciprocal lattice symmetry. It is F- if it can be rotated onto -h-k-l of a reflection that is an F+. FLIP In separateano, write out the inverse of the input indices for F- (i.e, if h,k,l are read in, write out -h -k -l) NEQUIV_SEPARATE n In separateano, map the F- reflections to equivalent reflection "n" before applying FLIP and writing out. This allows you to match up reflections collected on a mirror plane as opposed to those collected with phi+180. If you run SCALE_MIR or SCALE_MAD the value of "n" is chosen for you automatically by maximizing the number of F+/F- pairs related by symmetry operation "n". TRIM Delete every line of a reflection file that has "-1" in any column RESOLUTION xx yy resolution limits If resolution limits and infile and outfile are specified, copies infile to outfile, using only data in the resolution range. INFILE xxxx input file name OUTFILE xxxx output file name (except separateano) FPLUSFILE xxxxx output file for F+ in separateano FMINUSFILE xxxxx output file for F- in separateano
Sample script for routine "MATH"
Here is a simple script that will convert from A, B fourier coefficients to F and phi:
!-------------------Script for conversion of A B to F, Phi -------------- @solve.setup ! standard setup for this dataset infile ab.drg outfile fphi.drg a_b_to_f_phi 1 2 ! take columns 1 and 2 of infile and convert to ! F and phi math !------------------------------------------------------------------------
GETISO is a routine to subtract 2 columns of data in a dorgbn file and to write out a new file with the difference. Reflections with a "-1.0" or "0.0" in either column are ignored as are reflections with F/sigma < ratmin. Here is an example:
!-------------Script file for getting isomorphous differences ------ @solve.setup ! setup script file nnatf 1 ! column for Fnat nnats 2 ! column for sigma of Fnat nderf 3 ! column for Fder nders 4 ! column for sigma of Fder ratmin 2.0 ! minimum F/sig to include infile file1.drg ! input file outfile file2.drg ! output file getiso ! get isomorphous differences !--------------------------------------------------------------------------GETANOM
GETANOM is a routine to convert from F+, F- to Fbar, DelAno. The routine calculates Fbar = (F+ + F-)/2 and del Ano = (F+ - F-), for the selected reflections and writes it to the output dorgbn file. If F+ or F- are missing (F less than or equal to 0), and the keyword "fp_or_fm" is specified, the one present is written out as Fbar and del Ano and sig of del Ano are set to 0.0. If the keyword "fpfm_only" is set then reflections with F+ or F- missing that are acentric are tossed. Here is an example script file for GETANOM:
!-------------Script file for converting from F+,F- to Fbar, Delano------- @solve.setup ncolfp ! column for F+ ncolsfp ! column for sigma of F+ ncolfm ! column for F- ncolsfm ! column for sigma of F- fpfm_only ! toss acentric reflections if F+ or F- is missing infile file1.drg ! input file outfile file2.drg ! output file with 4 columns getanom !--------------------------------------------------------------------------GETPHASES
GETPHASES is a routine to convert from A and B fourier coefficients to F and Phi. Here is a script file to do this:
!------------------Script file to convert from A, B to F, Phi ------------- @solve.setup ncolfa 1 ! column for F cos(phi) = A ncolfb 2 ! column for F sin(phi) = B infile file1.drg ! input file with A, B outfile file2.drg ! output file with F, Phi (2 columns) getphases !---------------------------------------------------------------------------
Bayesian weighting for atomic refinement
WEIGHTS is a routine to generate weighting factors for atomic refinement. The weighting factors are based on both experimental sigmas and on rms values of (Fobs-Fcalc)**2 in ranges of resolution. The premise for this type of weighting is that the atomic model used to generate Fcalc is incomplete. Note that this leads to an expected difference between Fobs and Fcalc that is larger for centric reflections than for acentrics by a factor of 1.414. The errors in the fit of the model to the data are divided into two parts, one due to errors in measurement and one due to errors in the model. It is assumed that errors in measurement are reasonably well known. They are required for this routine. The input file must contain Fobs, sigma-obs, and Fcalc. It may also contain a flag marking "TEST" reflections for free-R calculations. To generate the input file, you will need to run X-PLOR or another program to get Fcalc values, then IMPORT the Fcalc values and FILEMERGE with your Fobs, sigma-obs data.
The output dataset ("Fobs, sigma, weight") is written in X-PLOR format and can be read in to X-PLOR just as if it were Fobs, sigma, weight. X-PLOR automatically uses the weight as a weighting factor in refinement if it is input in this way in the structure factor file. Note that the sigma here is NOT the experimental error in measurement any more.
You can select reflections with F>n*sigma-obs using RATMIN, but even if you include all reflections, a reasonable weighting factor will be generated for the weak reflections.
The program allows you to keep reflections flagged with RTEST>0 separate from the working set of reflections. The RTEST flag must be in a "column" of data in the input file. RTEST=1 indicates a TEST reflection, 0 indicates a reflection to use in refinement.
The errors in the model are estimated in a shell of resolution as
E**2 = [ < (Fobs-Fcalc)**2 > - <Sigma-obs**2>]
where centric and acentric reflections are treated separately. The weighting factor applied to a particular reflection is then:
WEIGHT = 1/( E**2 + Sigma-obs**2 )
Reflections where Sigma-obs is not >0 or Fobs is not > ratmin*sigma-obs
or Fcalc is not >0 are ignored and not written out.
!----------Script file generating Bayesian weighting for refinement------------ @solve.setup ! standard information for this dataset infile fofc.drg ! input dorgbn file with Fo, sigma, Fc, Rtest outfile fo.xplor ! output file with FOBS SIGMA RTEST for X-PLOR NCOLFOWT 1 ! column # for F of data NCOLSWT 2 ! column # of sigma-obs NCOLFC 3 !column # of Fcalc NCOLRTEST 4 ! column # for RTEST indicator (0 if not present) weights ! get Bayesian weights... !----------------------------------------------------------------------------
NSHELLS n number of shells of resolution used to group data (default=10) INFILE xx name of file with Fobs,sigma-obs, and Fcalc and optional Rtest OUTFILE xx name of output file in X-PLOR format with h,k,l,fobs,sig,weight,rtest NCOLFOWT n column # for F of data NCOLSWT n column # of sigma-obs NCOLFC n column # of Fcalc NCOLRTEST n column # for RTEST indicator (0 if not present) RATMIN xx minimum ratio of F/sigma to read in at all (default=0)