[BioPython] question about navigating a PDB

Hua Wong wong at ebgm.jussieu.fr
Mon Jun 21 08:33:36 EDT 2004


I want to extract the X,Y,Z coordinate from all the CA of a PDB.

I fiddled a bit with bio.PDB since during last week...end (°~°) and I
ended up typing this:

parser=PDBParser(PERMISSIVE=0)
structure=parser.get_structure('foo','bar.pdb')
liste=[]
model=structure[0]
chain=model['A']
for residue in chain.get_iterator():
	for atom in residue.get_iterator():
		if atom==residue['CA']:
			a=atom.get_coord()
			liste.append(a)

Which gives me what I want. But I also get the following lines:

Traceback (most recent call last):
  File "<stdin>", line 3, in ?
  File "/home/pif/wong/Softwares/MMTK/lib/python/Bio/PDB/Entity.py",
line 38, in __getitem__
    return self.child_dict[id]
KeyError: CA

So I guess I might have done it the wrong way, or forgot something...
Any hints can help.

Thanks



More information about the BioPython mailing list