From: JC Gumbart (
Date: Sun Feb 11 2007 - 12:16:11 CST

That won't work though, because each residue is overcounted based on its
number of atoms. To do it this way, you would need to type

llength [lsort -unique [$sel get residue]]

Another way is to make a new selection with whatever you're interested and
then type "and CA" (to get only one atom per residue). Then you can just do
"$sel num".

-----Original Message-----
From: [] On Behalf Of
Leonardo Trabuco
Sent: Sunday, February 11, 2007 11:59 AM
To: namd vmd
Subject: Re: vmd-l: atomselection: number of residues

On Sun, Feb 11, 2007 at 01:35:17PM +0100, namd vmd wrote:
> How to get the number of residues selected from a atomselect command
> in vmd ?

You can do something like: llength [$sel get residue]


Leonardo Trabuco, Ph.D. student
Theoretical and Computational Biophysics Group
University of Illinois at Urbana-Champaign