Skip to content

Commit

Permalink
Fix: Tricky single-atom stereocenter corrections
Browse files Browse the repository at this point in the history
When there is just one atom stereocenter, we can avoid tricky stereo
corrections by simply reflecting.
  • Loading branch information
avcopan committed Oct 25, 2024
1 parent ce8071c commit e2ca25b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions automol/graph/base/_11stereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,13 @@ def stereo_corrected_geometry(
geo = geometry_correct_linear_vinyls(gra, geo, excl_keys=excl_keys)
geo = geometry_correct_nonplanar_pi_bonds(gra, geo, excl_keys=excl_keys)

# 2. If there is a single, wrong atom stereocenter, simply reflect the geometry
if len(atm_keys) == 1:
atm_key, = atm_keys
curr_par = geometry_atom_parity(gra, geo, atm_key)
if curr_par != par_dct[atm_key]:
geo = geom_base.reflect_coordinates(geo)

# 3. Loop over stereo-sites making corrections where needed
for bnd_key in bnd_keys:
curr_par = geometry_bond_parity(gra, geo, bnd_key)
Expand Down

0 comments on commit e2ca25b

Please sign in to comment.