[BioPython] PDBParser

Thomas Hamelryck thamelry at vub.ac.be
Wed Dec 3 11:25:17 EST 2003


On Tuesday 02 December 2003 07:44 pm, Sam Khalouei wrote:
> Hello,
>
> I'm working on a PDBParser example in the biopython documentaion; 1fat.
>
> from Bio.PDB.PDBParser import PDBParser
> p=PDBParser(PERMISSIVE=1)
> structure_id="1fat"
> structure=p.get_structure(structure_id, "filename")
> first_model=structure[0]
>
> everything works fine upto here but then
>
> chain_A=first_model["A"]
>
> doesn't work and gives this error;
>
> Traceback (most recent call last):
>   File "<pyshell#47>", line 1, in -toplevel-
>     chain=firstModel["A"]
>   File "C:\Python23\Lib\site-packages\Bio\PDB\Entity.py", line 33, in
> __getitem__
>     return self.child_dict[id]
> KeyError: 'A'


Wich PDB file are you using? 1FAT? If not, could you check if the PDB file 
indeed contains a chain "A"?

Regards,

---
Thomas Hamelryck      
ULTR/COMO
Institute for molecular biology/Computer Science Department
Vrije Universiteit Brussel (VUB)
Brussels, Belgium
http://homepages.vub.ac.be/~thamelry


More information about the BioPython mailing list