VMD-L Mailing List
From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Wed Jul 06 2011 - 10:57:44 CDT
- Next message: Mark Cunningham: "RE: Re: Problem with for loop."
- Previous message: Axel Kohlmeyer: "Re: Problem with for loop."
- In reply to: Sara baretller: "Re: Problem with for loop."
- Next in thread: Mark Cunningham: "RE: Re: Problem with for loop."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
nobody can help you to debug script code without seeing the script.
i've been trying to do psychic debugging for years and it almost
always failed miserably.
axel.
On Wed, Jul 6, 2011 at 11:04 AM, Sara baretller
<sarabiocomputation_at_gmail.com> wrote:
>
>
> Hi all
>
> please if you have an idea or suggestion , i would really appreciated it
>
> I solved the first problem , and the script worked and gave me the angle
> between the six peptides and the vector { 0 1 0} so i added another loop for
> the frames. for {set i 0} {$i < 8} {incr i} { , 8 as an example.
>
> it gave me the same results over and over again for the frames.
>
> here the loop is only till frame 8 as an example:
>
> the repeat for all the angle but i highlighted two anglesas an example that
> keep repeating between from the first frame to the other frame. angle
> 117.72161220856759 between (peptides 0)'s vector and the vector { 0 1 0} in
> frame 0. is the same as angle 117.72161220856759 between peptides 1 vector
> and the vector { 0 1 0} in frame 1 and so on.
>
> i alos hilighted : 55.63259488419982 for the height frame
>
>
> Tcl Counsel results:
>
> residue 0 of 6 peptides
> vec1l vec2l : 19.99249894859944 1.0
> Final angle : 117.72161220856759
> 117.72161220856759
> 0
> residue 1 of 6 peptides
> vec1l vec2l : 18.69491870304378 1.0
> Final angle : 135.78875014576658
> 135.78875014576658
> 0
> residue 2 of 6 peptides
> vec1l vec2l : 27.989461118438296 1.0
> Final angle : 55.63259488419982
> 55.63259488419982
> 0
> residue 3 of 6 peptides
> vec1l vec2l : 27.10166056426399 1.0
> Final angle : 93.17285877063786
> 93.17285877063786
> 0
> residue 4 of 6 peptides
> vec1l vec2l : 29.5839470751503 1.0
> Final angle : 145.5654673648764
> 145.5654673648764
> 0
> residue 5 of 6 peptides
> vec1l vec2l : 25.998842961169046 1.0
> Final angle : 87.57519131337723
> 87.57519131337723
> 0
> residue 0 of 6 peptides
> vec1l vec2l : 19.99249894859944 1.0
> Final angle : 117.72161220856759
> 117.72161220856759
> 1
> residue 1 of 6 peptides
> vec1l vec2l : 18.69491870304378 1.0
> Final angle : 135.78875014576658
> 135.78875014576658
> 1
> residue 2 of 6 peptides
> vec1l vec2l : 27.989461118438296 1.0
> Final angle : 55.63259488419982
> 55.63259488419982
> 1
> residue 3 of 6 peptides
> vec1l vec2l : 27.10166056426399 1.0
> Final angle : 93.17285877063786
> 93.17285877063786
> 1
> residue 4 of 6 peptides
> vec1l vec2l : 29.5839470751503 1.0
> Final angle : 145.5654673648764
> 145.5654673648764
> 1
> residue 5 of 6 peptides
> vec1l vec2l : 25.998842961169046 1.0
> Final angle : 87.57519131337723
> 87.57519131337723
> 1
> residue 0 of 6 peptides
> vec1l vec2l : 19.99249894859944 1.0
> Final angle : 117.72161220856759
> 117.72161220856759
> 2
> residue 1 of 6 peptides
> vec1l vec2l : 18.69491870304378 1.0
> Final angle : 135.78875014576658
> 135.78875014576658
> 2
> residue 2 of 6 peptides
> vec1l vec2l : 27.989461118438296 1.0
> Final angle : 55.63259488419982
> 55.63259488419982
> 2
> residue 3 of 6 peptides
> vec1l vec2l : 27.10166056426399 1.0
> Final angle : 93.17285877063786
> 93.17285877063786
> 2
> residue 4 of 6 peptides
> vec1l vec2l : 29.5839470751503 1.0
> Final angle : 145.5654673648764
> 145.5654673648764
> 2
> residue 5 of 6 peptides
> vec1l vec2l : 25.998842961169046 1.0
> Final angle : 87.57519131337723
> 87.57519131337723
> 2
> residue 0 of 6 peptides
> vec1l vec2l : 19.99249894859944 1.0
> Final angle : 117.72161220856759
> 117.72161220856759
> 3
> residue 1 of 6 peptides
> vec1l vec2l : 18.69491870304378 1.0
> Final angle : 135.78875014576658
> 135.78875014576658
> 3
> residue 2 of 6 peptides
> vec1l vec2l : 27.989461118438296 1.0
> Final angle : 55.63259488419982
> 55.63259488419982
> 3
> residue 3 of 6 peptides
> vec1l vec2l : 27.10166056426399 1.0
> Final angle : 93.17285877063786
> 93.17285877063786
> 3
> residue 4 of 6 peptides
> vec1l vec2l : 29.5839470751503 1.0
> Final angle : 145.5654673648764
> 145.5654673648764
> 3
> residue 5 of 6 peptides
> vec1l vec2l : 25.998842961169046 1.0
> Final angle : 87.57519131337723
> 87.57519131337723
> 3
> residue 0 of 6 peptides
> vec1l vec2l : 19.99249894859944 1.0
> Final angle : 117.72161220856759
> 117.72161220856759
> 4
> residue 1 of 6 peptides
> vec1l vec2l : 18.69491870304378 1.0
> Final angle : 135.78875014576658
> 135.78875014576658
> 4
> residue 2 of 6 peptides
> vec1l vec2l : 27.989461118438296 1.0
> Final angle : 55.63259488419982
> 55.63259488419982
> 4
> residue 3 of 6 peptides
> vec1l vec2l : 27.10166056426399 1.0
> Final angle : 93.17285877063786
> 93.17285877063786
> 4
> residue 4 of 6 peptides
> vec1l vec2l : 29.5839470751503 1.0
> Final angle : 145.5654673648764
> 145.5654673648764
> 4
> residue 5 of 6 peptides
> vec1l vec2l : 25.998842961169046 1.0
> Final angle : 87.57519131337723
> 87.57519131337723
> 4
>
> On Wed, Jul 6, 2011 at 10:38 AM, Sara baretller
> <sarabiocomputation_at_gmail.com> wrote:
>>
>>
>> I have been having a problem with this script , I will really appreciate
>> your help. so the script does get me the angle between two vectors but then
>> it will not go to the next loop. it stops in the first. by giving the angle
>> between the first vector and the vector {0 1 0 }.
>>
>>
>>
>> Script:
>>
>> for {set j 0} {$j < 6} {incr j} {
>>
>> set outfile [open "out.dat" "w"]
>>
>> set mol [molinfo top]
>>
>> set sel1 [atomselect $mol "residue $j and resname LEU and
>> name BBc"]
>>
>> set sel2 [atomselect $mol "residue $j and resname GLU and
>> name BBc"]
>>
>> $sel1 frame $j
>> $sel2 frame $j
>>
>> $sel1 update
>> $sel2 update
>>
>> puts "residue $j of 6 peptides"
>> puts "$sel1 $sel2"
>>
>> set nLEU [llength [$sel1 list]]
>> set nGLU [llength [$sel2 list]]
>>
>> set coord1 [$sel1 get { x y z }]
>> set coord2 [$sel2 get { x y z }]
>>
>>
>> set vec1 [vecsub [lindex $coord1 0] [lindex $coord2 0]]
>>
>> set vec2 {0 1 0}
>>
>> set vec1l [veclength $vec1]
>> set vec2l [veclength $vec2]
>>
>> if {$vec1l != 0} {
>> set vec1 [vecnorm $vec1]
>> }
>> if {$vec2l != 0} {
>> set vec2 [vecnorm $vec2]
>> }
>>
>> set dotprod [vecdot $vec1 $vec2]
>>
>> set angle [expr acos($dotprod)]
>>
>> set angle [expr ($angle * 180/3.14159)]
>> puts "Final angle : $angle"
>> puts $angle
>> }
>>
>> close $outfile
>>
>> tcl councel:
>>
>> angle 1.5284741404344042
>> Final angle : 87.57519131337723
>> 87.57519131337723
>>
>>
>> Thank you
>>
>> Sara
>>
>
>
-- Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0 Institute for Computational Molecular Science Temple University, Philadelphia PA, USA.
- Next message: Mark Cunningham: "RE: Re: Problem with for loop."
- Previous message: Axel Kohlmeyer: "Re: Problem with for loop."
- In reply to: Sara baretller: "Re: Problem with for loop."
- Next in thread: Mark Cunningham: "RE: Re: Problem with for loop."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]