I am currently working on identifying effective antiviral compounds against the corona virus. I have downloaded the Covid-19 AntiViral Candidate Compounds Dataset from the www.cas.org webpage, the link to which I have provided below. Me and a few other doctors are using Docking software to predict the docking capacity of these anti-viral compounds. Docking software requires the anti-viral compounds to be in the .pdb file format only then is it recognized by Automated docking software. Is there any way I can convert the .sdf file containing the anti-viral compounds to .pdb file or is there a way of obtaining the .pdb files for list of anti-viral compounds.

Thank you for your time and patience, Anas Hussain.

Anti-Viral Candidate Compounds Dataset https://www.cas.org/covid-19-antiviral-compounds-dataset


2 Answers 2


Use OpenBabel.

Something like babel -isdf file_in.sdf -opdb file_out.pdb.


Bizarrely, Obabel seems to have written a PDB that was incorrectly spaced for the OP as seen in Error pasing the following line in pdb

If you can use python, rdkit is a great package for cheminformatics —best installed via conda though.

It allows you do all sorts of things, such as match substructures, embed conformers, edit compounds, compute advanced parameters and many forms of shape & colour finger-/foot-printings.

Given a multi-compound sdf you can read each individual molecule and write them out as PDBs.

from rdkit import Chem
with i, mol in enumerate(Chem.SDMolSupplier('in.sdf')):

We can be fancier with the output name

from rdkit import Chem
import re
with mol in Chem.SDMolSupplier('in.sdf'):
    # The headerline of a mol file is retrieved oddly.
    name = mol.GetProp('_Name')
    # make filename safe
    slugify = lambda name: re.sub(r'[\W_.-]+', '-', name)

To specify what name (e.g. CA) each atom gets and what is the residue name, chain and residue position —information absent in the sdf, it gets a bit odd.

  names = [' CA ', ' CB ', ' CG ', ' CD '] # say
  for i, atom in enumerate(mol.GetAtoms()):
        info = Chem.AtomPDBResidueInfo(names[i], # or whatever.

For more see this blog post.

  • $\begingroup$ for the rdkit sdf to pdb conversion, should i enter the multi entry sdf filename in the line below; "with mol in Chem.SDMolSupplier('in.sdf'):" $\endgroup$
    – Shahbaaz
    Jun 22, 2020 at 17:42
  • $\begingroup$ Correct in.sdf is an example filename —the quotes must be there or it will think it a variable. If you are unfamiliar with python this route is probably not the best way. $\endgroup$ Jun 22, 2020 at 20:25
  • $\begingroup$ I am unfamiliar with python however I am currently trying to learn it from scratch. Thank you $\endgroup$
    – Shahbaaz
    Jun 23, 2020 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.