graphein
graphein copied to clipboard
H coords are not included when constructing molecule graph from SDF file
Describe the bug
H atoms are not included in coords when constructing molecule graph with add_hs=True and path.
To Reproduce Colab reproducing the bug: https://colab.research.google.com/drive/122CTepC6O_-R-jbLArcbdqSQOiQseB-H?usp=sharing
Expected behavior
If config.add_hs is True, rdmol = Chem.AddHs(rdmol, addCoords=True) needs to be executed before creating the coords list. Otherwise an IndexError occurs when nodes are added in https://github.com/a-r-j/graphein/blob/master/graphein/molecule/graphs.py#L79.
Happy to open a PR fixing the bug.