[Chimera-users] Mirror image proteins
Eric Pettersen
pett at cgl.ucsf.edu
Tue Sep 4 16:52:44 PDT 2018
Hi Nancy,
The script assumes you only have one model open and flips that model in its entirety. Here’s a slightly tweaked version that flips all open molecular models:
from chimera import openModels, Molecule
for m in openModels.list(modelTypes=[Molecule]):
for a in m.atoms:
crd = a.coord()
crd.x = 0 - crd.x
a.setCoord(crd)
You don’t have to type it into the IDLE shell. Instead, you could save the above into a file whose name ends in ‘.py’ (indicating it’s a Python file). The you could run the script simply by opening it in Chimera with File→Open or the “open” command.
I don’t know what you read on GitHub, but if you really need to restrict the script to working on a model with a particular ID#, it’s possible to make the script do that. Let me know if that’s what you need.
It would be weird to flip just part of a model. Consider a model with two chains where the Z coordinate of all the atoms are in the range 30-40. Flipping the Z coordinate of one of the chains would move it far away from the other chain.
—Eric
Eric Pettersen
UCSF Computer Graphics Lab
> On Sep 1, 2018, at 8:32 AM, Chu Ji <nancyji0217 at gmail.com> wrote:
>
> Hi Eric,
>
> I was trying to get a mirror image of a PDB model and came across your thread. I know that you are typing in
> m = chimera.openModels.list()[0]
> for a in m.atoms:
> crd = a.coord()
> crd.z = 0 - crd.z
> a.setCoord(crd)
> in the Gen Control>IDLE section, but I also read on GitHub that I should change the [0] in openModels.list()[0]to the model specifier. What does that mean exactly? I tried to type in the PDB ID to replace the 0 but nothing happened…Could you show me an example? What if I want to flip Chain B of a certain model or just the entire model?
>
> Thank you so much for your help! Looking forward to hearing from you.
>
> Best,
> Nancy
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>
> _______________________________________________
> 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/20180904/9c366cb2/attachment.html>
More information about the Chimera-users
mailing list