From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Wed Aug 13 2008 - 10:29:20 CDT

Hi Roman,
I'm afraid I don't understand your problem; if you use that exact
procedure with "protein" for residueselection, it will apply the label
you feed the procedure to each residue in the protein. Is there some
other functionality you're after? You can accomplish many other tasks
using a similar loop by setting the labeltext to something that is
computed inside the loop; for example, replacing the draw line with
draw text [lindex $positions $i] [lindex [$sel get resname] $i]
would label each CA atom with the name of the residue in question.
Best,
Peter

Roman Petrenko wrote:
> I have found this script in vmd-archive to label a residue. Is there
> something to label all residues? something like in pymol.
> or the only choice is to run 20 times this labelresidue procedure?
>
> 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
> }
>
>