On Thu, 25 Jun 2009 11:39:29 -0700
James Holton <jmhol...@lbl.gov> wrote:

> A long time ago, I wrote a little program for turning spot picks into
> a PDB file that you could load up and rotate around in a graphics
> program (such as O, at the time):
> http://bl831.als.lbl.gov/~jamesh/pickup/spt2xyz.com
> this one works on the *.spt files that comes out of MOSFLM.  You can 
> concatenate *.spt files for each of your images to get the full data
> set represented.
> I also wrote one that works on ADSC images if you have the DPS
> program installed:
> http://bl831.als.lbl.gov/~jamesh/pickup/adsc2pdb.com
> but it only works for the "common" coordinate system convention we
> use at ALS and SSRL.  Not sure about other beamlines.
> 
>   The algorithm for converting spot positions into reciprocal space
> is not exactly new, as it is at the core of any and every
> autoindexing program.  All you do is figure out the take-off angle of
> the diffracted ray from the crystal and then calculate the coordinate
> where this line intersects the Ewald sphere.  Specifically, the
> "distortion" is: distortion = lambda*sqrt((Xdet)^2+(Ydet)^2+(dist)^2)
> where:
> lambda   - the x-ray wavelength in A
> Xdet      - X coordinate of the spot relative to the beam center (in
> mm) Ydet      - Y coordinate of the spot relative to the beam center
> (in mm) dist        - the crystal-to-film distance (from crystal to
> direct-beam spot, in mm)
> 
> You then use this "distortion" to compute the x-y-z coordinate of the 
> reciprocal-lattice point in reciprocal space:
>     x' = Xdet/distortion
>     y' = Ydet/distortion
>     z' = dist/distortion - 1/lambda
> 
> Yes, there are x-y-z coordinates in reciprocal space.  They all have 
> units of inverse Angstroms.  Of course, these x',y',z' coordinates
> are at the phi value of the image you picked spots on.  To get the 
> coordinates at phi=0, you need to "un-roate" them:
>     x = x'*cos(phi)-z'*sin(phi)
>     y = y'
>     z = x'*sin(phi)+z'*cos(phi)
> 
> where some people can probably tell that in this convention the phi
> axis is right-handed and parallel to the "Ydet" axis of the detector.
> 
> The last step is to multiply these x,y,z coordinates by some
> reasonable scale factor and put them into a PDB file.  Maybe put the
> intensity in the B-factor column, so that you can color it.  Then you
> need to find a display program that can handle a million-atom PDB.
> Does anyone have one of those?
> 
> 
> Ideally, what one would like to do is make an electron density map
> with pixel-to-pixel correspondence to the image.  All you do is apply
> the above formulas to each pixel, do a Lorentz-Polarization
> correction, and then just render the data set as a map.
> 
> Sounds like there are a couple of commercial programs that do this in
> 2 dimensions.  Problem with doing it in 3D is there are no programs
> that can display an electron density map this big.  In fact, I can't
> even get CCP4 to write out map or mtz files bigger than 2 GB.  I get
> "filesize limit exceeded" errors (even though the filesystem can
> handle large files).  Is this a limitation of the 32-bit binaries?
> Can anyone help me confirm that re-compiling CCP4 as 64-bit will fix
> this?  This error can be reproduced by trying to make a 2 A data set
> for the largest unit cell in the PDB:
> 

The limit on file sizes using fopen and the like for 32 bit systems is
2^31 bytes, unless you use fopen64 or use _FILE_OFFSET_BITS == 64
passed to the compiler (assuming you have LFS support, etc, etc):

http://www.gnu.org/software/libc/manual/html_node/Opening-Streams.html#index-fopen64-931

on 64 bit machines, the file size limit is 2^63 bytes (this also
depends on the file system type, just to make things even more
complicated).

Here's another easy way to test it:

dd if=/dev/zero of=bigfile bs=1024 count=3145728

Hope this helps!

-Tim

-- 
---------------------------------------------------------

        Tim Fenn
        f...@stanford.edu
        Stanford University, School of Medicine
        James H. Clark Center
        318 Campus Drive, Room E300
        Stanford, CA  94305-5432
        Phone:  (650) 736-1714
        FAX:  (650) 736-1961

---------------------------------------------------------

Reply via email to