From: Pawel <pa...@gm...> - 2013-11-07 23:55:27
|
Hello, I'm trying to understand what seems like an inconsistency between PyMOL commandline and python scripts. I have the following commandline script: delete all load ../4lzt_quasi.pdb, full cmd.create("anew", "full", 1, 1) cmd.alter_state(1,"anew" , "x,y,z = x+nm[(ID-1)*3], y+nm[(ID-1)*3+1], z+nm[(ID-1)*3+2]") iterate_state 1, full & id 1, print x, y,z iterate_state 1, anew & id 1, print x, y,z Which I then run: PyMOL>@pymoltest1.txt ... PyMOL>iterate_state 1, full & id 1, print x, y,z 2.69099998474 4.58500003815 13.6999998093 IterateState: iterated over 1 atom coordinate states. PyMOL>iterate_state 1, anew & id 1, print x, y,z 2.41267466545 5.63420581818 12.6615524292 IterateState: iterated over 1 atom coordinate states. Now I have this python script: cmd.delete( all) cmd.load( "../4lzt_quasi.pdb", "full") cmd.create("anew", "full", 1, 1) cmd.alter_state(1,"anew" , "x,y,z = x+nm[(ID-1)*3], y+nm[(ID-1)*3+1], z+nm[(ID-1)*3+2]") xyz1=[] cmd.iterate_state(1, 'full & id 1', 'xyz1.append([x,y,z])') xyz2=[] cmd.iterate_state(1, 'anew & id 1', 'xyz2.append([x,y,z])') print xyz1 print xyz2 Which I run: PyMOL>run pymoltest1.py [[2.690999984741211, 4.585000038146973, 13.699999809265137]] [[2.5646746158599854, 4.600205898284912, 13.65555191040039]] Why am I getting different coordinates for the second atom? The second set of coordinates from the first script are actually the coordinates of the 5th atom in my structure (CA of a LYS). I'm guessing that the alter_state command is somehow doing something different in one and the other case but it's hard to understand why. Thanks for the help, Pawel |