PDB Ligands

This module defines functions for fetching PDB ligand data.

class PDBLigandRecord(data)[source]

Class for handling the output of fetchPDBLigand

getCanonicalSMILES()[source]
fetchPDBLigand(cci, filename=None)[source]

Handle PDB ligand data from PDB for chemical component cci. cci may be 3-letter chemical component identifier or a valid XML filename. If filename is given, XML file will be saved with that name.

This function may not work as _PDB is not hosting ligand XML files anymore. It is kept for use with existing ligand XML files.

If you query ligand data frequently, you may configure ProDy to save XML files in your computer. Set ligand_xml_save option True, i.e. confProDy(ligand_xml_save=True). Compressed XML files will be save to ProDy package folder, e.g. /home/user/.prody/pdbligands. Each file is around 5Kb when compressed.

This function is compatible with PDBx/PDBML v 4.0.

Ligand data is returned in a dictionary. Ligand coordinate atom data with model and ideal coordinate sets are also stored in this dictionary. Note that this dictionary will contain data that is present in the XML file and all Ligand Expo XML files do not contain every possible data field. So, it may be better if you use dict.get() instead of indexing the dictionary, e.g. to retrieve formula weight (or relative molar mass) of the chemical component use data.get('formula_weight') instead of data['formula_weight'] to avoid exceptions when this data field is not found in the XML file. URL and/or path of the XML file are returned in the dictionary with keys url and path, respectively.

Following example downloads data for ligand STI (a.k.a. Gleevec and Imatinib) and calculates RMSD between model (X-ray structure 1IEP) and ideal (energy minimized) coordinate sets:

In [1]: from prody import *

In [2]: ligand_data = fetchPDBLigand('STI')
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-2-65da2e637be2> in <module>()
----> 1 ligand_data = fetchPDBLigand('STI')

/home/exx/ProDy-website/ProDy/prody/compounds/pdbligands.py in fetchPDBLigand(cci, filename)
    104             except IOError:
    105                 raise IOError('XML file for ligand {0} is not found online'
--> 106                               .format(cci))
    107             else:
    108                 xml = inp.read()

IOError: XML file for ligand STI is not found online

In [3]: ligand_data['model_coordinates_db_code']
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-3-87a0a2c276f6> in <module>()
----> 1 ligand_data['model_coordinates_db_code']

NameError: name 'ligand_data' is not defined

In [4]: ligand_model = ligand_data['model']
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-c3b5fe43bd1d> in <module>()
----> 1 ligand_model = ligand_data['model']

NameError: name 'ligand_data' is not defined

In [5]: ligand_ideal = ligand_data['ideal']
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-5-3a4a6d842406> in <module>()
----> 1 ligand_ideal = ligand_data['ideal']

NameError: name 'ligand_data' is not defined

In [6]: transformation = superpose(ligand_ideal.noh, ligand_model.noh)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-6-47d2aaf39930> in <module>()
----> 1 transformation = superpose(ligand_ideal.noh, ligand_model.noh)

NameError: name 'ligand_ideal' is not defined

In [7]: calcRMSD(ligand_ideal.noh, ligand_model.noh)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-7-3a9f73b6f35d> in <module>()
----> 1 calcRMSD(ligand_ideal.noh, ligand_model.noh)

NameError: name 'ligand_ideal' is not defined
parsePDBLigand(cci)[source]

See fetchPDBLigand()