From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Aug 09 2004 - 23:27:28 CDT

Shirley,

On Mon, Aug 09, 2004 at 07:03:33PM -0700, Shirley Li wrote:
> Thank Mr. Stone very much for his very prompt response to my questions.
>
> For question 2), instead of using command "draw text {0.0 1.0 2.0}", is it possible that I could add labels anywhere that I click on? I tried to add the label using above command, but the label seems to be FAR AWAY from my molecule.

You can add labels anywhere, the example I gave used the arbitrary
x/y/z coordinates of 0, 1, 2, but you can locate the label anywhere in
space, ideally somewhere close to the residue or other item(s) of interst.
You'll have to do this in your script.
In order to add labels where you click, you'll probably want to learn how to
"trace" picking events in Tcl. There's a simple example script that uses
mouse picking to add and delete bonds. You should be able to modify it
to add and delete your custom labels:
  http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/pickbond/

> I have two more questions regarding the labeling.
> a) How to ASSIGN a COLOR different from the default (blue) when I add a personable label?

draw color Red
draw color White
...
you get the idea.
This is documented in the VMD user's guide in the section on the
"draw" and "graphics" commands.

> b) I would like the residue name and ID in a protein to be shown whenever I click on any atom on this residue. How could I do that?

By modifying the pickbond script I gave above, perhaps in combination with
the residue labelling script I posted in response to a few questions
earlier today.

  John Stone
  vmd_at_ks.uiuc.edu

> Thanks all for your help.
>
> Shirley
>
> John Stone <johns_at_ks.uiuc.edu> wrote:
>
> Hi,
>
> On Mon, Aug 09, 2004 at 12:53:32PM -0700, Shirley Li wrote:
> > Dear all,
> >
> > I have two questions related to the use of VMD:
> >
> > 1) In order to make animation with VMD, the installation of VIDEOMACHis required. However, VideoMach is a shareware, and it only allows one to use for 30 days of try. Is there any way that could solve this probem, or is there any alternative FREE program that could be used?
>
> I don't personally know of any free MPEG encoder for Windows that's reliable
> enough for the purpose, which is why I used VideoMach. If someone else knows
> of a better program, I'd be happy to write the necessary software to make
> the 'vmdmovie' plugin use it.
>
> > 2) Is VMD graphics, how to add a PERSONABLE LABEL in a desired position? For example, I want to add text "2T3ns" to the graphics, how to do that?
>
> Something like this:
> draw text { 0.0 1.0 2.0 } "2T3ns"
>
> > 3) To label particular residue with the RESIDUE NAME followed by its ID, how to do that? The Mouse munu allows one to label atoms, bonds, and angles, I wonder if VMD support the labeling of RESIDUEs.
>
> Here's a simple script for labelling residues with arbitrary text:
>
> proc labelresidue { residueselection labeltext } {
> set sel [atomselect top "$residueselection and name CA"]
> set positions [$sel get {x y z}]
> set num [$sel num]
> for {set i 0} {$i < $num} {incr i} {
> draw text [lindex $positions $i] $labeltext
> }
> $sel delete
> }
>
> You can run it like this:
> labelresidue "resname ALA" "ALA"
>
> John Stone
> vmd_at_ks.uiuc.edu
>
> --
> 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-6078
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.

-- 
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-6078