psiresp
psiresp copied to clipboard
Bug in molecule.py for protonated molecules with positive formal charge
Expected behavior The code was expected to work for a +1 formal charge molecule The IUPAC name of the molecule is (1S,3S)-3,5,12-trihydroxy-3-(hydroxyacetyl)-10-methoxy-6,11-dioxo-1,2,3,4,6,11-hexahydrotetracen-1-yl 3-azaniumyl-2,3,6-trideoxy-alpha-L-lyxo-hexopyranoside.
Canonical SMILES: "O[C@@H]1[C@@H](O[C@H](C[C@@H]1[NH3])O[C@H]1C[C@](O)(C(=O)CO)Cc2c(O)c3c(c(c12)O)C(=O)c1c(C3=O)cccc1OC)C"
Actual behavior There is a bug in molecule.py for a protonated molecule with +1 formal charge ....
mol = psiresp.Molecule.from_smiles("O[C@@H]1[C@@H](O[C@H](C[C@@H]1[NH3])O[C@H]1C[C@](O)(C(=O)CO)Cc2c(O)c3c(c(c12)O)C(=O)c1c(C3=O)cccc1OC)C", optimize_geometry=True)
File "/ceph/hpc/home/eumartino/.local/lib/python3.9/site-packages/psiresp/molecule.py", line 113, in from_smiles
rdmol = rdutils.rdmol_from_smiles(smiles, order_by_map_number=order_by_map_number)
File "/ceph/hpc/home/eumartino/.local/lib/python3.9/site-packages/psiresp/rdutils.py", line 38, in rdmol_from_smiles
rdmol = Chem.AddHs(Chem.MolFromSmiles(smiles, smiles_parser))
Boost.Python.ArgumentError: Python argument types in
rdkit.Chem.rdmolops.AddHs(NoneType)
did not match C++ signature:
AddHs(RDKit::ROMol mol, bool explicitOnly=False, bool addCoords=False, boost::python::api::object onlyOnAtoms=None, bool addResidueInfo=False)