From: Andrew DeYoung (adeyoung_at_andrew.cmu.edu)
Date: Fri Aug 15 2014 - 16:46:00 CDT

Hi,

In an archived message on this mailing list (
http://www.ks.uiuc.edu/Research/vmd/mailing_list/vmd-l/9356.html ), there is
a recipe by John Stone for labeling all atoms of a molecule:

proc label_atoms { molid seltext } {
  set sel [atomselect $molid $seltext]
  set atomlist [$sel list]
  foreach {atom} $atomlist {
    set atomlabel [format "%d/%d" $molid $atom]
    label add Atoms $atomlabel
  }
  $sel delete
}

which John Stone explains can be called with:

set molid [molinfo top]
label_atoms $molid "name CA"

When I use this recipe, the labels appear to be the residue and atom names.
How can I modify the above recipe so that the atom indices (e.g., 0, 1, 2,
..) -- which, according to "Selections" in the "Graphical Representations"
window, are referred to by "index" -- are displayed instead?

Thank you very much for your time!

Andrew DeYoung
Carnegie Mellon University