File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2227,14 +2227,18 @@ 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. Using the opposite state avoids false
2234+ # positives from transmuting bridge atoms: e.g. a nitrile carbon (SP,
2235+ # rigid) that becomes Cl (SP3) at the other end state would otherwise be
2236+ # incorrectly flagged as a rotatable bond.
22362237 try :
2237- rdmol = to_rdkit (end_state_mol )
2238+ if is_lambda1 :
2239+ rdmol = to_rdkit (_morph .link_to_reference (mol ))
2240+ else :
2241+ rdmol = to_rdkit (_morph .link_to_perturbed (mol ))
22382242 except Exception as e :
22392243 _logger .warning (f"Failed to convert molecule to RDKit for rotamer check: { e } " )
22402244 return mol
You can’t perform that action at this time.
0 commit comments