GithubHelp home page GithubHelp logo

Comments (4)

pschwllr avatar pschwllr commented on May 23, 2024 3

You're right - the mapping is wrong in this specific case. The beauty of the approach is that it learned to map reactions without unsupervised (without having labelled examples). That said, it is not straightforward to improve and correct the model. Reporting wrongly mapped reactions like you just did is very helpful, as we will consider them for the next RXNMapper version.

Let me show explain to you what happens by looking at the attention weights on the RXNMapper Demo. If we look at the product atoms 1 and 2, and their attention weights towards the reactant atoms:
image
Attention of product atom 1.

image

_Attention of product atom 2._

We see that atom 2 has the stronger attention weight, and will be mapped first to the wrong reactant atom.

One reason for this attention pattern is how the SMILES are canonicalised for this specific case. If we look at the wrongly mapped part of the SMILES, we have the following ... C 1 = C ... >> C 1 = C ....

This is incorrectly mapped by RXNMapper to ... [C:1]1=[CH:2] ... >> [C:1]1=[CH:2] .... Due to the canonicalisation, in this case, the two carbon in the SMILES switched side around the 1 =.
The correct mapping would be ... [C:2]1=[CH:1] ... >> [C:1]1=[CH:2] ....

Although your example is straightforward to map for a human, it is challenging for an AI model that sees the molecules only as SMILES strings.

from rxnmapper.

pschwllr avatar pschwllr commented on May 23, 2024 1

With the default parameters, RXNMapper will map all product atoms iteratively (as we assume that all atoms are present on the precursors side). The problem is that the last product oxygen atom to map overwrites another previously mapped oxygen atom, as you omitted H2O in the reaction. If you add the H2O, I guess it maps it correctly:

image

from rxnmapper.

feiranl avatar feiranl commented on May 23, 2024

Hi, I also want to report another case which is wrongly mapped.
rxn = L-glutamine <=> NH4(+) + L-glutamate
Smiles = NC(=O)CC[C@H]([NH3+])C(=O)[O-]>>[NH4+].[NH3+][C@@H](CCC(=O)[O-])C(=O)[O-]
mapped rxn = [NH3+:1][C@@H:2]([CH2:3][CH2:4][C:5](=[O:6])[NH2:11])[C:8](=[O:7])[O-:10]>>[NH3+:1][C@@H:2]([CH2:3][CH2:4][C:5](=[O:6])[O-:7])[C:8](=[O:9])[O-:10].[NH4+:11]
image
The change of O7 is not correct. The H2O is omitted in the reaction.

from rxnmapper.

avaucher avatar avaucher commented on May 23, 2024

Closing due to inactivity.

from rxnmapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.