Re: [Rdkit-discuss] problem when reading in a .sdf file w/ hydrogens already present and removeHs=False

2023-04-03 Thread Wim Dehaen
the sdf doesnt parse so well for me when pasted from the mail(and seems to contain an unusual conformation) but have you tried to turn includeNeighbors=True in this line: numHs = a.GetTotalNumHs(includeNeighbors=True) in case this fixes your issue, discussion why this flag is needed can be found

[Rdkit-discuss] problem when reading in a .sdf file w/ hydrogens already present and removeHs=False

2023-04-03 Thread Francois Berenger
Dear list, This code: --- #!/usr/bin/env python3 import argparse, sys from rdkit import Chem def debug_mol(m): for a in m.GetAtoms(): i = a.GetIdx() anum = a.GetAtomicNum() numHs = a.GetTotalNumHs() print('%d %d %d' % (i, anum, numHs)) if __name__ ==