[chimerax-users] Distance maps and all atom distances

Eric Pettersen pett at cgl.ucsf.edu
Fri Feb 17 09:35:59 PST 2023


Hi André,

> On Feb 16, 2023, at 2:50 PM, André Graça via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
> 
> Hi everyone!
> 
> Does ChimeraX have a tool to calculate distance maps in the same fashion as Chimera does with RRDistMaps?

No, though we have a feature-request ticket open in our bug-tracking database for this.  I have added you to the recipient list for that ticket.

> I believe Chimera's RRDistMaps only calculates intermodal distances between C-alpha atoms. Does anyone know a tool or have a script that could calculate all atom distances from two sequence identical models?

Assuming those models are the only structures open, the below would save the distances to a file named "distances.txt" in your home directory:

from chimera.atomic import all_atomic_structures
s1, s2 = all_atomic_structures(session)
from chimera.geometry import distance
import os.path
with open(os.path.expanduser("~/distances.txt"), 'w') as f:
	for a1, a2 in zip(s1.atoms, s2.atoms):
		print(a1, a2, distance(a1, a2), file=f)

You could put the above in a file with a '.py' suffix and open it in ChimeraX to run it.

--Eric

	Eric Pettersen
	UCSF Computer Graphics Lab

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimerax-users/attachments/20230217/d761e9f8/attachment.html>


More information about the ChimeraX-users mailing list