@@ -592,7 +592,7 @@ std::vector<std::pair<std::string, std::string>> canonTautomerData{
592592 {" CNC(C)=O" , " CNC(C)=O" },
593593 {" S=C(N)N" , " NC(N)=S" },
594594 {" SC(N)=N" , " NC(N)=S" },
595- {" N=c1[nH]ccn(C)1" , " Cn1cc[nH]c1=N " },
595+ {" N=c1[nH]ccn(C)1" , " Cn1ccnc1N " },
596596 {" CN=c1[nH]cncc1" , " CNc1ccncn1" },
597597 {" Oc1cccc2ccncc12" , " Oc1cccc2ccncc12" },
598598 {" O=c1cccc2cc[nH]cc1-2" , " Oc1cccc2ccncc12" },
@@ -1330,6 +1330,30 @@ void testTautomerEnumeratorResult_const_iterator() {
13301330 }
13311331}
13321332
1333+ void testGithub3430 () {
1334+ BOOST_LOG (rdInfoLog) << " -----------------------\n testGithub3430"
1335+ << std::endl;
1336+ // The "guanidine terminal=N" rule should not apply to aromatic C
1337+ // as this balances the "aromatic C = exocyclic N" rule with no net
1338+ // effect on the score
1339+ std::vector<ROMOL_SPTR> mols{" Cc1ccc(NC(=O)N=c2[nH]c(C)cn2C)nc1" _smiles,
1340+ " CCCCC(=O)N=c1nc(C)c2ncn(C)c2[nH]1" _smiles,
1341+ " c12ccccc1[nH]c(=N)[nH]2" _smiles};
1342+ for (auto mol : mols) {
1343+ TEST_ASSERT (mol);
1344+ TautomerEnumerator te;
1345+ auto res = te.enumerate(*mol);
1346+ std::vector<int > scores;
1347+ scores.reserve (res.size ());
1348+ std::transform (res.begin (), res.end (), std::back_inserter (scores),
1349+ [](const ROMOL_SPTR &m) {
1350+ return TautomerScoringFunctions::scoreTautomer (*m);
1351+ });
1352+ std::sort (scores.begin (), scores.end (), std::greater<int >());
1353+ TEST_ASSERT (scores[1 ] < scores[0 ]);
1354+ }
1355+ }
1356+
13331357int main () {
13341358 RDLog::InitLogs ();
13351359#if 1
@@ -1346,5 +1370,6 @@ int main() {
13461370 testGithub2990 ();
13471371 testPickCanonicalCIPChangeOnChiralCenter ();
13481372 testTautomerEnumeratorResult_const_iterator ();
1373+ testGithub3430 ();
13491374 return 0 ;
13501375}
0 commit comments