[Chimera-users] Flipping the handedness of a molecule

Eric Pettersen pett at cgl.ucsf.edu
Thu Sep 2 15:55:15 PDT 2010


On Sep 2, 2010, at 12:16 PM, Michael Day wrote:

> How do you flip the handedness of a molecule?
>
> I need to overlap two molecules that are numbered the same but have  
> different handedness.

Hi Mike,
	I don't think there's a way to do this without resorting to Python  
code.  Nonetheless, it can be done with pretty simple Python code.   
The code below will invert the handedness of currently selected models  
by inverting the X coordinate.  Put the code in a .py file and open it  
with File...Open or with the "open" command, or type the code into the  
IDLE interpreter (under Tools...General Controls).

import chimera
for m in chimera.selection.currentMolecules():
	for a in m.atoms:
		crd = a.coord()
		crd.x = -crd.x
		a.setCoord(crd)

--Eric


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20100902/ba6c605c/attachment.html>


More information about the Chimera-users mailing list