From: Axel Kohlmeyer (
Date: Sun Aug 10 2008 - 09:48:15 CDT

On Sun, 10 Aug 2008, bo baker wrote:

BB> Hello,

hello bo,
BB> I use VMD to do some analysis works on the residues between the
BB> interaction site from two protein. From "graph presentation", I select
BB> the residues "chain B and within 5 of chain A". It returns several
BB> residues in the main display. In order to know all these residues, I
BB> use "lable" to click on each.
BB> I need to exam a large amount conformations of the complex later on.
BB> It is time consuming to write down the residues from each
BB> conformation, plus easy to make a mistake. I wonder if there is a way
BB> that I could save my selections, I mean the residue ID in text form,
BB> and plot them later?

this is what can be done best using the tcl (or python) scripting
interface in VMD. have a look at the corresponding descriptions and
examples in the VMD user's guide and the tutorials referred to from
the VMD home page.

for your specific example you'd do something like

set sel [atomselect top "chain B and within 5.0 of chain A"]

and then you can get the information you want through:

set res [$sel get {index name resname resid}]

which returns a list lists with several pieces of information
about each atom in the selection, i.e. here a list of the
atom index, atom name, residue name, residue id.

please note, that resid is the number from the .psf file
and "residue" is the unique number vmd assigns to each
residue (similar to index).


BB> Thank you for your help.
BB> Bo

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.