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]

Fetch 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.

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')

In [3]: ligand_data['model_coordinates_db_code']
Out[3]: '1IEP'

In [4]: ligand_model = ligand_data['model']

In [5]: ligand_ideal = ligand_data['ideal']

In [6]: transformation = superpose(ligand_ideal.noh, ligand_model.noh)

In [7]: calcRMSD(ligand_ideal.noh, ligand_model.noh)
Out[7]: 2.267863821452653
parsePDBLigand(cci, filename=None)[source]

See fetchPDBLigand()

calc2DSimilarity(smiles1, smiles2)[source]

Calculate 2D similarity using Morgan Fingerprints

Parameters:
  • smiles1 (str, PDBLigandRecord) – first SMILES string or PDBLigandRecord containing one
  • smiles2 (str, PDBLigandRecord) – second SMILES string or PDBLigandRecord containing one