-
Notifications
You must be signed in to change notification settings - Fork 238
Switch from OpenBabel to RDKit #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
All done via RDKit. Therefore, to generate a SMILES, or InChI from an RMG molecule, the molecule is first converted to a RDKit molecule.
Need to keep the spin multiplicity in mind, not 100% correct.
Seems to be only used in input files, which is nice, but not needed. If it becomes an important feature we might have to revisit this or write our own CML converter.
molDraw now uses rdkit to draw molecules. The rdkit branch was a start at removing openbabel and replacing it with rdkit.
We do the text manipulation (reading a .mol file, writing a .gjf) on our own now, instead of using OpenBabel. May be slightly more fussy about the input .mol file formatting, but as these are made automatically by RDKit it's unlikely they will change.
We do the text manipulation (reading a .mol file, writing a .mop) on our own now, instead of using OpenBabel. May be slightly more fussy about the input .mol file formatting, but as these are made automatically by RDKit it's unlikely they will change.
Without OpenBabel we cannot read CML. If we re-enable it, revert this commit.
I think this looks a little better, at least on the molecules I tested it on.
This reduces a lot of code repetition, although there were a couple of minor differences between the methods. Namely: 1) in the QM module we need to return a dictionary of mappings 2) in the QM module we need to keep hydrogen atoms
Add in references to SMARTS since we have that functionality.
It is used for conversation of SMILES notation to molecule, so RDKit is now needed instead of openbabel.
RDKit will print something out to STDErr explaining the mistake.
These are not well tested, especially the linux and windows ones, but it's a start.
I have got RDKit running on our webserver (was a bit tricky as we can't set the LD_LIBRARY_PATH of the Apache process here) so I think this fork is now ready to merge. Do you agree @connie? |
Any tips on how to set the LD_LIBRARY_PATH for the apache process? I'm trying to set up the dev website w the new branch right now. |
As you have root access to the server you have the option to edit the apache environment vars (/etc/apache2/envvars) and set it there. Failing that, I tried various CMake options, but couldn't get it to set or leave the RPATH intact when installing RDKit. I finally found a way, using patchelf (http://nixos.org/patchelf.html) to re-set the RPATH on each of the compiled library files. Something like:: $ cd $RDBASE and have finally got it working. |
Got our website working as well on http://dev.rmg.mit.edu I think we are ready to merge in this branch! |
This fork involves removing our dependence on OpenBabel and instead using RDKit.
RDKit is required already for any runs that use QM (highly recommended) and so we may as well make it a global requirement. Then, if we can remove needing OpenBabel as well, that cuts down our dependencies (and OpenBabel can be hard to install, with its Python bindings). RDKit is in Debian, so you should be able to just do
$ sudo apt-get install python-rdkit librdkit1 rdkit-data
on Ubuntu, and there's a nice homebrew recipe for MacOS X. See rdkit instructions for more help installing.This fork should solve a number of bugs:
It may also help in the future with
NB1. Anything that is read in using RDKit (eg. from an InChI or SMILES) is Kekulized before making the RMG molecule.
This means if you input benzene as
SMILES="c1ccccc1"
it will be equivalent toSMILES="C1=CC=CC=C1"
. This is how we fix issues #90 and #121, but it does make it harder if you do want aromatic things like benzene. If you wantB
type bonds, you have to input it as an adjacency list.What should happen is that RMG detects aromaticity correctly on its own, and it doesn't matter how you input it, but that's issue #106 and not addressed here!
NB2. Before pushing to the webserver, make sure you have installed RDkit.
This is not quite ready to merge, but should be soon.