Hi, Firstly, I can see why there is a syntax error for the alter_state command:
cmd.alter_state ("1",("1AW3 and name fe"),((x,y,z)=(x-a,y-b,z-c))") has the quotes in the wrong place. I guess it should be: cmd.alter_state("1","(1AW3 and name fe)","((x,y,z)=(x-a,y-b,z-c))") I can make every atom move by saying: cmd.alter_state("1", "my_structure", "x, y, z = x + 1, y + 1, z + 1") So, the "x,y,z=x-a,y-b,z-c" would probably work, too. I hadn't realised that variables in the current scope were accessible from the alter_state scope, too. gilleain On 6/19/07, Gilles Truan <gtr...@cgm.cnrs-gif.fr> wrote:
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 ;) ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users