From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Fri Feb 07 2014 - 11:07:01 CST

On Fri, Feb 7, 2014 at 11:08 AM, chandrakala gowda
<chandrakala.gowda_at_gmail.com> wrote:
> I need to measure dihedral angle of a particular segment
> of several calculated protein models.
>
> My code as follows
>
> #==To load the pdb files==#
>
> set filelist [glob *.pdb]
> foreach file $filelist {
> mol new $file waitfor all
> }
>
> #== to measure the dihedral of each file that is loaded==#
>
> foreach mid [molinfo list] {
>
> set Ncax [ atomselect $mid "segid B and resid 1 and name CAX" ]
> set Ncay [ atomselect $mid "segid B and resid 1 and name CAY" ]
> set Ncaz [ atomselect $mid "segid B and resid 1 and name CAZ" ]
> set Ncbg [ atomselect $mid "segid B and resid 1 and name CBG" ]
> set ind1 [ $Ncax get index ]
> set ind2 [ $Ncay get index ]
> set ind3 [ $Ncaz get index ]
> set ind4 [ $Ncbg get index ]
>
> set xdihed [ measure dihed [list $ind1 $ind2 $ind3 $ind4]]
> puts $xdihed
> }
>
> #===#
> But the code does not really work. It gives me the same value for the
> dihedral angle always.
> which in reality is not the case. when I measure for each molecule the
> dihedral angle is different.
> when i use the code for a single molecule
>
> 177.88656616210938
> 177.88656616210938
> 177.88656616210938
> 177.88656616210938
> 177.88656616210938
> 177.88656616210938
> 177.88656616210938
> 177.88656616210938
>
> please could anyone point out if there is something wrong in the code.?

from the VMD User's guide:

Unless you specify a certain molecule through 'molid molecule_number'
these indices refer to the current top molecule.

axel.

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.