GithubHelp home page GithubHelp logo

Comments (5)

wutobias avatar wutobias commented on August 17, 2024

Found this PR that seems to target the same issue: #37
Not sure about the details of this particular solution but it seems that the error message from rdkit is parsed in order to identify the offending N atom. This seems to be fragile, since rdkit might change the formatting of error messages in the future. The above solution explicitly counts the number of bonded neighbors, which should be more stable.

from cmiles.

j-wags avatar j-wags commented on August 17, 2024

Sorry for the delay on this -- CMILES is effectively deprecated, though we've done a really bad job of communicating it. Its functionality has been migrated to the actively-supported OpenFF toolkit and QCSubmit packages.

QCA molecules submitted by OpenFF now all have CMILES records attached to them, which explicitly contain the connection graph (including things like bond order and formal charge). So we shouldn't need to do any guessing about nitrogens.

We need to put out a migration guide for users for how to do all their favorite CMILES workflows using these two other tools. In the meantime, here's a little code snippet I put together to pull down initial and final molecules using the OpenFF toolkit. I think that there's a more streamlined pathway either already available in QCSubmit, or that will be available in the next release.

from openff.toolkit.topology import Molecule
import pint
from simtk.openmm import unit 
import numpy as np

import qcportal as ptl
from openff.toolkit.topology import Molecule

punit = pint.UnitRegistry()

# Some stuff I scapped together form other code bits. I don't understand how this works. 
client= ptl.FractalClient()
ds = client.get_collection('OptimizationDataset', "FDA Optimization Dataset 1")
entry = ds.get_entry('C[NH2+]C[C@@H](c1ccc(c(c1)O)O)O-0')
qcrecord   = ds.get_record("C[NH2+]C[C@@H](c1ccc(c(c1)O)O)O-0", 
                           specification="default")

initial_qcmol = client.query_molecules(entry.initial_molecule)[0]
final_qcmol = qcrecord.get_final_molecule()

# set conformer qcmol geometry
initial_geometry = unit.Quantity(
        np.array(initial_qcmol.geometry, float), unit.bohr
    )
final_geometry = unit.Quantity(
        np.array(final_qcmol.geometry, float), unit.bohr
    )



# Make a single mol with both conformers so we can visualize it in nglview
combined_offmol = Molecule.from_qcschema(entry)
combined_offmol.add_conformer(initial_geometry.in_units_of(unit.angstrom))
combined_offmol.add_conformer(final_geometry.in_units_of(unit.angstrom))

# Make OE and RDKit mols from this combined offmol
oemol = combined_offmol.to_openeye()
rdmol = combined_offmol.to_rdkit()

combined_offmol.visualize(backend='nglview')

from cmiles.

wutobias avatar wutobias commented on August 17, 2024

Thanks for looking into this. I am now changing my workflow towards Molecule.from_qcschema.

from cmiles.

jchodera avatar jchodera commented on August 17, 2024

Sorry for the delay on this -- CMILES is effectively deprecated, though we've done a really bad job of communicating it

@j-wags : Would it make sense to add a note at the top of the https://github.com/openforcefield/cmiles repo README to communicate this?

from cmiles.

j-wags avatar j-wags commented on August 17, 2024

Good call. I've just added a notice and some references to new API points to the top of the README.

from cmiles.

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.