Hi Elaine,
Is there a way to save the resolution of a protein structure to a file using command line, either in chimeraX or chimera?
Thanks
Hi Prathvi, Assuming the structures were opened from mmCIF files, then the following code would write the structure names and resolutions to a file named 'resolutions.txt' on your Desktop:
from chimerax.atomic import all_atomic_structures from chimerax.mmcif.mmcif import resolution from os.path import expanduser with open(expanduser("~/Desktop/resolutions.txt"), "wt") as f: for s in all_atomic_structures(session): res_info = resolution(s) if res_info is None: res_info = "no resolution info" print(f"{s.name} {res_info}", file=f)
I've attached the above as a file named res.py. You run the code just by opening the file with the "open" command or the File→Open dialog. You could also extract resolution info from a PDB, but that's a lot more complicated because there's no convenient "resolution" routine to use; you have to root around in various header records to get the resolution value. You can see code that does that here: https://github.com/RBVI/ChimeraX/blob/develop/src/bundles/pdb/src/pdb.py https://github.com/RBVI/ChimeraX/blob/develop/src/bundles/pdb/src/pdb.py (lines 639-674).
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Aug 22, 2023, at 12:21 AM, Prathvi Singh via Chimera-users chimera-users@cgl.ucsf.edu wrote:
Hi Elaine,
Is there a way to save the resolution of a protein structure to a file using command line, either in chimeraX or chimera?
Thanks
-- Prathvi Singh, Research Fellow, Department of Biological Sciences & Bioengineering, Indian Institute of Technology, Kanpur-208016 _______________________________________________ Chimera-users mailing list -- chimera-users@cgl.ucsf.edu To unsubscribe send an email to chimera-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimera-users@cgl.ucsf.edu/
participants (2)
-
Eric Pettersen
-
Prathvi Singh