I was trying to run a docking simulation using rdkit library. But while running I am getting a value error stating: ValueError: Bad Conformer Id.
The 4POJ.pdb file can be downloaded from the RCSB Protein data bank here: 4POJ
Below is the code I am running, and in that line 8, rdMolAlign.AlignMol is the part I am getting this type of error.
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdMolAlign
receptor= Chem.MolFromPDBFile('4POJ.pdb')
ligand= Chem.MolFromSmiles('CC(C(=O)O)N')
rdMolAlign.AlignMol(ligand,receptor)
ff=AllChem.MMFFGetMoleculeForceField(ligand,AllChem.MMFFGetMoleculeProperties(ligand),mmffvariant='MMFF94')
binding_energy= ff.Calcenergy()
print('binding energy:',binding_energy, 'kcal/mol')
There were a couple of things which were missing in your code. Before you AlignMol you need to get the conformer information of the ligands. This can be done with
Chem.AllChem.EmbedMultipleConfs. And to calculate the binding energy you need to Setup the forcefield.With those changes I am able to get the binding energy. Here is the modified code:
We get the output: