Biopython: How to get the compound name of the pdb file of a protein?
Question: Ive been trying to solve it with the following term:

structure.header['compound']

But all I get is the molecules id instead of its name!


Answer: In order to get the name of crystal structure, i.e. the name which is shown at
the PDB site, you can use:

    
    
    print(structure.header['name'])
    

e.g. (assuming you have `1iah.pdb` in your current working directory)

    
    
    from Bio.PDB import *
    parser = PDBParser()
    structure = parser.get_structure('1IAH', '1iah.pdb')
    print(structure.header['name'])
    

will give you

> ' crystal structure of the atypical protein kinase domain of a trp ca-
> channel, chak (adp-mg complex)'

which is identical to the name shown here:
<http://www.rcsb.org/pdb/explore/explore.do?structureId=1IAH>

* * *

**Update in response to the comments**

In order to get the name of the compound one can use:

    
    
    print(structure.header['compound']['1']['molecule'])
    

