<p>RDKit has a one line command to fix the bond order (<a href="https://www.rdkit.org/docs/source/rdkit.Chem.AllChem.html" rel="nofollow noreferrer">docs</a>)</p>
<pre><code> mol = Chem.MolFromMolFile('wonky.mol')
 template = Chem.MolFromMol2File('template.mol2')
 newMol = AllChem.AssignBondOrdersFromTemplate(template, mol)
</code></pre>
<p>The problem is that the two need to be identical. I see a carboxylate in your screenshots, so you most likely did the correct thing and docked with the appropriate protonation for pH 7, i.e. as the conjugate base with a negative formal charge. If one does not then RDKit will fail.</p>
<p>Also, RDKit is &quot;not great&quot; with mol2 files. If you have the original SMILES that is better. If the problem is atom names, using a PDB is a better call. If you want to assign atom names, this <a href="https://blog.matteoferla.com/2020/03/atom-names-purely-in-rdkit.html" rel="nofollow noreferrer">blog post</a> of mine may help.</p>

CC BY-SA 4.0
2021-05-09T22:10:12.047Z
2021-05-09T22:10:12.047Z
Matteo Ferla
<p>I was doing a Virtual Screening Search using Pharmer software. The .sdf output file contains a column in mol format and another column with Root Mean Square Deviations. I can see some bond order and connectivity problems in the mol column. I do have a mol2 file that contains the original molecules and I was wondering if I can use these mol2 files, to fix this. Can rdkit work in this case?</p>
<p><a href="https://i.sstatic.net/hwEFI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hwEFI.png" alt="enter image description here" /></a><a href="https://i.sstatic.net/hRzUM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hRzUM.png" alt="enter image description here" /></a></p>

<rdkit>
Is it possible to correct bond order and conectivity problems in an sdf file according to mol2 files?
# Is it possible to correct bond order and conectivity problems in an sdf file according to mol2 files?

(Asked by: username_0 on 2021-05-07)

I was doing a Virtual Screening Search using Pharmer software. The .sdf output file contains a column in mol format and another column with Root Mean Square Deviations. I can see some bond order and connectivity problems in the mol column. I do have a mol2 file that contains the original molecules and I was wondering if I can use these mol2 files, to fix this. Can rdkit work in this case?

[![enter image description here](https://i.sstatic.net/hwEFI.png)](https://i.sstatic.net/hwEFI.png)[![enter image description here](https://i.sstatic.net/hRzUM.png)](https://i.sstatic.net/hRzUM.png)

**Tags:** rdkit

---

## 1 answers

### Answer by username_1 on 2021-05-09. Score: 2 | Accepted answer

RDKit has a one line command to fix the bond order (docs)
 mol = Chem.MolFromMolFile('wonky.mol')
 template = Chem.MolFromMol2File('template.mol2')
 newMol = AllChem.AssignBondOrdersFromTemplate(template, mol)

The problem is that the two need to be identical. I see a carboxylate in your screenshots, so you most likely did the correct thing and docked with the appropriate protonation for pH 7, i.e. as the conjugate base with a negative formal charge. If one does not then RDKit will fail.
Also, RDKit is "not great" with mol2 files. If you have the original SMILES that is better. If the problem is atom names, using a PDB is a better call. If you want to assign atom names, this blog post of mine may help.


---

