VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri May 11 2007 - 11:06:17 CDT
- Next message: Arturas Ziemys: "Fast routines for distance evaluations using PBC."
- Previous message: Francesco Pietra: "Re: Fwd: vmd first installation"
- In reply to: Petrica GASCA: "show atom number in xyz file"
- Next in thread: Petrica GASCA: "Re: show atom number in xyz file"
- Reply: Petrica GASCA: "Re: show atom number in xyz file"
- Reply: Petrica GASCA: "Re: show atom number in xyz file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
If I understand your question correctly, you wish to display the text labels
for all atoms?
If so, you can use a simple script like this one, to add labels
for any selection you like:
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
}
You'd call this with something like:
set molid [molinfo top]
label_atoms $molid "name CA"
If you want to draw your own text labels for each of the atoms
(rather than using the built-in labeling feature) you can also
devise a script that does this, for example:
proc show_partial_charge { selection } {
set sel [atomselect top $selection]
foreach q [$sel get charge] pos [$sel get {x y z}] {
set qstr [format %4.3f $q]
graphics 0 text $pos $qstr
}
}
You'd call this with something like:
show_partial_charge "residue 0"
You can of course modify this to do anything you like.
John Stone
vmd_at_ks.uiuc.edu
On Fri, May 11, 2007 at 01:49:10PM +0200, Petrica GASCA wrote:
> Hello,
>
> I am a new user of VMD and I am trying to get used to it on a Linux machine.
> What is really important for my work is to see atom numbers (the index field
> from the Labels window).
>
> Is there any possibility to show them as atom labels the same way that we
> can see the name of the atom when we select them manually?
>
> Thanks in advance.
-- 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
- Next message: Arturas Ziemys: "Fast routines for distance evaluations using PBC."
- Previous message: Francesco Pietra: "Re: Fwd: vmd first installation"
- In reply to: Petrica GASCA: "show atom number in xyz file"
- Next in thread: Petrica GASCA: "Re: show atom number in xyz file"
- Reply: Petrica GASCA: "Re: show atom number in xyz file"
- Reply: Petrica GASCA: "Re: show atom number in xyz file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]