From: emiliawu_at_dicp.ac.cn
Date: Sat Mar 12 2011 - 07:16:32 CST

Hi All,

I have a question about using tcl script to count the number of ions in my system from different frames in my dcd files.
here is the script:
--------------------

package require psfgen

topology top_all27pl36.rtf

mol new sheet_namd.psf
mol addfile sheet-equil.1.dcd step 99 waitfor all
mol addfile sheet-equil.2.dcd step 99 waitfor all

set outfile1 [open cla_5.dat w];
set nf [molinfo top get numframes]
set sel [atomselect top {segname CLA and within 5 of {segname "PEP.*"}}]
for {set i 0 } {$i < $nf } { incr i } {
    $sel frame $i
    puts $outfile1 [$sel num ]
}
close $outfile1

--------------------

the result I got is same number for different frames, I do not know what's wrong with my script, did I not set the frame part correctly? thanks a lot for any help!

Emilia

___________________________________
DICP WebMail, http://webmail.dicp.ac.cn