[chimerax-users] Time-efficient python code for obtaining coordinates of atoms
Shubham Devesh Ramgoolam
sdramgoolam at uwaterloo.ca
Mon Aug 1 02:32:48 PDT 2022
Hi all,
I hope you are doing well.
I am looking for a time-efficient way of obtaining the coordinates of specified residues.
I cannot use the command getcrd as I need these coordinates in a python script for defining geometric objects (getcrd prints the output to the log).
My attempt at this consisted of selecting all of the specified residues via run(session, ‘sel ...’), accessing that selection using selected_residues(session), and then, extracting the coordinates using .atoms.coords.
The issue here is that run(session, ‘sel ...’) slows down if there are lots of specified residues.
I tried bypassing the command ‘sel’ by first importing AtomSpecArg from chimerax.core.commands.atomspec and then using AtomSpecArg.parse('my residue_ID', session)[0].evaluate(session).atoms[0]. However, this is even slower.
Regards,
Shubham
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimerax-users/attachments/20220801/de23deb8/attachment.html>
More information about the ChimeraX-users
mailing list