From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Wed May 07 2014 - 07:47:46 CDT

True, for line

 

                set a [atomselect top "(water within 7 of ($ligand) and oxygen)"]

 

not for

 

                set a [atomselect top "(water within 7 of ($ligand)) and oxygen"]

 

Writing TCL within outlook isn’t that easy ;)

 

Norman Geist.

 

Von: Joshua Skootsky [mailto:joshua.skootsky_at_gmail.com]
Gesendet: Mittwoch, 7. Mai 2014 14:22
An: Norman Geist
Cc: VMD Mailing List
Betreff: Re: vmd-l: number of water molecules within 5 angstroms of the ligand

 

Try it out in VMD, viewing the different selections using the graphical interface for the selections.

 

The two selections are different.

 

Or look at this console output:

 

>Main< (Skootsky) 7 % set sel1 [atomselect top "water and oxygen within 10 of protein"]

atomselect1

>Main< (Skootsky) 8 % set sel2 [atomselect top "water within 10 of protein and oxygen"]

atomselect2

>Main< (Skootsky) 9 % $sel1 num

4

>Main< (Skootsky) 10 % $sel2 num

3

 

Four isn't three. But the four are four oxygen atoms that lie within 10 Angstroms of any protein atom, and the three are three atoms belonging to one water molecule within 10 Angstroms of oxygen atoms in my protein.

 

On Wed, May 7, 2014 at 2:56 AM, Norman Geist <norman.geist_at_uni-greifswald.de> wrote:

 

Von: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] Im Auftrag von Joshua Skootsky
Gesendet: Dienstag, 6. Mai 2014 20:39
An: Ana Celia Vila Verde
Cc: Ramin Ekhteiari; VMD Mailing List
Betreff: Re: vmd-l: number of water molecules within 5 angstroms of the ligand

 

water within 10 of protein and oxygen

 

is different from

 

water and oxygen within 10 of protein

 

No it’s in fact the same! Both will return the same number of water oxygen atoms. If he wants to also count “half” waters, the “same residue as” method would be usable.

 

The first will give you the number of atoms in the water, the second will give you the number of water molecules.

 

Your code is current like the first, counting the number of atoms in water molecules that are within 7 Angstroms of oxygen molecules in your chosen protein residue.

 

The relevant line of code should be re-written like this:

 

set a [atomselect top "(water and oxygen within 7 of ($ligand) )"]

 

On Tue, May 6, 2014 at 2:35 AM, Ana Celia Vila Verde <acavilaverde_at_gmail.com> wrote:

Dear Ramin,

You need to update the selection:

set frames [molinfo top get numframes]
set fp [open "waters.txt" w]
set ligand "protein and resid 37"
for {set i 0} {$i < $frames} {incr i} {
                puts "Frame: $i"
                set a [atomselect top "(water within 7 of ($ligand) and oxygen)"]
                $a frame $i
                $a update
                set num [$a num]
                puts $fp "$i $num"
                $a delete
}

close $fp

On 5/5/14 8:05 PM, Ramin Ekhteiari wrote:

Dear Norman,
I employed this script but it did not change the frames the only it writes the frame No.

Cheers,
Ramin.

set frames [molinfo top get numframes]

set fp [open "waters.txt" w]

set ligand "protein and resid 37"

for {set i 0} {$i < $frames} {incr i} {
                puts "Frame: $i"
                set a [atomselect top "(water within 7 of ($ligand) and oxygen)"]
                set num [$a num]
                puts $fp "$i $num"
                $a delete
}

close $fp
Out put is :
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
10 11
11 11
12 11
13 11
14 11
15 11
16 11
17 11
18 11
19 11
20 11
21 11
22 11
23 11
24 11
25 11
26 11
27 11
28 11
29 11
30 11
...

...
...

 

On , Ramin Ekhteiari <mailto:ramin_ekh_at_yahoo.com> <ramin_ekh_at_yahoo.com> wrote:

Dear Norman,
I employed this script but it did not change the frames the only it writes the frame No.

Cheers,
Ramin.

set frames [molinfo top get numframes]

set fp [open "waters.txt" w]

set ligand "protein and resid 37"

for {set i 0} {$i < $frames} {incr i} {
                puts "Frame: $i"
                set a [atomselect top "(water within 7 of ($ligand) and oxygen)"]
                set num [$a num]
                puts $fp "$i $num"
                $a delete
}

close $fp
Out put is :
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
10 11
11 11
12 11
13 11
14 11
15 11
16 11
17 11
18 11
19 11
20 11
21 11
22 11
23 11
24 11
25 11
26 11
27 11
28 11
29 11
30 11
...

...
...

 

On Monday, May 5, 2014 2:52 PM, Axel Kohlmeyer <mailto:akohlmey_at_gmail.com> <akohlmey_at_gmail.com> wrote:

On Mon, May 5, 2014 at 4:47 AM, Ramin Ekhteiari
<ramin_ekh_at_remove_yahoo.com> wrote:
> Hi dear all,
>
> I would like to calculate number of water molecules within 5 angstroms of
> the ligand
> which is bonded to the protein for each step during MD.
> I tried to do it for one step, but not for all as loop at TCL.
>
> So would you please advise me on how to do it.

examples for how to do a loop over all trajectory frames are in the
user's guide.

>
> Would be grateful for any advice.
>
>
> Cheers,
> Ramin.

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy. 
 
 
 
 
 
-- 
Joshua Skootsky
(415) 683-9354 <tel:%28415%29%20683-9354>  | joshua.skootsky_at_gmail.com
 
  _____  
 <http://www.avast.com/> 
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus <http://www.avast.com/>  Schutz ist aktiv. 
 
 
-- 
Joshua Skootsky
(415) 683-9354 | joshua.skootsky_at_gmail.com
---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
http://www.avast.com