From c9888c2b79888ba1a7a6288af547c97074c26e74 Mon Sep 17 00:00:00 2001 From: Alain Vaucher Date: Thu, 18 Jul 2024 22:11:59 +0200 Subject: [PATCH] Add test for reactions with dative bonds (#53) --- tests/test_mapper.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_mapper.py b/tests/test_mapper.py index a8083b3..b09d374 100644 --- a/tests/test_mapper.py +++ b/tests/test_mapper.py @@ -108,3 +108,16 @@ def test_multiple_products(rxn_mapper: RXNMapper): results = rxn_mapper.get_attention_guided_atom_maps(rxns) assert_correct_maps(results, expected) + + +def test_reaction_with_dative_bond(rxn_mapper: RXNMapper): + rxns = ["COC(=O)CCBr.O=C[O-]->[K+]>>COC(=O)CCOC(=O)C"] + expected = [ + { + "mapped_rxn": "[CH3:1][O:2][C:3](=[O:4])[CH2:5][CH2:6]Br.[O:9]=[CH:8][O-:7]->[K+]>>[CH3:1][O:2][C:3](=[O:4])[CH2:5][CH2:6][O:7][C:8](=[O:9])[CH3:10]", + "confidence": 0.9322116305783666, + } + ] + + results = rxn_mapper.get_attention_guided_atom_maps(rxns, canonicalize_rxns=False) + assert_correct_maps(results, expected)