From: Giovanni Bellesia (gbellesia_at_chem.ucsb.edu)
Date: Thu Mar 26 2009 - 15:16:25 CDT

try

set n [[atomselect top "name CA and resname HSD"] num]

-g

> Hello:
> I'm a newcomer to VMD and I have to do some things with the
> tk console, one of this is to count the number of some aminoacids in a
> protein, for example I have to count the number of histidines I have,
> for this I found I could use the following command:
>
> set n [[atomselect top "resname HSD"] num]
>
> But I realized this counts the number of atoms that are
> related to the Histidine, Is there a way to count the number of
> histidines, but not the atoms related to histidines?
> In my protein that command gives back a 68, and it should be a 4.
>
> Cheers.
>
> O'car Campos C.
> Bioinformatics Engineering Student.
> Universidad de Talca.