Skip to content

Commit

Permalink
Prevent the normalization of conjugated cations from applying to the …
Browse files Browse the repository at this point in the history
…oxime oxygen (#7403)
  • Loading branch information
rvianello authored and greglandrum committed May 2, 2024
1 parent 5f4c94a commit 53e279c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ std::vector<std::pair<std::string, std::string>> defaultNormalizations = {
// Conjugated cation rules taken from Francis Atkinson's standardiser. Those
// that can reduce aromaticity aren't included
{"Normalize 1,3 conjugated cation",
"[N,O;+0!H0:1]-[A:2]=[N!$(*~[N,O,P,S;-1]),O;+1H0:3]>>[*+1:1]=[*:2]-[*+0:3]"},
"[N,O!$(*N);+0!H0:1]-[A:2]=[N!$(*~[N,O,P,S;-1]),O;+1H0:3]>>[*+1:1]=[*:2]-[*+0:3]"},
{"Normalize 1,3 conjugated cation",
"[n;+0!H0:1]:[c:2]=[N!$(*~[N,O,P,S;-1]),O;+1H0:3]>>[*+1:1]:[*:2]-[*+0:3]"},
{"Normalize 1,5 conjugated cation",
"[N,O;+0!H0:1]-[A:2]=[A:3]-[A:4]=[N!$(*~[N,O,P,S;-1]),O;+1H0:5]>>[*+1:1]=[*:2]-[*:"
"[N,O!$(*N);+0!H0:1]-[A:2]=[A:3]-[A:4]=[N!$(*~[N,O,P,S;-1]),O;+1H0:5]>>[*+1:1]=[*:2]-[*:"
"3]=[*:4]-[*+0:5]"},
{"Normalize 1,5 conjugated cation",
"[n;+0!H0:1]:[a:2]:[a:3]:[c:4]=[N!$(*~[N,O,P,S;-1]),O;+1H0:5]>>[n+1:1]:[*:2]:[*:3]:"
Expand Down
4 changes: 4 additions & 0 deletions Code/GraphMol/MolStandardize/testNormalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,17 @@ void test1() {

// Test normalization of 1,3-conjugated cations
TEST_ASSERT(normalize("C[N+](C)=CN") == "CN(C)C=[NH2+]");
// verify it doesn't apply to oximes
TEST_ASSERT(normalize("C[N+](C)=NO") == "C[N+](C)=NO");
// verify it doesn't affect diazo groups
TEST_ASSERT(normalize("[N-]=[N+]=CN") == "[N-]=[N+]=CN");
// but still applies if the adjacent heteroatom is neutral
TEST_ASSERT(normalize("C[N+](N)=CN") == "CN(N)C=[NH2+]");

// Test normalization of 1,5-conjugated cations
TEST_ASSERT(normalize("C[N+](C)=CC=CN") == "CN(C)C=CC=[NH2+]");
// verify it doesn't apply to oximes
TEST_ASSERT(normalize("C[N+](C)=CC=NO") == "C[N+](C)=CC=NO");
// verify it doesn't affect diazo groups
TEST_ASSERT(normalize("[N-]=[N+]=CC=CN") == "[N-]=[N+]=CC=CN");
// but still applies if the adjacent heteroatom is neutral
Expand Down

0 comments on commit 53e279c

Please sign in to comment.