From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Sat Feb 23 2002 - 16:53:21 CST

Hi,

On Fri, Feb 22, 2002 at 12:26:51PM -0500, Fei Xu wrote:
> I am trying to select residue No.1 in chain I in pd0001.pdb. I met some
> problems as below.
> 1. I should get an integral but I got a list of resids:
> >>> res_I1 = AtomSel('chain I' and 'residue 1')
> >>> res_I1.get('resid')
> [39, 39, 39, 39, 39, 39, 39, 39, 39, 39]

This is the expected behavior, since the atom selection contains all the
atoms in the residue. If you only want one number per residue, you could
add "and name CA" to your atom selection string.

>
>
> 2. I tried to give residue NO.1 in chain I red color, but it said that
> invalid graphics molecule
> >>> for x in res_I1.get('resid'):
> ... color(x,'white')

This isn't how atoms are colored in VMD. What you want to do instead is
create a representation, either in the graphics menu or with Python
commands, and then change the coloring style for the entire rep. More
information on how to do this is in the User's Guide in the discussion of
the Python "molrep" module.

Justin
vmd_at_ks.uiuc.edu

> ...
> Traceback (most recent call last):
> File "VMD", line 2, in ?
> ValueError: Invalid graphics molecule
>
> I read through the user's guide . But I don't think it tells me python
> script in vmd detailly.What should I do ?
>
> fei xu

-- 
Justin Gullingsrud      3111 Beckman Institute
H: (217) 384-4220       I got a million ideas that I ain't even rocked yet...
W: (217) 244-8946       -- Mike D