[Chimera-users] Simple distance to .txt scripting question
pett at cgl.ucsf.edu
Fri Dec 9 19:34:04 PST 2011
So, first select the two atoms somehow (e.g. "sel #0:519.A at NZ #:1.Y at O4"), then do this to get the distance into a variable 'd':
atoms = chimera.selection.currentAtoms()
d = atoms.xformCoord().distance(atoms.xformCoord())
UCSF Computer Graphics Lab
On Dec 9, 2011, at 5:35 PM, Andrew Hagen wrote:
> Hi everyone,
> I'm trying to write a script that opens a set of .pdbs, measures the distances between certain atoms, and then writes the distance to a text file for later analysis. It's easy enough to do something like...
> >>> runCommand("distance #0:519.A at NZ #:1.Y at O4")
> ...which executes the command and appends the info to the reply log ("Distance between #0 LYS 519.A NZ and #5 X01 1.Y O4: 2.33"). What I'd like to do is have that actual measured distance (2.33) be stored in a variable that I could then write to a text file (I know how to do this bit).
> Thanks for any thoughts!
> Andrew Hagen
> PhD candidate - Plant and Microbial Biology
> UC Berkeley - Keasling group
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
More information about the Chimera-users