From: harish vashisth (
Date: Fri Jun 08 2012 - 12:49:18 CDT

Hi Nate,
I think you can load your pdb and query "chain" for a particular atom

For example:
# In this case the script finds chain names for all Ca atoms

mol new myfile.pdb
set sel [atomselect top "protein and name CA"]
$sel get chain


I think it should can make other atom selections to find
corresponding chains..look at the following page for what else you can
query for atom-selections


On Fri, Jun 8, 2012 at 12:19 PM, Nate Hurley <> wrote:

> Hi all,
> I'm new to VMD as of this week, and I'm trying to write a script that
> needs to determine how many chains exist in a pdb file. In each of my
> files there is a chain A, and then there are somewhere between 5 and 20
> chains Z, Y, X, . . . . Is there a way that I can easily find how many
> chains I have?
> Thanks for your help.
> -Nate Hurley