Skip to content

Commit

Permalink
fixed pyridin-2-one std
Browse files Browse the repository at this point in the history
  • Loading branch information
stsouko committed Jul 15, 2021
1 parent 597c648 commit 6dbeacd
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions CGRtools/algorithms/standardize/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,11 +980,11 @@ def __standardize_rules():
rules.append((atoms, bonds, atom_fix, bonds_fix))

#
# N [N-]
# // /
# [C,N] = N >> C = [N+]
# \ \
# A A
# N [N-]
# // /
# [C,N] = N >> [C,N] = [N+]
# \ \
# A A
#
atoms = ({'atom': 'N', 'neighbors': 3}, {'atom': 'N', 'neighbors': (1, 2), 'hybridization': 2},
{'atom': ListElement(['C', 'N'])}, {'atom': 'A'})
Expand Down Expand Up @@ -1353,6 +1353,17 @@ def __standardize_rules():
bonds_fix = ((1, 2, 2), (1, 3, 1))
rules.append((atoms, bonds, atom_fix, bonds_fix))

#
# fix pyridin-2-one. note: order dependent
#
atoms = ({'atom': 'C', 'neighbors': 3}, {'atom': ListElement(['O', 'S']), 'neighbors': 1},
{'atom': 'N', 'neighbors': 2}, {'atom': 'A', 'hybridization': 2}, {'atom': 'A', 'hybridization': 2},
{'atom': 'A', 'hybridization': 2}, {'atom': 'A', 'hybridization': 2})
bonds = ((1, 2, 2), (1, 3, 1), (1, 4, 1), (3, 7, 1), (4, 5, (1, 2)), (5, 6, (1, 2)), (6, 7, (1, 2)))
atom_fix = {2: {'hybridization': 1}, 3: {'hybridization': 2}}
bonds_fix = ((1, 2, 1), (1, 3, 2))
rules.append((atoms, bonds, atom_fix, bonds_fix))

#
# A A
# | |
Expand Down

0 comments on commit 6dbeacd

Please sign in to comment.