VMD-L Mailing List
From: Maxim Belkin (mbelkin_at_ks.uiuc.edu)
Date: Sat Aug 16 2014 - 02:48:51 CDT
- Next message: Maxim Belkin: "Re: Labeling atoms by index"
- Previous message: Maxim Belkin: "Re: Parameter and Topology File UPDATE."
- In reply to: Andrew DeYoung: "Labeling atoms by index"
- Next in thread: Maxim Belkin: "Re: Labeling atoms by index"
- Maybe reply: Maxim Belkin: "Re: Labeling atoms by index"
- Maybe reply: Maxim Belkin: "Re: Labeling atoms by index"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Here is a recipe that you can use to cook up the labels to your liking:
###
set labelsToCook [llength [label list Atoms]]
for {set label 0} {$label < $labelsToCook} {incr label} {
label textformat Atoms $label {%i}
}
###
Maxim
On Aug 15, 2014, at 4:46 PM, Andrew DeYoung <adeyoung_at_andrew.cmu.edu> wrote:
> 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
- Next message: Maxim Belkin: "Re: Labeling atoms by index"
- Previous message: Maxim Belkin: "Re: Parameter and Topology File UPDATE."
- In reply to: Andrew DeYoung: "Labeling atoms by index"
- Next in thread: Maxim Belkin: "Re: Labeling atoms by index"
- Maybe reply: Maxim Belkin: "Re: Labeling atoms by index"
- Maybe reply: Maxim Belkin: "Re: Labeling atoms by index"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]