Previously, we provided a similar script to download ligand SMILES from PDB ligand IDs. In this article, we are downloading PDB ligand structures from their corresponding IDs.
The ligand structures can be downloaded in SDF format from PDB. But if you need to download these structures from ligand PDB IDs and need them in PDB format, then you can use the following script.
We have written a new script to download ligand structures from PDB using their IDs and, converting them all into PDB format. The script is available on our GitHub repository, namely, “Cheminformatics“.
ligand-id-to-str-in-pdb-format.ipynb is a Python notebook that will fetch 3D ligand structures from Protein Data Bank in SDF format for each ligand ID and then it will convert them into PDB format using OpenBabel [1].
Usage
Provide all Ligand IDs in the ‘lig-ids.csv‘ file and save it. Run the Jupyter notebook to get the results. The script will read ligand IDs, then download their respective SDF files, followed by converting them into PDB format.
Availability
The script is available on GitHub in the ‘cheminformatics‘ repository.
References
- O’Boyle, N. M., Banck, M., James, C. A., Morley, C., Vandermeersch, T., & Hutchison, G. R. (2011). Open Babel: An open chemical toolbox. Journal of cheminformatics, 3(1), 1-14.