[Chimera-users] Measuring the distance between residues and a surface

Tom Goddard goddard at sonic.net
Thu Jul 25 12:36:06 PDT 2019

Hi Julian,

  If you run your Chimera script from the shell command-line

	$ chimera --nogui distances.py

then the reply log output goes to the shell.  If you want instead to get the values in Python to do other things with them the Python code that implements the "measure distance" command is in 


python function distance().  Unfortunately it just reports values to the reply log.  It would take some changes to try to get the values in Python.

  Not sure why you are measuring atom distance to a solvent excluded surface.  If the atom is on the surface then the distance will be the atom radius.  If you are trying to find which atoms are on the surface, a more common way to do that is to look at the surface area per atom (or per residue), and ones with non-zero area are on the surface.


> On Jul 25, 2019, at 11:23 AM, Stanley, Julian A <Julian_Stanley at hms.harvard.edu> wrote:
> Hello! I'm fairly new to Chimera, so if you're able to point me towards any resources that can help me answer questions like this one independently in the future, please do!
> Here's the question:
> I would like to measure the distance between the ends arginine and lysine residues and a surface, using Chimera's python modules.
> Typically, I would load my .pdb file, generate a surface, and then use the "measure distance" command and parse the output from the Reply Log. 
> This approach works fine, except since "measure distance" prints to the reply log, I need to run my script in GUI mode. If possible, I'd prefer to run everything from the command line only. I thought that I might be able to do this with the distance() command, but I can't figure out how to pass a surface to that command. Does anyone have any tips/advice?
> In summary, what I usually do:
> ```
> from chimera import runCommand as rc
> # load the file
> rc("open " + pdbFile)
> # Generate a surface
> rc("select protein")
> rc("split")
> rc("surface allComponents false")
> rc("~select")
> # Measure distance between arg and lys and the surface
> rc("select #0")
> rc("~select #0:@")
> rc("measure distance :arg at cd|:lys at ce selection multiple true show true")
> ```
> And then I parse out the distances from the Reply Log.
> What I would prefer to do:
> It would be better to have the output to go to STDOUT when I run the script.
> I imagine that I'd use something like the `distance()` command, of the premade scripts (like here: http://plato.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/atomdist.py <http://plato.cgl.ucsf.edu/trac/chimera/attachment/wiki/Scripts/atomdist.py>) but they are designed to measure the distance between atoms or residues, not between residues and a surface. 
> Thanks for your help!
> Sincerely,
> Julian
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu <mailto:Chimera-users at cgl.ucsf.edu>
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users <http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20190725/558489ee/attachment.html>

More information about the Chimera-users mailing list