Hello all,
I would like to write a basic python script to select residues for each state
using the iterate_state and output the results first in pymol console window
with the following format
frame 1 : resid ...
frame 2 : resid ...
...
### my script ##
from pymol import cmd, stored
mytraj=""
mytraj2=""
## Load PDB
cmd.load("1JNO_GrA_DMPC_NACL_Membrane_TIP3P_SemiIso_rep3_Water_InChannel_0ns.pdb"),
mytraj
## Load XTC
cmd.load_traj("1JNO_GrA_DMPC_NACL_Membrane_TIP3P_SemiIso_rep3_Water_InChannel_0_50ns_Every_0.5ns_TRANSLATED.xtc"),
mytraj2
stored.resid = []
Myselection="select water_channel, resname SOL within 3.5 of resname CHO"
nb_states=cmd.count_states(mytraj2) ---> Contains 102 states
print(mytraj2, nb_states)
state=1
for i in range (nb_states) :
print(i)
cmd.iterate_state (i, (Myselection), 'resid.append(resv)') ---->
Should to ireate for all the states
print("frame " + str(i) + ":" + str(stored.residues)) ---> Print the
results of the Myselection command in the console
###
But the first problem I have is the syntax of the iterate_state. I obtain the
following error
"Selector-Error: Invalid selection name "select".
( select water_channel, resname SOL within 3.5 of resname CHO )<--"
When I put this selection command directly in Pymol, it works and i can obtain
the desired waters that was near 3.5 A of the CHO over all the states . So What
is the correct syntax for the selection with "iterate_state" ? And how to
output the results again for each state in the screen .
Thanks in advance for your help
Stéphane
_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/[email protected]
Unsubscribe:
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe