<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thanks for this Eric. You had assumed correct that I wanted to do Ca-Ca only. Completely agreed that it is a bit of a big calculation to make and perhaps there are more efficient ways. Whichever way I manage to do this, the outputs will make beautiful heat maps of interactions! <div class=""><br class=""></div><div class="">I’ll experiment with your script and see how it goes, thanks for sending this.<div class=""><br class=""></div><div class="">Best,</div><div class="">Kyle<br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 31 Oct 2017, at 12:34, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Well, since the code is simple, I’ve included it below. You should put it in a file whose name in “.py” to indicate it’s Python code, then you can run it in Chimera simply by opening it. It will create a file named “output” in your home folder. It assumes you’re doing CA-CA distances, not CA-any. Probably still <i class="">very</i> slow.<div class=""><br class=""></div><div class="">from chimera import openModels, Molecule</div><div class="">mol = openModels.list(modelTypes=[Molecule])[0]</div><div class="">cas = [ a for a in mol.atoms if a.name == “CA” and a.element.name == “C”]</div><div class="">import os.path</div><div class="">f = open(os.path.expanduser(“~/output”), “w”)</div><div class="">for i, ca1 in enumerate(cas):</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>for ca2 in cas[i+1:]:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>print>>f, ca1, ca2, ca1.coord().distance(ca2.coord())</div><div class="">f.close()</div><div class=""><br class=""></div><div class="">Since my mail client does wonky things to quotation marks, I’ve also attached the above as a file.</div><div class=""><br class=""></div><div class="">—Eric</div><div class=""><br class=""></div><div class=""></div></div><span id="cid:F95DF845-266C-41C2-933A-2168B1838BF4@berkeley.edu"><ca.py></span><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""><div class="">
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 31, 2017, at 11:36 AM, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><blockquote type="cite" class="">On Oct 31, 2017, at 9:54 AM, Kyle Morris <<a href="mailto:kylelmorris@berkeley.edu" class="">kylelmorris@berkeley.edu</a>> wrote:<br class=""><br class="">Dear chimera dev and users,<br class=""><br class="">Is there a way to calculate (using the GUI, commands or using a python script) the pairwise distances for every single c-alpha atom in a set of loaded PDB coordinates and spit this out to a file for further analysis? There are 142,800 atoms in the current loaded assembly.<br class=""></blockquote><br class="">Do you mean CA-CA distances, or CA-any-other-atom distances? Even CA-CA only (assuming CAs are roughly 1/10 of your atoms) will be more than one hundred million distances, and CA-other will be more than a billion. Is this really what you want? If so, it would seem more efficient and much faster to write a special purpose program for this in a compiled language, like C, C++ or some such. It is of course doable in Chimera via Python. If you really do want to do it that way, I can offer further guidance...<br class=""><br class="">—Eric<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Eric Pettersen<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>UCSF Computer Graphics Lab<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">Chimera-users mailing list: <a href="mailto:Chimera-users@cgl.ucsf.edu" class="">Chimera-users@cgl.ucsf.edu</a><br class="">Manage subscription: <a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users" class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</a><br class=""><br class=""></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div></body></html>