<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Hi AC Research,<br>
<br>
getitng the file off PDB<br>
<br>
phenix.fetch_pdb 3hz7 --mtz<br>
<br>
and looking into its content<br>
<br>
phenix.mtz.dump 3hz7.mtz<br>
<br>
I see there are more than one data array in it.<br>
<br>
So I think your "<span style="font-size: 13px; font-family: courier
new, monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">a = arrays[0]</span>" is the root of
trouble.<br>
<br>
Also, doing this "<span style="font-size: 13px; font-family: courier
new, monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">f_obs = a.f_sq_as_f().map_to_asu()</span>"
unconditionally is not a good idea.<br>
<br>
So loop over miller arrays, look at labels and pick the one that has
the label you want.<br>
<br>
Then, depending whether it is F or I, and depending on what you want
(I or F) you can convert F to I or I to F, as desired.<br>
<br>
Pavel<br>
<br>
<div class="moz-cite-prefix">On 6/7/20 14:34, Academic Research
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:9b1bc3ab-2421-4faa-b6f4-fd1ecd63415a@me.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div>Hello Everyone,<br>
</div>
<div><br data-mce-bogus="1">
</div>
<div>I am trying to follow the script on the CCTBX website to get
the F_obs values for my 3hz7.mtz file.<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>my code is as follows:<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div><span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">from iotbx.reflection_file_reader
import any_reflection_file</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">hkl_file =
any_reflection_file('3hz7.mtz')</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">arrays =
hkl_file.as_miller_arrays(merge_equivalents=False)</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">a = arrays[0]</span></div>
<div><span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">f_obs = a.f_sq_as_f().map_to_asu()</span></div>
<div><br data-mce-bogus="1">
</div>
<div>I get this following error:<br data-mce-bogus="1">
</div>
<div><span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">Traceback (most recent call last):</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> File "crystal.py", line 143, in
<module></span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> if __name__ == '__main__': main()</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> File "crystal.py", line 140, in
main</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> Cls.features('3hz7.mtz')</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> File "crystal.py", line 63, in
features</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> f_obs =
a.f_sq_as_f().map_to_asu()</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> File
"/home/acresearch/Desktop/CCTBX/mc3/envs/tenv/lib/python3.8/site-packages/cctbx/miller/__init__.py",
line 2374, in f_sq_as_f</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> result = array(self,
converter(self.data()).f)</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">Boost.Python.ArgumentError: Python
argument types in</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">
array_f_sq_as_f_xtal_3_7.__init__(array_f_sq_as_f_xtal_3_7,
int)</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;">did not match C++ signature:</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> __init__(_object*,
scitbx::af::const_ref<double,
scitbx::af::trivial_accessor>)</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> __init__(_object*,
scitbx::af::const_ref<double,
scitbx::af::trivial_accessor>,
scitbx::af::const_ref<double,
scitbx::af::trivial_accessor>)</span><br>
<span style="font-size: 13px; font-family: courier new,
monospace;" data-mce-style="font-size: 13px; font-family:
courier new, monospace;"> __init__(_object*,
scitbx::af::const_ref<double,
scitbx::af::trivial_accessor>,
scitbx::af::const_ref<double,
scitbx::af::trivial_accessor>, double)</span><br>
</div>
<div><br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>When I run:<br data-mce-bogus="1">
</div>
<div><span style="font-family: courier new, monospace;"
data-mce-style="font-family: courier new, monospace;">print(i_obs.info())</span></div>
<div>I get:</div>
<div><span style="font-family: courier new, monospace;"
data-mce-style="font-family: courier new, monospace;">3hz7.mtz:FREE</span><br>
</div>
<div><br data-mce-bogus="1">
</div>
<div><span style="font-family: courier new, monospace;"
data-mce-style="font-family: courier new, monospace;">print(a.observation_type())</span><br
data-mce-bogus="1">
</div>
<div>gives:</div>
<div><span style="font-family: courier new, monospace;"
data-mce-style="font-family: courier new, monospace;">None</span><br
data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>I repeated this script to many structure from the PDB (all
solved by x-rays) yet I get the exact same output for all of
them.<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div class="x-apple-signature">How can I get the F_obs values? Can
someone please assist me?<br data-mce-bogus="1">
</div>
<div class="x-apple-signature"><br data-mce-bogus="1">
</div>
<div class="x-apple-signature">Regards,<br>
<br>
AC Research</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
cctbxbb mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a>
<a class="moz-txt-link-freetext" href="http://phenix-online.org/mailman/listinfo/cctbxbb">http://phenix-online.org/mailman/listinfo/cctbxbb</a>
</pre>
</blockquote>
<br>
</body>
</html>