From: Thomas Evangelidis (te8624_at_mbg.duth.gr)
Date: Wed Dec 26 2007 - 09:49:31 CST

Dear Nagaraju,

I think b-cyclodextrin consists of 7 sugar residues and gamma-cyclodextrin
consists of 8. In both cases if all the sugar residues have the same name (4GA)
the following atomselection should work. Otherwise you have to play with the
atomselection in line 2 untill you find the right one. Also remember that the
residue indexing starts from 0, for example if you want to select residues 1 to
4 you should write "residue 0 to 3".
##############################################################
set outfile [open waters.txt w]
set sel [atomselect top "water within 5 of resname 4GA"]
set n [molinfo top get numframes]
for { set i 0 } { $i < $n } { incr i } {
$sel frame $i
$sel update
set residuelist [$sel get residue]
puts "list of waters within 5 of residue 1 to 7:"
puts "$residuelist"
puts $outfile "Frame $i, $residuelist"
}
close $outfile
##############################################################
The output will look like this:

Frame 0,(+ the indices of waters within 5 angstroms of residues 1 to 7)
Frame 1,(+ the indices of waters within 5 angstroms of residues 1 to 7)
.....

regards,
Thomas

> Dear VMD users,
> I solvated beta-cyclodextrine (resname 4GA, total residues 8
> except water). I want to know the number of water molecules within 5
> angstroms from resid 1 to 8 of beta-cyclodextrine.
> I used the script from mailing list:
> http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/7639.html
>
> I used script:
> ###################################################
> set outfile [open waters.txt w]
> set sel [atomselect top "name O and resname WAT and within 5 of residue 1 "]
> set n [molinfo top get numframes]
> for { set i 0 } { $i < $n } { incr i } {
> $sel frame $i
> $sel update
> set residuelist [$sel get residue]
> puts "list of waters within 5 of residue 1:"
> puts "$residuelist"
> foreach res $residuelist {
> puts $outfile "Frame $i, $residuelist"
> }
> }
> close $outfile
> ##################################################
> then out put is look like this
> ****************************************************
> Frame 0, 69 426 1003 1022 1735 2800
> Frame 0, 69 426 1003 1022 1735 2800
> Frame 0, 69 426 1003 1022 1735 2800
> Frame 0, 69 426 1003 1022 1735 2800
> Frame 0, 69 426 1003 1022 1735 2800
> Frame 0, 69 426 1003 1022 1735 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 1, 206 482 668 1852 1858 1876 2035 2088 2800
> Frame 2, 1517 1925 2009 2409 2468 2800
> Frame 2, 1517 1925 2009 2409 2468 2800
> Frame 2, 1517 1925 2009 2409 2468 2800
> Frame 2, 1517 1925 2009 2409 2468 2800
> Frame 2, 1517 1925 2009 2409 2468 2800
> Frame 2, 1517 1925 2009 2409 2468 2800
> Frame 3, 209 2009 2148 2468 2694
> Frame 3, 209 2009 2148 2468 2694
> Frame 3, 209 2009 2148 2468 2694
> Frame 3, 209 2009 2148 2468 2694
> Frame 3, 209 2009 2148 2468 2694
> Frame 4, 1848 2072 2148
> Frame 4, 1848 2072 2148
> Frame 4, 1848 2072 2148
> Frame 5, 1003 2696
> Frame 5, 1003 2696
> Frame 6, 1575 1740 2448
> Frame 6, 1575 1740 2448
> Frame 6, 1575 1740 2448
> Frame 7, 388 2011 2468 2911
> Frame 7, 388 2011 2468 2911
> Frame 7, 388 2011 2468 2911
> Frame 7, 388 2011 2468 2911
> Frame 8, 328 1639 2725
> Frame 8, 328 1639 2725
> Frame 8, 328 1639 2725
> Frame 9, 328 1393 1517 1928 2274 2373 2725
> Frame 9, 328 1393 1517 1928 2274 2373 2725
> Frame 9, 328 1393 1517 1928 2274 2373 2725
> Frame 9, 328 1393 1517 1928 2274 2373 2725
> Frame 9, 328 1393 1517 1928 2274 2373 2725
> Frame 9, 328 1393 1517 1928 2274 2373 2725
> Frame 9, 328 1393 1517 1928 2274 2373 2725
> Frame 10, 1073 2038
> ********************************************************
> My question is :
> What is wrong in script? If I want water molecules within 5
> angstroms from residue 1 to 8. Is this script work or not? If it works where
> I have to modify?
>
> Any suggestion is appreciated.
>
> with best regards,
> Nagaraju Mulpuri.
>
> ---------------------------------
> Never miss a thing. Make Yahoo your homepage.