Git Product home page Git Product logo

Comments (4)

ChayaSt avatar ChayaSt commented on June 11, 2024

Turns out it also flips map indices with the newer solution in openforcefield/cmiles#15

Example:
Mapped SMILES generated with cmiles:
'[H:7][C:1]1([C:2]([C:4]([C:5]([C:3]1([H:11])[H:12])([H:15])[C:6]([H:16])([H:17])[H:18])([H:13])[H:14])([H:9])[H:10])[H:8]'

Generating molecule from mapped SMILES generates this mapping:
image

Generating molecule from canonical SMILES, then canonicalizing the order and adding map indices as +1 of atom index (the way cmiles generates the mapped SMILES) generates this mapping:

image

@j-wags, this means that the logic I implemented here openforcefield/cmiles#15 fails for this molecule because when the molecule's atom order generated from the mapped SMILES is canonicalized, the map indices are not +1 the atom indices.
For this case, doing a substructure search does find the right ordering for the first match. It might be best to use the substructure search and find the match that corresponds to the mapped SMILES.

from openff-fragmenter.

jchodera avatar jchodera commented on June 11, 2024

This problem is likely unavoidable, which is why for fragmenter pipelines we always want to generate the molecule with the ordering we want and continue to use that ordering/mapping throughout the remainder of the pipeline.

from openff-fragmenter.

ChayaSt avatar ChayaSt commented on June 11, 2024

The problem arises from the way fragmenter was designed.
Fragmenter generates a list of fragments with cmiles IDs before the fragments have geometries as seen in this planning image:
image
The way to remedy this is to have cmiles only generate a mapped SMILES if the input molecule also has geometry. This will create the following changes in fragmenter and cmiles:

  1. fragment JSON will not have mapped SMILES
  2. cmiles will allow OEMol inputs (currently only isomeric explicit hydrogen SMILES or QCJSON are allowed)
  3. cmiles will only generate mapped SMILES if the input molecule has a geometry. It will first check that the molecule with geometry is in canonical order, and if not reorder it. It can be a good idea to have a strict flag here to allow mapped SMILES without geometries.

from openff-fragmenter.

ChayaSt avatar ChayaSt commented on June 11, 2024

This is not a concern because the since the atoms are symmetrical - it is the same molecule.

from openff-fragmenter.

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.