Skip to content

Commit defb4a6

Browse files
committed
Fix hybridisation change check.
1 parent 59d2b14 commit defb4a6

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/ghostly/_ghostly.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,14 +2227,15 @@ def _check_rotamer_anchors(
22272227

22282228
lam = int(is_lambda1)
22292229

2230-
# Link the molecule to the desired end state and convert to RDKit.
2231-
if is_lambda1:
2232-
end_state_mol = _morph.link_to_perturbed(mol)
2233-
else:
2234-
end_state_mol = _morph.link_to_reference(mol)
2235-
2230+
# Check hybridisation and ring membership at the state where the ghost is
2231+
# physically present. For bridges0, the ghost is physically present at
2232+
# lambda=1 (it is ghost/virtual at lambda=0). For bridges1, the ghost is
2233+
# physically present at lambda=0.
22362234
try:
2237-
rdmol = to_rdkit(end_state_mol)
2235+
if is_lambda1:
2236+
rdmol = to_rdkit(_morph.link_to_reference(mol))
2237+
else:
2238+
rdmol = to_rdkit(_morph.link_to_perturbed(mol))
22382239
except Exception as e:
22392240
_logger.warning(f"Failed to convert molecule to RDKit for rotamer check: {e}")
22402241
return mol

0 commit comments

Comments
 (0)