[chimera-dev] mixing names

Patrick Ladam ladam at smbh.univ-paris13.fr
Tue Oct 14 07:45:59 PDT 2008


Hello to the list,
I start trying to write my first py code in chimera (not that easy
without too much doc strings) and have a first question to submit.

Here is what I am doing in IDLE:

>>> import chimera
>>> opened = chimera.openModels.open('1zik.pdb')

>>> mol = opened[0]
>>> for i in mol.atoms:
	print i.name

N
CA
CB
CG
CD
.../...

# Now I want to instanciate an atom and set its name attribute:

>>> at1=chimera.Atom
>>> at1.name="BC1"
>>> print at1.name
BC1
>>> 

# Now I redo the previous loop:

>>> for i in mol.atoms:
	print i.name

	
BC1
BC1
BC1
BC1
BC1
BC1
BC1
BC1
BC1
BC1
BC1
BC1
.../...

They're all BC1!!!

How come ? My created atom 'at1' and my 'mol' are supposed to be
completely seperated objects no?

Can someone help, I am afraid I missed something really basic here...
Bye to all



More information about the Chimera-dev mailing list