
Hi Blaine, hope this helps... from cctbx.array_family import flex from cctbx.sgtbx import space_group_info from cctbx.development import random_structure def run(): xray_structure = random_structure.xray_structure( space_group_info = space_group_info("P 1"), elements = ('C', 'N', 'O', 'H')*10) f_calc = abs(xray_structure.structure_factors(d_min=1.5).f_calc()) f_calc.setup_binner(reflections_per_bin = 50) for i_bin in f_calc.binner().range_used(): d_range = f_calc.binner().bin_legend( i_bin=i_bin, show_bin_number=False, show_counts=False) selection = f_calc.binner().selection(i_bin) f_calc_data_bin = f_calc.data().select(selection) print d_range, f_calc_data_bin.min_max_mean().as_tuple(), \ flex.mean(f_calc_data_bin) if (__name__ == "__main__"): run() ...please let me know if not! All the best, Pavel On 12/5/14 11:08 AM, Mooers, Blaine H.M. (HSC) wrote:
Thanks to Pavel's suggestion, I was able to calculate the overall mean weighted phase error between to sets of phases in miller_arrays 2 and 5. I am stumped on how to retrieve the mean weighted phase error by resolution bin.
#! /usr/bin/env cctbx.python import sys import iotbx mtz_filename = sys.argv[1] mtz_file = mtz.object(mtz_filename) miller_arrays = mtz_file.as_miller_arrays() binner=miller_array.setup_binner_d_star_sq_step(d_star_sq_step=0.01) mwpe = miller_arrays[2].mean_weighted_phase_error(miller_arrays[5])
Best regards,
Blaine
Blaine Mooers, Ph.D. Assistant Professor Department of Biochemistry and Molecular Biology University of Oklahoma Health Sciences Center S.L. Young Biomedical Research Center Rm. 466
Shipping address: 975 NE 10th Street, BRC 466 Oklahoma City, OK 73104-5419
Letter address: P.O. Box 26901, BRC 466 Oklahoma City, OK 73190
office: (405) 271-8300 lab: (405) 271-8313 fax: (405) 271-3910 e-mail: blaine-mooers@ouhsc.edu
Faculty webpage: http://www.oumedicine.com/department-of-biochemistry-and-molecular-biology/f...
Small Angle Scattering webpage: http://www.oumedicine.com/docs/default-source/ad-biochemistry-workfiles/smal...
X-ray lab webpage: http://www.oumedicine.com/department-of-biochemistry-and-molecular-biology/d...
________________________________________ From: cctbxbb-bounces@phenix-online.org [cctbxbb-bounces@phenix-online.org] on behalf of cctbxbb-request@phenix-online.org [cctbxbb-request@phenix-online.org] Sent: Wednesday, December 03, 2014 2:00 PM To: cctbxbb@phenix-online.org Subject: cctbxbb Digest, Vol 69, Issue 3
Send cctbxbb mailing list submissions to cctbxbb@phenix-online.org
To subscribe or unsubscribe via the World Wide Web, visit https://urldefense.proofpoint.com/v2/url?u=http-3A__phenix-2Donline.org_mailman_listinfo_cctbxbb&d=AAICAg&c=qRnFByZajCb3ogDwk-HidsbrxD-31vTsTBEIa6TCCEk&r=39ovrj_9gtbpqLqHj52qObHez22uGBx1oHrj21rIdII&m=AH0SlXaLUI5-mryljMKz190LejYrsOzJYHpylspfeLY&s=AL0biHjVX3JMJFY6TiJXpAGDDlIsjJ6HTPRxNidLa4g&e= or, via email, send a message with subject or body 'help' to cctbxbb-request@phenix-online.org
You can reach the person managing the list at cctbxbb-owner@phenix-online.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of cctbxbb digest..."
Today's Topics:
1. Re: computing mean phase error between final refined model and experimental phases (Pavel Afonine)
----------------------------------------------------------------------
Message: 1 Date: Tue, 02 Dec 2014 12:06:08 -0800 From: Pavel Afonine
To: cctbx mailing list , Blaine-Mooers@ouhsc.edu Subject: Re: [cctbxbb] computing mean phase error between final refined model and experimental phases Message-ID: <547E1BB0.3030103@lbl.gov> Content-Type: text/plain; charset="windows-1252"; Format="flowed" Hi Blaine,
key functionality for this is the method of Miller array class called mean_phase_error, see:
cctbx/miller/__init__.py .
Unit and regression tests are best usage examples most of the time. In this case see:
cctbx/regression/tst_miller.py .
Let me know if you have any questions.
I don't have a good grasp of phase error value as a quality measure. For example, I do not know what number is good, what is poor, etc. I think to some extent what you are trying to do can be converted to Fourier map comparison: just compute two maps, each one using identical amplitudes and two different sets of phases, and then compare maps. To me at least the map CC is a more telling metric.
However, map comparison is tricky too (usual map CC may be misleading!) and you need to use proper metrics, as explained in details here:
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
Pavel
On 12/2/14 9:20 AM, Mooers, Blaine H.M. (HSC) wrote:
Dear CCTBXBB,
I want to compare the phases from the final refined model and a set of experimental phases to calculate the weighted mean phase error.
How do I this using python?
Best regards,
Blaine
Blaine Mooers, Ph.D. Assistant Professor Department of Biochemistry and Molecular Biology University of Oklahoma Health Sciences Center S.L. Young Biomedical Research Center Rm. 466
Shipping address:
office: (405) 271-8300 lab: (405) 271-8313 fax: (405) 271-3910 e-mail: blaine-mooers@ouhsc.edu
_______________________________________________ cctbxbb mailing list cctbxbb@phenix-online.org https://urldefense.proofpoint.com/v2/url?u=http-3A__phenix-2Donline.org_mailman_listinfo_cctbxbb&d=AAICAg&c=qRnFByZajCb3ogDwk-HidsbrxD-31vTsTBEIa6TCCEk&r=39ovrj_9gtbpqLqHj52qObHez22uGBx1oHrj21rIdII&m=AH0SlXaLUI5-mryljMKz190LejYrsOzJYHpylspfeLY&s=AL0biHjVX3JMJFY6TiJXpAGDDlIsjJ6HTPRxNidLa4g&e=