Hi All,
With the help of Thomas Holder (thanks to him), now I can show and obtain
the number of water in the first shell of my six peptides (an amyloid
fibrils). However, I have a little problem with the command count_atoms in
my script
Below my script (*.pml) for Pymol 1.3 :
mstop
dss
hide all
select CL, resn CL
delete CL
## Select WATER with residue ID SOL
select WATER, resn SOL
## Select Amyloid, resi 1-54
select Amyloid, resi 1-54 and not WATER
## Show in cartoon Amyloid
show cartoon, Amyloid
## Show in different colors peptides because it is nice.
set cartoon_color, black, resi 2-8
set cartoon_color, red, resi 11-17
set cartoon_color, green, resi 20-26
set cartoon_color, blue, resi 29-35
set cartoon_color, yellow, resi 38-44
set cartoon_color, chocolate, resi 47-53
## Not use for the moment
##set cartoon_color, gray50, resi 56-62
##set cartoon_color, wheat, resi 65-71
##set cartoon_color, aquamarine, resi 74-80
##set cartoon_color, pink, resi 83-89
##set cartoon_color, orange, resi 92-98
##et cartoon_color, forest, resi 101-107
## Select water in the first shell (e.g. within 3.5 A of the Amyloid atoms)
select WATER_firstshell, WATER within 3.5 A of Amyloid
## Give the number of water in the first shell of the fibrils
## Works ---> Give number of water atoms (including oxygen and Hs)
print cmd.count_atoms("WATER_firstshell")
## Print the residu ID of each water in the first shell
iterate ("WATER_firstshell"), print resi
set cartoon_fancy_helices=1
set cartoon_discrete_colors, on
set antialias = 1
ray
-------------------
As you can imagine the "firstshell_WATER" variable contains the water O and
H atoms. It is not what I want! Indeed I want that count_atoms command
counts only the number of Water oxygen. So I use
count_atoms("firstshell_WATER" and elem O)
This command works if I use the pymol GUI but If I use the command in my
script. Indeed
print cmd.count_atoms("firstshell_WATER" and elem O) show a syntax error
Thanks in advance for your help.
Stephane
------------------------------
Message: 7
Date: Thu, 22 Sep 2011 11:14:36 +0200
From: Thomas Holder <[email protected]>
Subject: Re: [PyMOL] Write in a file the number of water at a distance
from a protein surface
To: ABEL Stephane 175950 <[email protected]>
Cc: "[email protected]"
<[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
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
------------------------------
Message: 8
Date: Thu, 22 Sep 2011 10:05:46 +0000
From: ABEL Stephane 175950 <[email protected]>
Subject: [PyMOL] RE : Write in a file the number of water at a
distance from a protein surface
To: Thomas Holder <[email protected]>
Cc: "[email protected]"
<[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Thank you for your response, i will try your suggestion
A bientot
Stephane
________________________________________
De : Thomas Holder [[email protected]] de la part de Thomas Holder
[[email protected]]
Date d'envoi : jeudi 22 septembre 2011 11:14
? : ABEL Stephane 175950
Cc : [email protected]
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/pymol-users
End of PyMOL-users Digest, Vol 64, Issue 17
*******************************************
------------------------------------------------------------------------------
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 ([email protected])
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/[email protected]