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 very slow.
from chimera import openModels, Molecule
mol = openModels.list(modelTypes=[Molecule])[0]
cas = [ a for a in mol.atoms if a.name == “CA” and a.element.name == “C”]
import os.path
f = open(os.path.expanduser(“~/output”), “w”)
for i, ca1 in enumerate(cas):
for ca2 in cas[i+1:]:
print>>f, ca1, ca2, ca1.coord().distance(ca2.coord())
f.close()
Since my mail client does wonky things to quotation marks, I’ve also attached the above as a file.
—Eric