Comments (5)
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.
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.
Thanks for looking into this. I am now changing my workflow towards Molecule.from_qcschema
.
from cmiles.
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.
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)
- Spurious missing stereo warnings
- Fix `has_stereo_defined` for rdkit HOT 1
- Detect overdefined stereo
- conda package HOT 1
- cmiles.utils.to_canonical_label failure HOT 2
- Could get_molecule_ids() support OEMol and RDMol input?
- Standardize molecule support through openforcefield.topology.Molecule?
- Generating a QCSchema JSON from an OEMol?
- WARNING: Proton(s) added/removed
- Generating CMILES ids for an OEMol?
- Hydrogens move and stereochemistry flip when reading qcschema molecule HOT 1
- Failing tests HOT 3
- Better parsing of molecule inputs
- Ideas for future refactor
- Discrepancies in re-generated reference data HOT 1
- How to update reference files for new versions of RDKit
- RDKit 2020.09.3 changes
- OpenEye toolkits 2020.2.0 changes
- Problem when loading TorsionDrive qcmol from QCA HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmiles.