Hi Shaozhen,

If I understand the question correctly, you could try doing this by looking
for matches between the reactants and products of the two reactions using
substructure searches.

As is often the case, it's easier to show code than to explain, so here's a
gist showing how you could do this:
https://gist.github.com/greglandrum/863a3bdae766608fb55ccfe39ca46b9f

*Note* that this will not work for you with the current RDKit release
because of the bug in the way query-query matching is done that I found and
fixed this morning.
If you want to try it out, with the current release you can change your
reaction rules to use [#6:1] instead of [C:1]

Best,
-greg




On Thu, Feb 28, 2019 at 1:42 AM 丁邵珍 <164362...@qq.com> wrote:

> Hi
> Recently, I have some problems with rdkit.
>
> Smirks of reaction-A is
> CC(C)(CO)C(O)C(=O)NCCC(=O)O.O>>CC(C)(CO)C(O)C(=O)O.NCCC(=O)O
> Smirks of reaction-B is
> CC(=O)OCC1=C(C(=O)O)N2C(=O)C(NC(=O)CCCC(=O)O)C2SC1.O>>CC(=O)OCC1=C(C(=O)O)N2C(=O)C(N)C2SC1.O=C(O)CCCC(=O)O
>
> Rule of reaction-A is
> ([C:5]-[NH;+0:6]-[C;H0;+0:7](-[C:9])=[O:8]).([OH2;+0:16])>>([C:9]-[C;H0;+0:7](=[O:8])-[OH;+0:16]).([C:5]-[NH2;+0:6])
>
> Rule of reaction-B is
> ([C:17]-[NH;+0:18]-[C;H0;+0:19](-[C:21])=[O:20]).([OH2;+0:27])>>([C:17]-[NH2;+0:18]).([C:21]-[C;H0;+0:19](=[O:20])-[OH;+0:27])
> #radius = 1
>
> >>>  from rdkit.Chem import MolToSmiles,MolFromSmiles,AllChem
> >>> rule_rxn_a =
> AllChem.ReactionFromSmarts('([C:5]-[NH;+0:6]-[C;H0;+0:7](-[C:9])=[O:8]).([OH2;+0:16])>>([C:9]-[C;H0;+0:7](=[O:8])-[OH;+0:16]).
> ([C:5]-[NH2;+0:6])')
> >>> rule_rxn_b =
> AllChem.ReactionFromSmarts('([C:17]-[NH;+0:18]-[C;H0;+0:19](-[C:21])=[O:20]).([OH2;+0:27])>>([C:17]-[NH2;+0:18]).([C:21]-[C;H0
> ;+0:19](=[O:20])-[OH;+0:27])')
> >>> result_from_rule_a = [[MolToSmiles(k) for k in j] for j in
> rule_rxn_a.RunReactants([MolFromSmiles(i) for i in
> ['CC(C)(CO)C(O)C(=O)NCCC(=O)O
> ','O']])]
> >>> result_from_rule_a
> [['CC(C)(CO)C(O)C(=O)O', 'NCCC(=O)O']]
> >>> result_from_rule_b = [[MolToSmiles(k) for k in j] for j in
> rule_rxn_b.RunReactants([MolFromSmiles(i) for i in
> ['CC(C)(CO)C(O)C(=O)NCCC(=O)O
> ','O']])]
> >>> result_from_rule_b
> [['NCCC(=O)O', 'CC(C)(CO)C(O)C(=O)O']]
>
> For the same reactants, rule_rxn_a and rule_rxn_b can produce the same
> products.  We can also see that Rule-A and Rule-B are the same, except
> some atom labels.
> Are there some automatic methods to identify that  rule-a and rule-b are
> the same .
> I am looking forward your reply.
>
> Best Wishes
> Shaozhen
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to