Thank you for your response, i will try your suggestion A bientot
Stephane ________________________________________ De : Thomas Holder [ad...@thomas-holder.de] de la part de Thomas Holder [spel...@users.sourceforge.net] Date d'envoi : jeudi 22 septembre 2011 11:14 À : ABEL Stephane 175950 Cc : pymol-users@lists.sourceforge.net Objet : Re: [PyMOL] Write in a file the number of water at a distance from a protein surface Hi Stephane, you can select those waters using the "within" or "gap" selection operators. "within" measures from the atom centre, whereas "gap" takes the VDW radius into accout but selects everything beyond instead of near. Have a look at those examples: # use '... within ...' select firstshell, solvent within 3.5 of polymer # or use 'not (... gap ...)' select firstshell, solvent and not (polymer gap 0.5) # shows the selected water molecules as a sphere show spheres, firstshell and elem O # writes the results in a file python stored.out = open('/tmp/water-IDs.txt', 'w') print >> stored.out, '## At 0.5 Ang of the protein surface there are', print >> stored.out, cmd.count_atoms('firstshell and elem O'), print >> stored.out, 'water molecules' print >> stored.out, '## Water ID and resi are' cmd.iterate('firstshell', 'print >> stored.out, ID, resi') stored.out.close() python end http://www.pymolwiki.org/index.php/Selection_Algebra http://www.pymolwiki.org/index.php/Iterate Hope that helps, Cheers, Thomas On 09/21/2011 11:03 PM, ABEL Stephane 175950 wrote: > Hi All, > > I have simulated a protein in water cubic box and I would like to > know how to show and obtain the number of water in the first shell of > the protein (or at x Ang of the protein surface) using a pymol > script. I can to do this using the pymol GUI but I would prefer that > the script : > > - shows the selected water molecules as a sphere > - and writes the results in a file with the water ID (i.e. residue > number), for example like this: > > ## At x Ang of the protein surface there are XX water molecules > ## Water ID are > > Thanks in advance for your help. > > Stephane -- Thomas Holder MPI for Developmental Biology ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net