rdkit / mmpdb

A package to identify matched molecular pairs and use them to predict property changes.
Other
197 stars 55 forks source link

Use version-independent *[H] in fragment_molecule_on_explicit_hydrogens() #57

Closed i-tub closed 3 months ago

i-tub commented 6 months ago

Since 2018, RDKit generates "*" instead of "[*]" for wildcard atoms, but fragment_molecule_on_explicit_hydrogens() was comparing RDKit-generated SMILES against the hard-coded string "[*][H]", which led to AssertionError "did not split hydrogen correctly".

This commit replaces the hard-coded string with one produced by Chem.MolFromSmiles(). (I did not change the string that is passed to the Fragmentation constructor, since it didn't seem necessary.)

(Also added test_loadprops.py to the manifest; I forgot tot do so when I added that test years ago!)