From: Axel Kohlmeyer (
Date: Wed Mar 19 2014 - 02:34:23 CDT

On Wed, Mar 19, 2014 at 2:38 AM, spandu K <> wrote:
> Dear VMD users,
> I am a novice reg. VMD. Can anyone help me in finding the total number of
> residues present in a given system.
> I have tried with molinfo and topo, but could not find anything helpful.

it is printed when you load the molecule. other than that you can
create a selection, retrieve the list of residue numbers and pass it
to lsort -unique and then the length of the list is the number of
residues in that selection, i.e. something like this:

set seltxt {all}
set nres [llength [lsort -unique -integer [[atomselect top $seltxt]
get residue]]]
puts "number of residues for selection '$seltxt' is $nres"

> Thanks
> Spandana

Dr. Axel Kohlmeyer
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.