[Chimera-users] StrucMeasure and distance

Eric Pettersen pett at cgl.ucsf.edu
Wed Jul 23 10:54:33 PDT 2008

Hi JD,
	I assume we're talking about Python here since Chimera commands don't  
return values.  So, in Python if your atoms are in variables 'a1' and  
'a2' then the distance between them is:

	chimera.distance(a1.xformCoord(), a2.xformCoord())

or alternatively:


If the atoms are in the same molecule, you can get away with  
using .coord() instead of .xformCoord() since rotations/translations  
won't affect the inter-atom distance in that case.


On Jul 23, 2008, at 9:21 AM, Jean Didier Pie Marechal wrote:

> Dear all,
> a small question. I know how to calculate the distance between two  
> atoms calling the "distance" command and I generally use it embedded  
> in the scripts I write. However, this time, I'd like to have access  
> through my script only to the values of the distances (nothing  
> related to the display) in order to stock them. I thought I would  
> find my way through by using the StructMeasure module, but I am not  
> able to do so. How could I just have a return of the distances  
> between two atoms in the shell?
> Thanks a lot,
> JD

More information about the Chimera-users mailing list