Code Monkey home page Code Monkey logo

Comments (6)

mattwthompson avatar mattwthompson commented on August 26, 2024 1

Wow - nice catch. This causes tons of problems in the toolkit, actually. It's easy to find separate cases of the toolkit ignoring the isotopes and choking on them:

>>> [atom.mass.m for atom in Molecule.from_smiles("[2H]O[2H]").atoms]
[1.007947, 15.99943, 1.007947]
>>> Molecule.from_smiles("[13C]")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mattthompson/mambaforge/envs/smirnoff-plugins-test/lib/python3.9/site-packages/openff/toolkit/topology/molecule.py", line 1807, in from_smiles
    molecule = toolkit_registry.call(
  File "/Users/mattthompson/mambaforge/envs/smirnoff-plugins-test/lib/python3.9/site-packages/openff/toolkit/utils/toolkit_registry.py", line 356, in call
    raise e
  File "/Users/mattthompson/mambaforge/envs/smirnoff-plugins-test/lib/python3.9/site-packages/openff/toolkit/utils/toolkit_registry.py", line 352, in call
    return method(*args, **kwargs)
  File "/Users/mattthompson/mambaforge/envs/smirnoff-plugins-test/lib/python3.9/site-packages/openff/toolkit/utils/rdkit_wrapper.py", line 1035, in from_smiles
    molecule = self.from_rdkit(
  File "/Users/mattthompson/mambaforge/envs/smirnoff-plugins-test/lib/python3.9/site-packages/openff/toolkit/utils/rdkit_wrapper.py", line 1756, in from_rdkit
    raise RadicalsNotSupportedError(
openff.toolkit.utils.exceptions.RadicalsNotSupportedError: The OpenFF Toolkit does not currently support parsing molecules with S- and P-block radicals. Found 4 radical electrons on molecule [13C].

Prior to having thought about this much, I wonder if rolling a custom solution here would be easier than getting isotope support into the toolkit.

Erroring out if an isotope is passed through would be an improvement in the sense that unsupported behavior (even unintentionally unsupported) is handled more gracefully, but I figure that won't actually be an improvement in getting research done.

from openff-evaluator.

jthorton avatar jthorton commented on August 26, 2024 1

I wonder if rolling a custom solution here would be easier than getting isotope support into the toolkit.

I agree that a custom solution here might be easier, I wonder if all smirks matching might be better done using rdkit directly to save time as the current workflow as I understand it goes smiles -> parse with rdkit/openeye -> convert to off-Mol -> substructure search with rdkit/openeye. When filtering 70k records in thermoML this could save some time and give the correct behaviour.

from openff-evaluator.

mattwthompson avatar mattwthompson commented on August 26, 2024 1

Mostly resolved with #503 / release v0.4.3. There might be performance optimizations left on the table - didn't have the time to look deep enough into that.

from openff-evaluator.

mattwthompson avatar mattwthompson commented on August 26, 2024

openforcefield/openff-toolkit#974

from openff-evaluator.

mattwthompson avatar mattwthompson commented on August 26, 2024

I was also a bit worried that Evaluator didn't depend on RDKit but I checked and it's explicitly listed; I guess the -base trick is just used to avoid AmberTools.

from openff-evaluator.

mattwthompson avatar mattwthompson commented on August 26, 2024

Isotope filtering

from openff-evaluator.

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.