Re: [ccp4bb] XDS orientation matrix inconsistent with Mosflm, DENZO

2014-12-29 Thread Kay Diederichs
On Sun, 28 Dec 2014 15:37:22 -0600, Igor Petrik petr...@illinois.edu wrote:

...
 DIRECT BEAM COORDINATES (REC. ANGSTROEM)   0.003134  0.005401  1.020962
 DETECTOR COORDINATES (PIXELS) OF DIRECT BEAM1230.87   1260.93
 DETECTOR ORIGIN (PIXELS) AT 1226.25   1252.96
 CRYSTAL TO DETECTOR DISTANCE (mm)   259.04
 LAB COORDINATES OF DETECTOR X-AXIS  1.00  0.00  0.00
 LAB COORDINATES OF DETECTOR Y-AXIS  0.00  1.00  0.00
...

(XDS defines spindle as X and beam as Z)
...

Hi Igor,

XDS does not define the geometry by itself; rather, the definition is specified 
by the _user_ , in XDS.INP! The trouble with improperly self-defining things is 
that one can get e.g. the wrong sign of the anomalous signal, which is why 
tested XDS.INP examples are provided.

Thus, I would redefine beam as Y and spindle as Z using:

DIRECTION_OF_DETECTOR_X-AXIS= 0 0 1  ! instead of 1 0 0
DIRECTION_OF_DETECTOR_Y-AXIS= 1 0 0  ! instead of 0 1 0
INCIDENT_BEAM_DIRECTION= 0 1 0 ! instead of 0 0 1
ROTATION_AXIS= 0 0 1 ! instead of 1 0 0

(this is a circular permutation so should be safe), and index with that. 

Finally, there is (in orthorhombic settings) a choice of 8 equivalent settings 
of the crystal.

best,

Kay


Re: [ccp4bb] XDS orientation matrix inconsistent with Mosflm, DENZO

2014-12-29 Thread James Holton
Yes, unfortunately an orientation matrix is completely useless without 
a frame of reference.  All it does is tell you where the cell axes lie 
relative to X, Y and Z, but X may be the x-ray beam, or 
sometimes that is Z and X is the spindle axis. Different people have 
different and strongly-held opinions about this.  The fast and slow 
axes on the detector are also a matter of widely-varying convention.  
The origin of the detector could be the first pixel in the image file, 
the upper-left corner, or it could be in cameraman view vs sample 
view and the beam center is also only meaningful relative to whatever 
the origin is.   Also, if you are at one of the four beamlines in the 
world that rotates their spindle the opposite direction of everyone 
else, then you may have to reverse the sign of one axis as well, usually 
Y, or there may be an option such as REVERSEPHI.  XDS lets you 
define all these things manually and there are formally no default 
settings.


To be fair, it is difficult for developers to keep track of what all 
~150 beamlines around the world, plus commercial home lab equipment 
manufacturers are doing.  I've been trying to some time to assemble a 
library of recent lysozyme datasets from as many beamlines as 
possible, but my collection is still far from complete:

http://bl831.als.lbl.gov/example_data_sets/

That said, I have written a few jiffies for inter-converting XDS and 
mosflm conventions, and posted them here:

http://bl831.als.lbl.gov/~jamesh/orientation_matrix/

Instructions are at the top of each awk script.  For example, 
mosflm2xds.awk takes the first three lines to be the *.mat file from 
mosflm, but also needs the mosflm input script after that to figure out 
how to convert it into XDS conventions.  Use it like this:

cat auto.mat mosflm.inp | ./mosflm2xds.awk  XDS.INP

You can convert the resulting XDS keywords into an XPARM.XDS file using 
xds2xparm.awk, which can be useful for feeding into some pipelines.  If 
you already have an XPARM.XDS, you can convert it back into XDS keywords 
using xparm2xds.awk, and these keywords can, in turn, be fed into 
xds2mosflm.awk to get a mosflm *.mat file again.  Note, however, that 
there can be some information loss here.  The *.mat file does NOT 
contain the full description of the detector and spindle geometry that 
XDS may be using.  I make some guesses in these scripts if not all the 
relevant XDS keywords are provided.  It works with my setup at ALS 
8.3.1, but I have not tested it thoroughly with other cameras.  I would 
be interested if you find any bugs!


As for what you're missing, could it perhaps be a reversed phi 
direction?  That might look like a 180-degree rotation.


Good luck!

-James Holton
MAD Scientist

On 12/28/2014 3:12 PM, Igor Petrik wrote:


Takanori and Pierre,

Thank you for your quick responses. If you read my post you will see 
that I used the xds2mos.py script to convert the xds orientation to 
Mosflm format, but this gives me a result that is inconsistent with 
the matrix calculated directly by moslfm or DENZO. For orthorombic 
space group P222 there are only a hand full of equivalent matrices 
related by changing sign of one of the vectors. The matrices generated 
by XDS and Mosflm do not seem equivalent. Or maybe I'm missing something.


Thanks,
- Igor



[ccp4bb] XDS orientation matrix inconsistent with Mosflm, DENZO

2014-12-28 Thread Igor Petrik
I am working on a small project which requires me to obtain the proper
orientation of a crystal lattice with respect to the gonistat and source. I
have until now successfully used the matrices from Mosflm and DENZO, which
are consistent with each other and define the orientation of the reciprocal
lattice in the lab space when the spindle is at 0deg.

I am trying to use the orientation computed by XDS, but this seems to not
be consistent with the others. Here is an example:

mosflm .mat file:
 -0.00458796 -0.01054146 -0.01052990
  0.00600652  0.01617284 -0.00696834
  0.02352343 -0.00618559 -0.00027442
   0.000   0.000   0.000
  -0.1856881  -0.5200068  -0.8337343
   0.2431015   0.7978011  -0.5517381
   0.9520617  -0.3051332  -0.0217278
 39.6412 48.3160 77.5507 90. 90. 90.
   0.000   0.000   0.000
SYMM P222

(top part is reciprocal matrix in the format:
 a*x  b*x  c*x
 a*y  b*y  c*y
 a*z  b*z  c*z
where x is the x-ray beam axis and z is the spindle axis)

DENZO (HKL2000) gives an equivalent matrix.

XDS orientation parameters:
CORRECT.LP
...
 REFINED VALUES OF DIFFRACTION PARAMETERS DERIVED FROM  30955 INDEXED SPOTS
 REFINED PARAMETERS:   DISTANCE BEAM ORIENTATION CELL AXIS
 STANDARD DEVIATION OF SPOTPOSITION (PIXELS) 0.70
 STANDARD DEVIATION OF SPINDLE POSITION (DEGREES)0.08
 SPACE GROUP NUMBER 16
 UNIT CELL PARAMETERS 39.52848.15377.542  90.000  90.000  90.000
 E.S.D. OF CELL PARAMETERS  4.0E-02 3.3E-02 3.8E-02 0.0E+00 0.0E+00 0.0E+00
 REC. CELL PARAMETERS   0.025299  0.020767  0.012896  90.000  90.000  90.000
 COORDINATES OF UNIT CELL A-AXIS   -37.65011.269-4.236
 COORDINATES OF UNIT CELL B-AXIS14.62441.546   -19.461
 COORDINATES OF UNIT CELL C-AXIS-1.764   -32.374   -70.439
 CRYSTAL MOSAICITY (DEGREES) 0.211
 LAB COORDINATES OF ROTATION AXIS  0.62  0.007232 -0.004834
 DIRECT BEAM COORDINATES (REC. ANGSTROEM)   0.003134  0.005401  1.020962
 DETECTOR COORDINATES (PIXELS) OF DIRECT BEAM1230.87   1260.93
 DETECTOR ORIGIN (PIXELS) AT 1226.25   1252.96
 CRYSTAL TO DETECTOR DISTANCE (mm)   259.04
 LAB COORDINATES OF DETECTOR X-AXIS  1.00  0.00  0.00
 LAB COORDINATES OF DETECTOR Y-AXIS  0.00  1.00  0.00
...

(XDS defines spindle as X and beam as Z)

Converted to reciprocal lattice orientation matrix in mosflm axis
conventions:
(output from xds2mos; manual calculation is consistent with this output)
 -0.00273114 -0.00809777 -0.01150308
 -0.00724876 -0.01754758  0.00521075
 -0.02353677  0.00634416 -0.00027012
   0.000   0.000   0.000
 -0.11022162 -0.39811300 -0.91068616
 -0.29254071 -0.86269689  0.41252918
 -0.94988163  0.31189970 -0.02138535
 39.5280 48.1530 77.5420 90. 90. 90.
   0.000   0.000   0.000


As you can see they are different. You can note that the component of each
vector along the mosflm-Z (spindle) axis is consistent, suggesting that it
is only the angle of rotation around the spindle axis that is inconsistent
between the two. I know that for mosflm and DENZO the orientation matrix
defines the orientation of the reciprocal lattice when the spindle is at 0
deg. XDS seems to be using a different reference point. Why is this and
what is the proper way to obtain the absolute reciprocal orientation at 0
deg from XDS?

(If anyone wants to test this on their own, I can provide the frames I used
to obtain these files.)

Thanks,
- Igor Petrik
University of Illinois


Re: [ccp4bb] XDS orientation matrix inconsistent with Mosflm, DENZO

2014-12-28 Thread Phil Evans
(I think) these matrices are roughly 180 degrees apart, so they may just 
correspond to different signs of the axes
Phil

On 28 Dec 2014, at 21:37, Igor Petrik petr...@illinois.edu wrote:

 I am working on a small project which requires me to obtain the proper 
 orientation of a crystal lattice with respect to the gonistat and source. I 
 have until now successfully used the matrices from Mosflm and DENZO, which 
 are consistent with each other and define the orientation of the reciprocal 
 lattice in the lab space when the spindle is at 0deg.
 
 I am trying to use the orientation computed by XDS, but this seems to not be 
 consistent with the others. Here is an example:
 
 mosflm .mat file:
  -0.00458796 -0.01054146 -0.01052990
   0.00600652  0.01617284 -0.00696834
   0.02352343 -0.00618559 -0.00027442
0.000   0.000   0.000
   -0.1856881  -0.5200068  -0.8337343
0.2431015   0.7978011  -0.5517381
0.9520617  -0.3051332  -0.0217278
  39.6412 48.3160 77.5507 90. 90. 90.
0.000   0.000   0.000
 SYMM P222  
 
 (top part is reciprocal matrix in the format:
  a*x  b*x  c*x
  a*y  b*y  c*y
  a*z  b*z  c*z
 where x is the x-ray beam axis and z is the spindle axis)
 
 DENZO (HKL2000) gives an equivalent matrix.
 
 XDS orientation parameters:
 CORRECT.LP
 ...
  REFINED VALUES OF DIFFRACTION PARAMETERS DERIVED FROM  30955 INDEXED SPOTS
  REFINED PARAMETERS:   DISTANCE BEAM ORIENTATION CELL AXIS
  STANDARD DEVIATION OF SPOTPOSITION (PIXELS) 0.70
  STANDARD DEVIATION OF SPINDLE POSITION (DEGREES)0.08
  SPACE GROUP NUMBER 16
  UNIT CELL PARAMETERS 39.52848.15377.542  90.000  90.000  90.000
  E.S.D. OF CELL PARAMETERS  4.0E-02 3.3E-02 3.8E-02 0.0E+00 0.0E+00 0.0E+00
  REC. CELL PARAMETERS   0.025299  0.020767  0.012896  90.000  90.000  90.000
  COORDINATES OF UNIT CELL A-AXIS   -37.65011.269-4.236
  COORDINATES OF UNIT CELL B-AXIS14.62441.546   -19.461
  COORDINATES OF UNIT CELL C-AXIS-1.764   -32.374   -70.439
  CRYSTAL MOSAICITY (DEGREES) 0.211
  LAB COORDINATES OF ROTATION AXIS  0.62  0.007232 -0.004834
  DIRECT BEAM COORDINATES (REC. ANGSTROEM)   0.003134  0.005401  1.020962
  DETECTOR COORDINATES (PIXELS) OF DIRECT BEAM1230.87   1260.93
  DETECTOR ORIGIN (PIXELS) AT 1226.25   1252.96
  CRYSTAL TO DETECTOR DISTANCE (mm)   259.04
  LAB COORDINATES OF DETECTOR X-AXIS  1.00  0.00  0.00
  LAB COORDINATES OF DETECTOR Y-AXIS  0.00  1.00  0.00
 ...
 
 (XDS defines spindle as X and beam as Z)
 
 Converted to reciprocal lattice orientation matrix in mosflm axis conventions:
 (output from xds2mos; manual calculation is consistent with this output)
  -0.00273114 -0.00809777 -0.01150308
  -0.00724876 -0.01754758  0.00521075
  -0.02353677  0.00634416 -0.00027012
0.000   0.000   0.000
  -0.11022162 -0.39811300 -0.91068616
  -0.29254071 -0.86269689  0.41252918
  -0.94988163  0.31189970 -0.02138535
  39.5280 48.1530 77.5420 90. 90. 90.
0.000   0.000   0.000
 
 
 As you can see they are different. You can note that the component of each 
 vector along the mosflm-Z (spindle) axis is consistent, suggesting that it is 
 only the angle of rotation around the spindle axis that is inconsistent 
 between the two. I know that for mosflm and DENZO the orientation matrix 
 defines the orientation of the reciprocal lattice when the spindle is at 0 
 deg. XDS seems to be using a different reference point. Why is this and what 
 is the proper way to obtain the absolute reciprocal orientation at 0 deg from 
 XDS?
 
 (If anyone wants to test this on their own, I can provide the frames I used 
 to obtain these files.)
 
 Thanks,
 - Igor Petrik
 University of Illinois
 


Re: [ccp4bb] XDS orientation matrix inconsistent with Mosflm, DENZO

2014-12-28 Thread Takanori Nakane

Hi,

xdsme has xds2mos.py script.

https://code.google.com/p/xdsme/
https://code.google.com/p/xdsme/source/browse/XOconv/xds2mos.py

Best regards,

Takanori Nakane

On 2014/12/29 6:37, Igor Petrik wrote:

I am working on a small project which requires me to obtain the proper
orientation of a crystal lattice with respect to the gonistat and source. I
have until now successfully used the matrices from Mosflm and DENZO, which
are consistent with each other and define the orientation of the reciprocal
lattice in the lab space when the spindle is at 0deg.

I am trying to use the orientation computed by XDS, but this seems to not
be consistent with the others. Here is an example:

mosflm .mat file:
  -0.00458796 -0.01054146 -0.01052990
   0.00600652  0.01617284 -0.00696834
   0.02352343 -0.00618559 -0.00027442
0.000   0.000   0.000
   -0.1856881  -0.5200068  -0.8337343
0.2431015   0.7978011  -0.5517381
0.9520617  -0.3051332  -0.0217278
  39.6412 48.3160 77.5507 90. 90. 90.
0.000   0.000   0.000
SYMM P222

(top part is reciprocal matrix in the format:
  a*x  b*x  c*x
  a*y  b*y  c*y
  a*z  b*z  c*z
where x is the x-ray beam axis and z is the spindle axis)

DENZO (HKL2000) gives an equivalent matrix.

XDS orientation parameters:
CORRECT.LP
...
  REFINED VALUES OF DIFFRACTION PARAMETERS DERIVED FROM  30955 INDEXED SPOTS
  REFINED PARAMETERS:   DISTANCE BEAM ORIENTATION CELL AXIS
  STANDARD DEVIATION OF SPOTPOSITION (PIXELS) 0.70
  STANDARD DEVIATION OF SPINDLE POSITION (DEGREES)0.08
  SPACE GROUP NUMBER 16
  UNIT CELL PARAMETERS 39.52848.15377.542  90.000  90.000  90.000
  E.S.D. OF CELL PARAMETERS  4.0E-02 3.3E-02 3.8E-02 0.0E+00 0.0E+00 0.0E+00
  REC. CELL PARAMETERS   0.025299  0.020767  0.012896  90.000  90.000  90.000
  COORDINATES OF UNIT CELL A-AXIS   -37.65011.269-4.236
  COORDINATES OF UNIT CELL B-AXIS14.62441.546   -19.461
  COORDINATES OF UNIT CELL C-AXIS-1.764   -32.374   -70.439
  CRYSTAL MOSAICITY (DEGREES) 0.211
  LAB COORDINATES OF ROTATION AXIS  0.62  0.007232 -0.004834
  DIRECT BEAM COORDINATES (REC. ANGSTROEM)   0.003134  0.005401  1.020962
  DETECTOR COORDINATES (PIXELS) OF DIRECT BEAM1230.87   1260.93
  DETECTOR ORIGIN (PIXELS) AT 1226.25   1252.96
  CRYSTAL TO DETECTOR DISTANCE (mm)   259.04
  LAB COORDINATES OF DETECTOR X-AXIS  1.00  0.00  0.00
  LAB COORDINATES OF DETECTOR Y-AXIS  0.00  1.00  0.00
...

(XDS defines spindle as X and beam as Z)

Converted to reciprocal lattice orientation matrix in mosflm axis
conventions:
(output from xds2mos; manual calculation is consistent with this output)
  -0.00273114 -0.00809777 -0.01150308
  -0.00724876 -0.01754758  0.00521075
  -0.02353677  0.00634416 -0.00027012
0.000   0.000   0.000
  -0.11022162 -0.39811300 -0.91068616
  -0.29254071 -0.86269689  0.41252918
  -0.94988163  0.31189970 -0.02138535
  39.5280 48.1530 77.5420 90. 90. 90.
0.000   0.000   0.000


As you can see they are different. You can note that the component of each
vector along the mosflm-Z (spindle) axis is consistent, suggesting that it
is only the angle of rotation around the spindle axis that is inconsistent
between the two. I know that for mosflm and DENZO the orientation matrix
defines the orientation of the reciprocal lattice when the spindle is at 0
deg. XDS seems to be using a different reference point. Why is this and
what is the proper way to obtain the absolute reciprocal orientation at 0
deg from XDS?

(If anyone wants to test this on their own, I can provide the frames I used
to obtain these files.)

Thanks,
- Igor Petrik
University of Illinois



Re: [ccp4bb] XDS orientation matrix inconsistent with Mosflm, DENZO

2014-12-28 Thread Igor Petrik
Takanori and Pierre,

Thank you for your quick responses. If you read my post you will see that I
used the xds2mos.py script to convert the xds orientation to Mosflm format,
but this gives me a result that is inconsistent with the matrix calculated
directly by moslfm or DENZO. For orthorombic space group P222 there are
only a hand full of equivalent matrices related by changing sign of one of
the vectors. The matrices generated by XDS and Mosflm do not seem
equivalent. Or maybe I'm missing something.

Thanks,
- Igor