From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Jun 04 2003 - 11:32:15 CDT

Hi Thomas,
  You can use Tcl to create labels pretty easily in VMD, you can also
query the label list and get values back from Tcl. While not ideal, one
could write a script that creates a Dihedral label, then does
'label list Dihedrals' to get values back. I.e.:

vmd> label add Dihedrals 0/1001 0/1000 0/1002 0/1009
Info) Added new Dihedrals label GLN64:OE1/GLN64:CD/GLN64:NE2/GLN64:1HE2 = -0.019782
vmd > set foo [label list Dihedrals]
{{0 1001} {0 1000} {0 1002} {0 1009} -0.019782 show}
vmd > set mydihedral [lindex [lindex $foo 0] 4]
-0.019782

Make sense?

Regarding altering dihedrals, I don't believe we have an
easy way to accomplish that at present. You could do it by
making an atom selection on the part of the structure on the
other side of the bond, and then use the "get" and "set"
or the "move" methods of the atom selection to alter the
atomic coordinates of the structure as necessary. So, while its
doable I don't think we have a script laying around that does this
yet, but if I find out that someone's got one, I'll let you know.

Thanks,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Jun 04, 2003 at 05:58:36PM +0200, Thomas Hedegaard Pedersen wrote:
> Hi,
>
> Does anyone know if there is an easy way to obtain dihedral angles
> from within a tcl-script. I'm aware that for a protein it is easy to
> obtain the phi and psi angles by using the: get phi (or get psi),
> calls, but are there someway that the dihedral for a given selection
> of 4 atoms can be obtained (by a simple function call)????
>
> In addition, is it possible to rotate some parts of a molecule by
> specifying a new dihedral, as it is possible to use the move command
> to move atomselections by some given distance x, y, z????
>
> Thank you
>
> Stud. Polyt.
> Thomas Hedegaard Pedersen
> Department of Chemistry
> Technical University of Denmark

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-607how}