[cctbxbb] Patterson map data structure

Nathaniel Echols nechols at lbl.gov
Tue Oct 16 10:21:22 PDT 2012


On Tue, Oct 16, 2012 at 6:47 AM, Dmytro Guzenko
<Dmytro.Guzenko at pharm.kuleuven.be> wrote:
> rmap = pmap.real_map_unpadded()
> n_real = pmap.n_real()
> unit_cell = pmap.unit_cell()
> grid2cart = maptbx.grid2cart(n_real,unit_cell.orthogonalization_matrix())
>
> n_points_total = n_real[0]*n_real[1]*n_real[2]
> cart_coord = flex.double(flex.grid(3,n_points_total))
> p_weight = flex.double(n_points_total)
>
> for plain_ind,grid_point in enumerate(flex.nested_loop(n_real)):
>     cart_coord[0,plain_ind],cart_coord[1,plain_ind],cart_coord[2,plain_ind] = grid2cart(grid_point)
>     p_weight[plain_ind] = rmap[grid_point]

There are better arrays for storing the coordinates, e.g.:

cart_coord = flex.vec3_double(flex.grid(n_real))
p_weight = flex.double(rmap.size())

for plain_ind,grid_point in enumerate(flex.nested_loop(n_real)):
  cart_coord[grid_point] = grid2cart(grid_point)
  p_weight[plain_ind] = rmap[grid_point]

> By the way, I noticed that many weights are negative, is this possible in a patterson map or am I doing something wrong?

This is normal - I believe it's a Fourier series termination error,
but I still don't fully understand the reason.  An Fobs map will have
the same problem; the mean will always be approximately zero.
Technically, if the map were perfect with no missing data, it would be
uniformly positive, but that's never actually the case.  There are
ways to "fix" the map so it's all-positive, such as maximum entropy
cleanup, but in practice I think we just ignore the negative values
(at least for Fobs/2mFo-DFc maps - not sure how Patterson maps are
usually handled).

-Nat


More information about the cctbxbb mailing list