On Wed, Apr 17, 2013 at 10:40 AM, Lukas Reck
I'm trying to use the cctbx python libraries to read in a large number of crystal structures and extract some geometric information on the coordination environment of certain atom types in them. I've been following the instructions from the 8/2004 CompComm Newsletter No. 4 at http://www.iucr.org/__data/assets/pdf_file/0003/6384/iucrcompcomm_aug2004.pd..., pages 22-28 (is that still up to date?) but I cannot seem to get at the correct symmetry elements for each neighbouring atom in the coordination environment of some atom of interest. ... As you can see from the coordinates, the neighbouring atom was correctly identified, but the corresponding symmetry as returned by get_rt_mx transforms it into a symmetry equivalent that is very far away.
To be honest I have never fully understood how this works, but for some reason it is necessary to perform an additional operation on the symmetry operator obtained by calling asu_mappings.get_rt_mx(j_seq, j_sym): rt_mx_i_inv = asu_mappings.get_rt_mx(scatterer_index, 0) rt_mx = rt_mx_i_inv.multiply(asu_mappings.get_rt_mx(j_seq, j_sym)) site_symm = rt_mx * scatterers[j_seq].site Hopefully someone who actually understands symmetry (or our implementation of it, rather) can explain further. At any rate, I've attached a script showing representative usage starting from your example, using a structure in the PDB. (I'm displaying Cartesian coordinates because I'm a biologist, not a chemist, but all of the symmetry operations use fractional coordinates.) We should probably include something like this in cctbx/examples or the like (I didn't see anything similar there), but I'm not sure what the preferred usage of the ASU mappings is - I do something slightly different in some of my code (mmtbx/ions/__init__.py, "find_nearby_atoms" method), but I was mostly just guessing when I wrote that. (Either form works, at least.) -Nat