VMD-L Mailing List
From: Joaquim Rui de Castro Rodrigues (joaquim.rodrigues_at_ipleiria.pt)
Date: Sat Jun 19 2021 - 07:24:19 CDT
- Next message: Roni Saiba: "Re: Measure helicity at each frame"
- Previous message: Roni Saiba: "Measure helicity at each frame"
- In reply to: Roni Saiba: "Measure helicity at each frame"
- Next in thread: Roni Saiba: "Re: Measure helicity at each frame"
- Reply: Roni Saiba: "Re: Measure helicity at each frame"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Dear Roni,
Try entering the following command inside the loop, after "set helix 0":
molinfo top set frame $i
Also, "mol ssrecalc" should suffice instead of "mol reanalyze"...
Hope this helps,
Rui Rodrigues
________________________________
De: owner-vmd-l_at_ks.uiuc.edu <owner-vmd-l_at_ks.uiuc.edu> em nome de Roni Saiba <ronis_at_imsc.res.in>
Enviado: 19 de junho de 2021 03:09
Para: vmd-l <vmd-l_at_ks.uiuc.edu>
Assunto: vmd-l: Measure helicity at each frame
I am trying to write a tcl script to measure percentage helicity at
each frame of a VMD .dcd trajectory. I found the following discussion
on the VMD mailing list:
"to calculate the secondary structure for a selection at a given
timestep, you should go to that timestep, and the use the command mol
reanalyze top which runs that timestep through stride (among other
things). Once this is done, you can access the secondary structure of
an atomselect object with $sel get structure"
I have tried to implement it as follows,
set outfile [open ./percent_helix.dat w]
set lookup {H G I}
set frame_num [molinfo top get numframes]
set full [atomselect top "name CA"]
set len [llength [$full get resid]]
for {set i 0} {$i < $frame_num} {incr i} {
set helix 0
$full frame i
$full update
mol reanalyze top
set struc_string [$full get structure]
foreach letter $lookup {
set temp [expr {[llength [split $struc_string $letter]] - 1}]
incr helix $temp
}
set percent [expr {double($helix) / double($len) * 100}]
puts $outfile "$i\t$percent"
}
$full delete
close $outfile
However, the output i am the same percentage value at each timestep. I
have figured that the reason behind that is the command mol reanalyze
top is not changing the secondary structure values at each frame. What
should I correct in my script?
Regards,
Roni Saiba
- Next message: Roni Saiba: "Re: Measure helicity at each frame"
- Previous message: Roni Saiba: "Measure helicity at each frame"
- In reply to: Roni Saiba: "Measure helicity at each frame"
- Next in thread: Roni Saiba: "Re: Measure helicity at each frame"
- Reply: Roni Saiba: "Re: Measure helicity at each frame"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]