<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Claudia,<br>
<br>
why don't you have a look at phenix.real_space_correlation which
answers exactly your question?<br>
<br>
Anyway, here is the script that does what you want. Let me know if
you have any questions or need any help with this.<br>
<br>
*****<br>
import iotbx.pdb<br>
from iotbx import reflection_file_reader<br>
import mmtbx.f_model<br>
from scitbx.array_family import flex<br>
<br>
def exercise(pdb_file_name="1akg.pdb",
reflection_file_name="1akg.mtz"):<br>
# get xray_strucute from PDB file<br>
pdb_inp = iotbx.pdb.input(file_name = pdb_file_name)<br>
xray_structure = pdb_inp.xray_structure_simple()<br>
print "Input model:"<br>
xray_structure.show_summary(prefix=" ")<br>
# read in Fobs and free-R flags<br>
miller_arrays =
reflection_file_reader.any_reflection_file(file_name =<br>
reflection_file_name).as_miller_arrays()<br>
for ma in miller_arrays:<br>
if(ma.info().labels == ['FOBS', 'SIGFOBS']):<br>
f_obs = ma<br>
if(ma.info().labels == ['R-free-flags']):<br>
r_free_flags = ma.customized_copy(data=ma.data()==1)<br>
print "Input data:"<br>
f_obs.show_comprehensive_summary(prefix=" ")<br>
print "Percentage of free-R flags:",
r_free_flags.data().count(True)*100./\<br>
r_free_flags.data().size()<br>
# get fmodel and do scaling and bulk-solvent modeling<br>
fmodel = mmtbx.f_model.manager(<br>
xray_structure = xray_structure,<br>
f_obs = f_obs,<br>
r_free_flags = r_free_flags)<br>
fmodel.update_all_scales()<br>
print "r_work=%6.4f r_free=%6.4f"%(fmodel.r_work(),
fmodel.r_free())<br>
# calculate CC between Fobs and Fmodel<br>
cc = flex.linear_correlation(x=fmodel.f_obs().data(), <br>
y=abs(fmodel.f_model()).data())<br>
if(not cc.is_well_defined()):<br>
print "Cannot compute CC"<br>
print "CC(Fobs, Fmodel): %6.4f"%cc.coefficient()<br>
<br>
if(__name__ == "__main__"):<br>
exercise()<br>
*****<br>
<br>
Pavel<br>
<br>
<br>
On 10/9/12 1:08 AM, Claudia Millán Nebot wrote:<br>
</div>
<blockquote
cite="mid:CAPBAO+DVNtXhdjPyH1J9E3fJihLubE4G5_4MADp7LrsdDR_A0w@mail.gmail.com"
type="cite"><br>
Hi everyone,
<div><br>
</div>
<div>i'm trying to get an xray.structure object from a pdb file,
as i'm interested on using both this and a Miller array coming
from a reflection file to calculate correlation coefficients
between Fobs and Fcalc. For this purpose, i was searching for
something that will do the same as the
iotbx.pdb.xray_structure.as_pdb_file but the other way around.
Is there such a tool? I've look for a while but as i'm new to
all that maybe i missed something.</div>
<div><br>
</div>
<div>Thanks in advance and my excuses if is a too evident
question,</div>
<div><br>
</div>
<div>
<p
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><font
face="arial, helvetica, sans-serif">Claudia Millán (<a
moz-do-not-send="true" href="mailto:cmncri@ibmb.csic.es"
target="_blank" style="color:rgb(17,85,204)">cmncri@ibmb.csic.es</a>)</font></p>
<p
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><font
face="arial, helvetica, sans-serif">Institut de Biologia
Molecular de Barcelona (IBMB-CSIC)</font></p>
<p
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">
<font face="arial, helvetica, sans-serif">Barcelona, Spain</font><br>
</p>
</div>
</blockquote>
<br>
</body>
</html>