From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Wed Mar 19 2014 - 02:34:23 CDT

On Wed, Mar 19, 2014 at 2:38 AM, spandu K <spandana.kittiki_at_gmail.com> 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  akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.