VMD-L Mailing List
From: ban arn (ban.arn_at_gmail.com)
Date: Fri Mar 11 2011 - 11:15:51 CST
- Next message: Axel Kohlmeyer: "Re: tcl script"
- Previous message: John Stone: "Re: snow leopard CUDA and VMD 1.9"
- In reply to: Ajasja Ljubetič: "Re: tcl script"
- Next in thread: Goldsmith, Jacob: "RE: tcl script"
- Reply: Goldsmith, Jacob: "RE: tcl script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Dear Ajasja
Thanks it works.
Could you please help me for writing the output as separate file
instead of displaying in tk console.
Many Thanks
Balaji
On Fri, Mar 11, 2011 at 4:17 PM, Ajasja Ljubetič
<ajasja.ljubetic_at_gmail.com> wrote:
> Hi,
> you have to move the set A and set B calls inside the loop
> set mol [molinfo top]
> set sel1 [atomselect $mol "resname UNK"]
> set sel2 [atomselect $mol "resid 200"]
> set frames [molinfo $mol get numframes]
> for {set i 0} {$i < $frames} {incr i} {
> $sel1 frame $i
> $sel2 frame $i
> $sel1 update
> $sel2 update
> set A [lindex [$sel1 get { x y z }] 0]
> set B [lindex [$sel2 get { x y z }] 0]
> set distAB [vecdist $A $B]
> puts "$i $distAB"
> }
> regards,
> Ajasja
> On Fri, Mar 11, 2011 at 16:06, ban arn <ban.arn_at_gmail.com> wrote:
>>
>> Dear VMD users
>>
>> I'm new to tcl scripting and i'm thankful to help or suggestion.
>>
>> In tcl script for calculating the distance between center of mass of
>> ligand and residues along the trajectory, I'm trying to loop over the
>> trajectory, but I couldn't able to update the frames along the time.
>>
>> Kindly find the script here:
>>
>> set mol [molinfo top]
>> set sel1 [atomselect $mol "resname UNK"]
>> set sel2 [atomselect $mol "resid 200"]
>> set A [lindex [$sel1 get { x y z }] 0]
>> set B [lindex [$sel2 get { x y z }] 0]
>> set distAB [vecdist $A $B]
>> set frames [molinfo $mol get numframes]
>> for {set i 0} {$i < $frames} {incr i} {
>> $sel1 frame $i
>> $sel2 frame $i
>> $sel1 update
>> $sel2 update
>> set n [vecdist $A $B]
>> puts "$i $n"
>> }
>>
>> Kindly advice
>>
>> Many Thanks
>> Balaji
>
>
- Next message: Axel Kohlmeyer: "Re: tcl script"
- Previous message: John Stone: "Re: snow leopard CUDA and VMD 1.9"
- In reply to: Ajasja Ljubetič: "Re: tcl script"
- Next in thread: Goldsmith, Jacob: "RE: tcl script"
- Reply: Goldsmith, Jacob: "RE: tcl script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]