[cctbxbb] rotate_translate_map function causes "splinching"

Pearce, N.M. (Nick) n.m.pearce at uu.nl
Wed Nov 15 08:11:57 PST 2017


Hi all,

I’m having a problem with the rotate_translate_map function from cctbx.maptbx.

I have a 3D array (a mask of 0s and 1s, in this case) that I’m writing as a CCP4 map file. If I write it out “on the origin” (without running rotate_translate_map), then it’s fine (see attached “before.png”).
However, if I apply the rotate_translate_map function and then write it out, odd features appear at the edge of the unit cell (see “after.png”).

It is NOT the case that the map is going through the “periodic boundary conditions” of the unit cell (the shift is less than one unit cell, as shown by the structure which is transformed by the same amount).

The minimal code is:
———————————
array = cctbx.maptbx.rotate_translate_map(
                                              unit_cell=self.unit_cell(),
                                              map_data=array,
                                              rotation_matrix=scitbx.matrix.rec([1,0,0,0,1,0,0,0,1], (3,3)).elems,
                                              translation_vector=(-1.0*scitbx.matrix.rec((X,Y,Z), (3,1))).elems
)

# Write the map
iotbx.ccp4_map.write_ccp4_map(
                              file_name=f_name,
                              unit_cell=self.unit_cell(),
                              space_group=self.space_group(),
                              map_data=array,
                              labels=flex.std_string(['’])
)
———————————
where (X,Y,Z) is a tuple for the origin shift.

Is there something stupid that I’m missing? Has anyone else had the same problem?
The only code for a rotate_translate_map function I could find was actually in maptbx/average_densities.h and I couldn’t see anything obviously “wrong”… though I’m not that familiar with C++.

The maps and files can be found at https://www.dropbox.com/sh/xqrsk5lcn603416/AABiVO74g6A_jZMGn_DjxOmka?dl=0
all “grid” files are without translation, and all “ref” files are after translation. both are written out exactly the same (the iotbx.ccp4_map call above).

I’m using the cctbx bundled with a ccp4 nightly from 2016-10-22.

Thanks,
Nick


[cid:47E4EAC9-42DE-409E-88A4-A9E6948256A6 at uu.nl][cid:A9A0D24D-C2A8-4524-88BD-939654541FE9 at uu.nl]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20171115/5da3d3fa/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: after.png
Type: image/png
Size: 504025 bytes
Desc: after.png
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20171115/5da3d3fa/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: before.png
Type: image/png
Size: 314934 bytes
Desc: before.png
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20171115/5da3d3fa/attachment-0003.png>


More information about the cctbxbb mailing list