Good evening, I have some molecules with neutral amidine heads. I would like to make them positively charged. So I do:
mol = Chem.MolFromMolFile('input.mol', removeHs=False)
q = Chem.MolFromSmarts('[NH]=C[NH2]')
for mat in mol.GetSubstructMatches(q):
mol.GetAtomWithIdx(mat[0]).SetFormalCharge(1)
mol.GetAtomWithIdx(mat[0]).SetNumExplicitHs(2)
m1 = Chem.AddHs(mol, addCoords=True)
However, RDKit complains that the valence for the N in concern is 4,
which is greater than permitted.
I also tried it without the "SetNumExplicitHs" line. While it did not
crash, it refused to add any H to the charged N.
Attached is an example input file. But I got the same result with
other input files too.
Have I missed some steps?
Thank you.
Ling
1LPZ.mol
Description: Binary data
------------------------------------------------------------------------------ Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis & security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

