Sorry for my first post, I just relaized it was kind of hard to read
with all the funny tags.... I am reposting for clarity!!!
I am trying to run a script to translate all pdb structures so that an
atom of the protein gets the coordinate (0,0,0)
I have written a small script for that:
for i in pdb_names:
stored.xyz = []
cmd.iterate_state(1,("%s and name fe" %(i)),"stored.xyz.append([x,y,z])")
a=stored.xyz[0][0]
b=stored.xyz[0][1]
c=stored.xyz[0][2]
cmd.alter_state ("1",("%s" %(i)),"x=x-a")
cmd.alter_state ("1",("%s" %(i)),"y=y-b")
cmd.alter_state ("1",("%s" %(i)),"z=z-c")
First, I have not been able to translate all the coordinates at once
in the script with something like
cmd.alter_state ("1",("%s" %(i)),"((x,y,z)=(x-a,y-b,z-c))")
I get this error message
cmd.alter_state ("1",("1AW3 and name fe"),((x,y,z)=(x-a,y-b,z-c))")
^
SyntaxError: invalid syntax
This was overcome by affecting each value separately. But then, when I
check the coordinates of the fe atom that should be (0,0,0) all of
them have zero values for x and z, but ot for y!!!!!!
All the y values are unaffected!!!
Is there something I am missing in the number format? When I check
coordinates via the cmd.iterate_state, I can see that most of them are
numbers with around 15 to 16 significative figures... where the pdb
file has only three figures!! Is there something that is added by the
iterate_state command, and might this could affect the calculation of
the translation?
Thanks in advance for your answers ;)