[Chimera-users] Walking through a protein

Eric Pettersen pett at cgl.ucsf.edu
Tue Sep 14 16:52:43 PDT 2010


Hi Dan,
	Well there's probably a few ways to approach this, but one  
possibility is to define a saved position for each residue and fly  
between them.  Here's some code that flies through the non-HET  
residues of the first open model in Chimera:

import chimera
residues = [r for r in chimera.openModels.list()[0].residues if not  
r.isHet]
for i, r in enumerate(residues):
	chimera.runCommand("focus " + r.oslIdent())
	chimera.runCommand("savepos p%d" % i)
chimera.runCommand("fly 10 " + " ".join(["p%d" % i for i in  
range(len(residues))]))

It's somewhat nausea inducing.

You could use the above as a jumping off point and then define some  
keyboard accelerators to fly back and forth between positions (it  
would need to remember what the "current" position is).  Defining  
keyboard accelerators is described here:

http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/accelerators/accelerators.html#adding

Good luck!

--Eric

                         Eric Pettersen
                         UCSF Computer Graphics Lab
                         http://www.cgl.ucsf.edu

On Sep 10, 2010, at 11:51 AM, Daniel Gurnon wrote:

> Hi everyone,
> Coot has an easily implemented way of "walking" through a peptide  
> chain. It works like this:
> From the drop down menu, choose "go to atom", pick the first  
> residue. The view zooms to the first residue.
> Now hit the space bar, and the view smoothly advances to the next  
> residue in the chain. Hold shift-space, and it smoothly moves back.
>
> Having an easy way to smoothly transition the view from one residue  
> to the next would would be useful in Chimera. From my perspective it  
> would be great for teaching, but I would think a simple way of  
> walking along the backbone would be generally appreciated. I imagine  
> this feature would be easy to construct with a Python script, maybe  
> using the "fly" or "focus" commands. I'm not sure how to tie this to  
> a keystroke, but an alternative is to give the function a toolbar  
> button.
>
> If this capability doesn't already exist, could someone provide some  
> advice on writing the script? I'm only just learning Python.
> Thanks for the help
> Dan
>
> -- 
> ____________________________
>
> Daniel Gurnon, Ph. D.
> Assistant Professor of Chemistry
> DePauw University
> Greencastle, IN 46135
>
> p: 765-658-6279
> e: danielgurnon at depauw.edu
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> 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/20100914/4cbb6487/attachment.html>


More information about the Chimera-users mailing list