<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 5 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Ok. Thank you, Eric.</p>
<p class="MsoNormal">I appreciate it,</p>
<p class="MsoNormal">Shubham</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">
Mail</a> for Windows</p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:pett@cgl.ucsf.edu">Eric Pettersen</a><br>
<b>Sent: </b>Tuesday, August 2, 2022 5:34<br>
<b>To: </b><a href="mailto:sdramgoolam@uwaterloo.ca">Shubham Devesh Ramgoolam</a><br>
<b>Cc: </b><a href="mailto:chimerax-users@cgl.ucsf.edu">chimerax-users@cgl.ucsf.edu</a><br>
<b>Subject: </b>Re: [chimerax-users] Time-efficient python code for obtaining coordinates of atoms</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Shubham,<o:p></o:p></p>
<div>
<p class="MsoNormal">First off, 'getcrd' really should return the coordinates in addition to logging them, so I have fixed that and the fix will be in tonight's daily build.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">But I don't think that really helps you because atom-spec parsing in ChimeraX is relatively slow, and I assume you would need to provide the same (long) atom spec to getcrd that you were using with "sel". We want to improve the speed and
reliability of atom-spec parsing, but achieving that is quite aways off at this point and so won't help with your current situation.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I assume that which residues you need coordinates from are changing frequently, otherwise the cost of selecting them once wouldn't be that big a deal. Depending on what criteria you are using to choose the residues, maybe you could loop
through chimerax.atomic.all_structures(session).residues and get the coordinates of the residues that meet your criteria.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">--Eric<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Eric Pettersen<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">UCSF Computer Graphics Lab<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Aug 1, 2022, at 2:32 AM, Shubham Devesh Ramgoolam via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu">chimerax-users@cgl.ucsf.edu</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi all,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I hope you are doing well.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I am looking for a time-efficient way of obtaining the coordinates of specified residues.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">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).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">The issue here is that run(session, ‘sel ...’) slows down if there are lots of specified residues.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Shubham<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Sent from<span class="apple-converted-space"> </span><a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a><span class="apple-converted-space"> </span>for Windows<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">_______________________________________________<br>
ChimeraX-users mailing list<br>
</span><a href="mailto:ChimeraX-users@cgl.ucsf.edu"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">ChimeraX-users@cgl.ucsf.edu</span></a><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif"><br>
Manage subscription:<br>
</span><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users"><span style="font-size:9.0pt;font-family:"Helvetica",sans-serif">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</span></a><o:p></o:p></p>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>