[cctbxbb] F_obs values
Mooers, Blaine H.M. (HSC)
Blaine-Mooers at ouhsc.edu
Mon Jun 8 15:40:19 PDT 2020
Dear AC Researh,
To follow Pavel's suggestion, print your miller arrays, get their length, and then loop over the arrays and print the column labels.
len(miller_arrays) # which returns 2 for your example.
[print("Miller array %s: %s" % (i, miller_array.info().labels)) for i, miller_array in list(enumerate(miller_arrays))[:2]]
Best regards,
Blaine
Blaine Mooers, Ph.D.
Associate Professor
Department of Biochemistry and Molecular BiologyUniversity of Oklahoma Health Sciences Center
Oklahoma City, OK 73104-5419
________________________________________
From: cctbxbb-bounces at phenix-online.org [cctbxbb-bounces at phenix-online.org] on behalf of cctbxbb-request at phenix-online.org [cctbxbb-request at phenix-online.org]
Sent: Monday, June 08, 2020 2:00 PM
To: cctbxbb at phenix-online.org
Subject: [EXTERNAL] cctbxbb Digest, Vol 135, Issue 1
Send cctbxbb mailing list submissions to
cctbxbb at 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=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=Wrmt1tSQJNw64cBw0Hd5BV40vlQ2JmRBUT1YIGM7R1A&e=
or, via email, send a message with subject or body 'help' to
cctbxbb-request at phenix-online.org
You can reach the person managing the list at
cctbxbb-owner at 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. F_obs values (Academic Research)
2. Re: F_obs values (Pavel Afonine)
----------------------------------------------------------------------
Message: 1
Date: Sun, 07 Jun 2020 21:34:50 -0000
From: Academic Research <ac.research at icloud.com>
To: cctbxbb at phenix-online.org
Subject: [cctbxbb] F_obs values
Message-ID: <9b1bc3ab-2421-4faa-b6f4-fd1ecd63415a at me.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Hello Everyone,
I am trying to follow the script on the CCTBX website to get the F_obs values for my 3hz7.mtz file.
my code is as follows:
from iotbx.reflection_file_reader import any_reflection_file
hkl_file = any_reflection_file('3hz7.mtz')
arrays = hkl_file.as_miller_arrays(merge_equivalents=False)
a = arrays[0]
f_obs = a.f_sq_as_f().map_to_asu()
I get this following error:
Traceback (most recent call last):
? File "https://urldefense.proofpoint.com/v2/url?u=http-3A__crystal.py&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=A4Xel0XbPZspCTkep1jMwn6YooBtxr8JwVS1sbhaMfU&e= ", line 143, in <module>
??? if __name__ == '__main__': main()
? File "https://urldefense.proofpoint.com/v2/url?u=http-3A__crystal.py&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=A4Xel0XbPZspCTkep1jMwn6YooBtxr8JwVS1sbhaMfU&e= ", line 140, in main
??? Cls.features('3hz7.mtz')
? File "https://urldefense.proofpoint.com/v2/url?u=http-3A__crystal.py&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=A4Xel0XbPZspCTkep1jMwn6YooBtxr8JwVS1sbhaMfU&e= ", line 63, in features
??? f_obs = a.f_sq_as_f().map_to_asu()
? File "/home/acresearch/Desktop/CCTBX/mc3/envs/tenv/lib/python3.8/site-packages/cctbx/miller/https://urldefense.proofpoint.com/v2/url?u=http-3A__-5F-5Finit-5F-5F.py&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=LeX7G1Xgo9XI-pi0Su5OxLY6PfDhKilIfshCkSXXcPU&e= ", line 2374, in f_sq_as_f
??? result = array(self, converter(self.data()).f)
Boost.Python.ArgumentError: Python argument types in
??? array_f_sq_as_f_xtal_3_7.__init__(array_f_sq_as_f_xtal_3_7, int)
did not match C++ signature:
??? __init__(_object*, scitbx::af::const_ref<double, scitbx::af::trivial_accessor>)
??? __init__(_object*, scitbx::af::const_ref<double, scitbx::af::trivial_accessor>, scitbx::af::const_ref<double, scitbx::af::trivial_accessor>)
??? __init__(_object*, scitbx::af::const_ref<double, scitbx::af::trivial_accessor>, scitbx::af::const_ref<double, scitbx::af::trivial_accessor>, double)
When I run:
print(i_obs.info())
I get:
3hz7.mtz:FREE
print(a.observation_type())
gives:
None
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.
How can I get the F_obs values? Can someone please assist me?
Regards,
AC Research
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=http-3A__phenix-2Donline.org_pipermail_cctbxbb_attachments_20200607_28a05a77_attachment.html&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=JcebqC9TvJ5dWCzkMZpLw_bRPssJpcJi03PBFk2K66o&e= >
------------------------------
Message: 2
Date: Sun, 7 Jun 2020 23:02:47 -0700
From: Pavel Afonine <pafonine at lbl.gov>
To: cctbx mailing list <cctbxbb at phenix-online.org>, Academic Research
<ac.research at icloud.com>
Subject: Re: [cctbxbb] F_obs values
Message-ID: <9b8c9d83-49cb-970d-f21d-c5508eb4a256 at lbl.gov>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Hi AC Research,
getitng the file off PDB
phenix.fetch_pdb 3hz7 --mtz
and looking into its content
phenix.mtz.dump 3hz7.mtz
I see there are more than one data array in it.
So I think your "a = arrays[0]" is the root of trouble.
Also, doing this "f_obs = a.f_sq_as_f().map_to_asu()" unconditionally is
not a good idea.
So loop over miller arrays, look at labels and pick the one that has the
label you want.
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.
Pavel
On 6/7/20 14:34, Academic Research wrote:
> Hello Everyone,
>
> I am trying to follow the script on the CCTBX website to get the F_obs
> values for my 3hz7.mtz file.
>
> my code is as follows:
>
> from iotbx.reflection_file_reader import any_reflection_file
> hkl_file = any_reflection_file('3hz7.mtz')
> arrays = hkl_file.as_miller_arrays(merge_equivalents=False)
> a = arrays[0]
> f_obs = a.f_sq_as_f().map_to_asu()
>
> I get this following error:
> Traceback (most recent call last):
> ? File "https://urldefense.proofpoint.com/v2/url?u=http-3A__crystal.py&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=A4Xel0XbPZspCTkep1jMwn6YooBtxr8JwVS1sbhaMfU&e= ", line 143, in <module>
> ??? if __name__ == '__main__': main()
> ? File "https://urldefense.proofpoint.com/v2/url?u=http-3A__crystal.py&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=A4Xel0XbPZspCTkep1jMwn6YooBtxr8JwVS1sbhaMfU&e= ", line 140, in main
> ??? Cls.features('3hz7.mtz')
> ? File "https://urldefense.proofpoint.com/v2/url?u=http-3A__crystal.py&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=A4Xel0XbPZspCTkep1jMwn6YooBtxr8JwVS1sbhaMfU&e= ", line 63, in features
> ??? f_obs = a.f_sq_as_f().map_to_asu()
> ? File
> "/home/acresearch/Desktop/CCTBX/mc3/envs/tenv/lib/python3.8/site-packages/cctbx/miller/https://urldefense.proofpoint.com/v2/url?u=http-3A__-5F-5Finit-5F-5F.py&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=LeX7G1Xgo9XI-pi0Su5OxLY6PfDhKilIfshCkSXXcPU&e= ",
> line 2374, in f_sq_as_f
> ??? result = array(self, converter(self.data()).f)
> Boost.Python.ArgumentError: Python argument types in
> array_f_sq_as_f_xtal_3_7.__init__(array_f_sq_as_f_xtal_3_7, int)
> did not match C++ signature:
> ??? __init__(_object*, scitbx::af::const_ref<double,
> scitbx::af::trivial_accessor>)
> ??? __init__(_object*, scitbx::af::const_ref<double,
> scitbx::af::trivial_accessor>, scitbx::af::const_ref<double,
> scitbx::af::trivial_accessor>)
> ??? __init__(_object*, scitbx::af::const_ref<double,
> scitbx::af::trivial_accessor>, scitbx::af::const_ref<double,
> scitbx::af::trivial_accessor>, double)
>
>
> When I run:
> print(i_obs.info())
> I get:
> 3hz7.mtz:FREE
>
> print(a.observation_type())
> gives:
> None
>
> 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.
>
> How can I get the F_obs values? Can someone please assist me?
>
> Regards,
>
> AC Research
>
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__phenix-2Donline.org_mailman_listinfo_cctbxbb&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=Wrmt1tSQJNw64cBw0Hd5BV40vlQ2JmRBUT1YIGM7R1A&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://urldefense.proofpoint.com/v2/url?u=http-3A__phenix-2Donline.org_pipermail_cctbxbb_attachments_20200607_296b357d_attachment-2D0001.htm&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=-eIDRMtktva3KkmXKJqDis-ymMK6D_K6XfJpx1df7oc&e= >
------------------------------
_______________________________________________
cctbxbb mailing list
cctbxbb at phenix-online.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__phenix-2Donline.org_mailman_listinfo_cctbxbb&d=DwICAg&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=oAfuCKnHEMReNwNf8K-J-MEXUEuhmfZEy8PYiJVy68I&s=Wrmt1tSQJNw64cBw0Hd5BV40vlQ2JmRBUT1YIGM7R1A&e=
End of cctbxbb Digest, Vol 135, Issue 1
***************************************
More information about the cctbxbb
mailing list