Electron density hitogram from MTZ file
Hi everybody, I am new in crystallogrphy and in the use of cctbx. I am interested in building a electron density histogram from a mtz file. Could somebody give a hint on how to accomplish this task using cctbx libraries (I am scripting in python)? Let's say that I already have the columns of interest as "miller arrays". Then (I think), a grid (on the real space) needs to be created based on unit cell parameters, to finally make the fft. I think that most of my doubts are about the grid. How small the grid should be with respect to the low-resolution limit? Does the space group information needed or it is enough with the the cell parameters? Is there all ready a routine doing this? Thanks a lot for your help. Marcelino
Hi Marcelino, for example, see implementation of phenix.map_comparison (Map comparison and statistics. For details see: Acta Cryst. (2014). D70, 2593-2606. Metrics for comparison of crystallographic maps. A. Urzhumtsev, P. V. Afonine, V. Y. Lunin, T. C. Terwilliger and P. D. Adams). Relevant file is: cctbx_project/mmtbx/command_line/map_comparison.py This gives you map histogram object: h = maptbx.histogram(map=map_data, n_bins=10000) You can print it like this: for a,c,v in zip(h.arguments(), h.c_values(), h.values()): print a,c,v Another option would be to use flex.histogram: def show_histogram(data, n_slots, data_min, data_max): hm = flex.histogram(data = data, n_slots = n_slots, data_min=data_min, data_max=data_max) lc_1 = hm.data_min() s_1 = enumerate(hm.slots()) for (i_1,n_1) in s_1: hc_1 = hm.data_min() + hm.slot_width() * (i_1+1) print "%6.2f - %-6.2f : %6.4f : %d" % (lc_1, hc_1, (lc_1+hc_1)/2,n_1) lc_1 = hc_1 but this does not work well for crystallographic maps. Finally, to get a Fourier map from Fourier map coefficients (miller array with complex-type data): - if you want to use your custom gridding: fft_map = miller.fft_map( crystal_gridding = crystal_gridding, fourier_coefficients = map_coeffs) fft_map.apply_sigma_scaling() map_data = fft_map.real_map_unpadded() - using gridding based on resolution: fft_map = map_coeffs.fft_map(resolution_factor = 1./4) Pavel On 10/27/14 5:45 AM, [email protected] wrote:
Hi everybody,
I am new in crystallogrphy and in the use of cctbx. I am interested in building a electron density histogram from a mtz file. Could somebody give a hint on how to accomplish this task using cctbx libraries (I am scripting in python)?
Let's say that I already have the columns of interest as "miller arrays". Then (I think), a grid (on the real space) needs to be created based on unit cell parameters, to finally make the fft.
I think that most of my doubts are about the grid. How small the grid should be with respect to the low-resolution limit? Does the space group information needed or it is enough with the the cell parameters?
Is there all ready a routine doing this?
Thanks a lot for your help.
Marcelino
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Hi Pavel,
Thanks a lot for your help.
:)
Marcelino
Quoting Pavel Afonine
Hi Marcelino,
for example, see implementation of phenix.map_comparison (Map comparison and statistics. For details see: Acta Cryst. (2014). D70, 2593-2606. Metrics for comparison of crystallographic maps. A. Urzhumtsev, P. V. Afonine, V. Y. Lunin, T. C. Terwilliger and P. D. Adams).
Relevant file is: cctbx_project/mmtbx/command_line/map_comparison.py
This gives you map histogram object: h = maptbx.histogram(map=map_data, n_bins=10000)
You can print it like this: for a,c,v in zip(h.arguments(), h.c_values(), h.values()): print a,c,v
Another option would be to use flex.histogram:
def show_histogram(data, n_slots, data_min, data_max): hm = flex.histogram(data = data, n_slots = n_slots, data_min=data_min, data_max=data_max) lc_1 = hm.data_min() s_1 = enumerate(hm.slots()) for (i_1,n_1) in s_1: hc_1 = hm.data_min() + hm.slot_width() * (i_1+1) print "%6.2f - %-6.2f : %6.4f : %d" % (lc_1, hc_1, (lc_1+hc_1)/2,n_1) lc_1 = hc_1
but this does not work well for crystallographic maps.
Finally, to get a Fourier map from Fourier map coefficients (miller array with complex-type data):
- if you want to use your custom gridding: fft_map = miller.fft_map( crystal_gridding = crystal_gridding, fourier_coefficients = map_coeffs) fft_map.apply_sigma_scaling() map_data = fft_map.real_map_unpadded()
- using gridding based on resolution: fft_map = map_coeffs.fft_map(resolution_factor = 1./4)
Pavel
On 10/27/14 5:45 AM, [email protected] wrote:
Hi everybody,
I am new in crystallogrphy and in the use of cctbx. I am interested in building a electron density histogram from a mtz file. Could somebody give a hint on how to accomplish this task using cctbx libraries (I am scripting in python)?
Let's say that I already have the columns of interest as "miller arrays". Then (I think), a grid (on the real space) needs to be created based on unit cell parameters, to finally make the fft.
I think that most of my doubts are about the grid. How small the grid should be with respect to the low-resolution limit? Does the space group information needed or it is enough with the the cell parameters?
Is there all ready a routine doing this?
Thanks a lot for your help.
Marcelino
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Hi everybody, Sorry to bother again. How do I update the source code using SVN? In the bundle version that I installed (cctbx_bundle.tar.gz, downloaded from http://cci.lbl.gov/cctbx_build/) I could not find "cctbx_sources/mmtbx/command_line/map_comparison.py" Then I used: svn checkout http://svn.code.sf.net/p/cctbx/code/trunk cctbx-code In the downloaded folder I found the file that I was looking for. "cctbx-code/mmtbx/command_line/map_comparison.py" My question is: How can I integrate these updates to my previous version? I tried using the cctbx_install_script.csh script targeting to cctbx-code but did not work. I also tried by copying the contents of cctbx-code into cctbx-sources and running cctbx_install_script.csh but did not work. Thanks a lot for your help Marcelino
On Tue, Oct 28, 2014 at 4:16 AM,
Sorry to bother again. How do I update the source code using SVN?
The not-very-helpful answer is that the old-style bundles do not support source updates. Also, as you've probably noticed, a lot of documentation is out of date. What I would suggest is to download one of the newer "plus" bundles here: http://cci.lbl.gov/cctbx_build/plus_bundles/current/ These actually include all of the necessary dependencies (which keep changing on short notice, sorry!) and also have a source layout that's more consistent with our development environment. The current builds incorporate the program you're looking for, but you can also update cctbx in the future by doing this: cd $CCTBX/modules rm -rf cctbx_project svn checkout http://svn.code.sf.net/p/cctbx/code/trunk cctbx_project cd $CCTBX/build libtbx.configure . libtbx.scons I will update the instructions (and installation script) when I have a chance. -Nat
participants (3)
-
castro@biochem.mpg.de
-
Nathaniel Echols
-
Pavel Afonine