VMD-L Mailing List
From: sally cii (cii.sally_at_googlemail.com)
Date: Fri Jul 13 2007 - 12:02:02 CDT
- Next message: Axel Kohlmeyer: "Re: how to save a list in a file"
- Previous message: luca.dallaglio2_at_studio.unibo.it: "Problem with namdstats.tcl in TkCon"
- Next in thread: Axel Kohlmeyer: "Re: how to save a list in a file"
- Reply: Axel Kohlmeyer: "Re: how to save a list in a file"
- Reply: Nuno Loureiro Ferreira: "Re: how to save a list in a file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Dear all,
I want to write a tcl script that can return the list of atom index in $sel1
that within a certain distance contact with atoms in $sel2 during a
trajectory. Here is the trial script, after I load this script, I got the
atom index printed out in tcl console together with complain about 'bad
option', but not saved in the file I wanted. Can anyone tell me how to
return a list in a file? thank you in advance!
#####################################################
proc num_contact {mol dist fname} {
set nf [molinfo top get numframes]
set f [open $fname "w"]
for {set i 0} {$i < $nf} {incr i} {
$sel1 frame $i
$sel1 update
$sel2 frame $i
$sel2 update
set lists [measure contacts $dist $sel1 $sel2]
set list1 [lsort -increasing $lists 0]
puts $f "$list1"}
close $f
$sel1 delete
$sel2 delete
}
####################################################
Sincerely,
Sally Cii
- Next message: Axel Kohlmeyer: "Re: how to save a list in a file"
- Previous message: luca.dallaglio2_at_studio.unibo.it: "Problem with namdstats.tcl in TkCon"
- Next in thread: Axel Kohlmeyer: "Re: how to save a list in a file"
- Reply: Axel Kohlmeyer: "Re: how to save a list in a file"
- Reply: Nuno Loureiro Ferreira: "Re: how to save a list in a file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]