Skip to content

Commit

Permalink
Fix failure to parse large molecules
Browse files Browse the repository at this point in the history
Increased maxMatches in rdkit GetSubstructMatches to allow for larger molecules (maxMatches increased from 1000 to 10000.)
  • Loading branch information
wittregr committed Sep 20, 2022
1 parent d1d2270 commit 672b973
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion pgradd/RDkitWrapper/MolQuery.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,14 @@ def GetQueryMatches(self, mol, debug=0):
except Exception:
return tuple()
# Match mol substructure matches
rdkit_matches = mol.GetSubstructMatches(self.mol, uniquify=False)
maxMatches = 10000
rdkit_matches = mol.GetSubstructMatches(self.mol, uniquify=False,
maxMatches=maxMatches)
lenMatches = len(rdkit_matches)
if lenMatches == maxMatches:
print('\nMax RDKit substructure matches exceeded. All groups in',
'molecule may not have been determined.')
print(Chem.MolToSmiles(Chem.RemoveHs(mol)))
if debug:
print('structure matches:' + str(rdkit_matches))
# if no rdkit match
Expand Down
2 changes: 1 addition & 1 deletion pgradd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
# present, too:
#
name = 'pgradd'
__version__ = '1.0.0'
__version__ = '2.9'
#
####
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setuptools_info = {
'name': 'pgradd',
'version': '2.8',
'version': '2.9',
'author': 'Vlachos Research Group',
'author_email': '[email protected]',
'description': 'Python package implements the Group Additivity (GA) method for estimating thermodynamic properties',
Expand Down

0 comments on commit 672b973

Please sign in to comment.