mol = Chem.MolFromSmiles('C(C(=O)C([H])([H])[H])([H])([H])[H]')
for atom in mol.GetAtoms():
print(atom.GetNumImplicitHs(), atom.GetNumExplicitHs())
>>>
0 3
0 0
0 0
0 3
mol_noh = Chem.RemoveHs(mol, updateExplicitCount=True)
for atom in mol_noh.GetAtoms():
print(atom.GetNumImplicitHs(), atom.GetNumExplicitHs())
>>>
0 3
0 0
0 0
0 3
Note that if I add the hydrogens first, everything works as expected:
mol_h = Chem.AddHs(mol, explicitOnly=True)
mol_noh = Chem.RemoveHs(mol_h)
for atom in mol_noh.GetAtoms():
print(atom.GetNumImplicitHs(), atom.GetNumExplicitHs())
>>>
3 0
0 0
0 0
3 0
Perhaps this is expected behavior?
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss