Skip to content

Commit

Permalink
Fix 6957 (SpacialScore) (#7000)
Browse files Browse the repository at this point in the history
  • Loading branch information
apahl committed Dec 22, 2023
1 parent 76dc14c commit cc36a86
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rdkit/Chem/SpacialScore.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
from rdkit import Chem

# import rdkit.Chem.Descriptors as Desc
from rdkit.Chem import rdmolops
from rdkit.Chem.ChemUtils.DescriptorUtilities import setDescriptorVersion
from collections import defaultdict

Expand All @@ -77,7 +78,9 @@ class _SpacialScore:
def __init__(self, mol, normalize=True):
if mol is None:
raise ValueError("No valid molecule object found.")
self.mol = mol # mol is supposed to be a valid RDKit Mol object
molCp = Chem.Mol(mol)
rdmolops.FindPotentialStereoBonds(molCp)
self.mol = molCp # mol is supposed to be a valid RDKit Mol object
self.normalize = normalize # if true nSPS, otherwise SPS
self.hyb_score = {}
self.stereo_score = {}
Expand Down
13 changes: 13 additions & 0 deletions rdkit/Chem/UnitTestSpacialScore.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@
("C1CCC1(C)C", 174, 29.00),
("O=C1COCCN1c4ccc(N3C[C@H](CNC(=O)c2ccc(Cl)s2)OC3=O)cc4", 563, 19.41),
("CC(C)CCC[C@@H](C)[C@H]3CC[C@H]4C2CC=C1C[C@@H](O)CC[C@]1(C)[C@H]2CC[C@]34C", 1303, 46.54),

('CC=CC', 38, 9.50),
('C/C=C/C', 38, 9.50),
('C=C1CCCCC1', 158, 22.57),
('C=C1CCCNC1', 158, 22.57),
('CC=C1CCCCC1', 167, 20.88),
('C/C=C\\1CCCCC1', 167, 20.88),
('CC=C1CCCNC1', 211, 26.38),
('CC=C(C1CCCNC1)C2CCCNC2', 485, 32.33),
('C/C=C(C1CCCNC1)/C2CCCNC2', 485, 32.33),
('CC=C(C1CCCNC1)C2CCCCN2', 511, 34.07),
('C/C=C(C1CCCNC1)/C2CCCCN2', 511, 34.07),
('CC1=CCCCC1', 151, 21.57),
]


Expand Down

0 comments on commit cc36a86

Please sign in to comment.