From: Axel Kohlmeyer (
Date: Sun Feb 11 2007 - 13:41:08 CST

On Sun, 11 Feb 2007, namd vmd wrote:

R> Hallo,

hallo rose,

R> How to get the number of residues selected from a atomselect command in vmd
R> ?

for example with:

set mysel [atomselect top {<selection text>}]

llength [lsort -integer -unique [$mysel get residue]]

note that 'residue' is a unique residue number that VMD assigns.


R> Thanks
R> -Rose

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.