Skip to content
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

Switch from OpenBabel to RDKit #135

Closed
wants to merge 30 commits into from
Closed

Switch from OpenBabel to RDKit #135

wants to merge 30 commits into from

Conversation

rwest
Copy link
Member

@rwest rwest commented Jul 31, 2013

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 to SMILES="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 want B 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.

pierrelb and others added 25 commits July 9, 2013 15:29
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.
These are not well tested, especially the linux and windows ones,
but it's a start.
@rwest
Copy link
Member Author

rwest commented Aug 2, 2013

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?

@connie
Copy link
Member

connie commented Aug 3, 2013

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.

@rwest
Copy link
Member Author

rwest commented Aug 3, 2013

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
$ find . -name *.so -exec patchelf --set-rpath $RDBASE/lib {} ;

and have finally got it working.

@connie
Copy link
Member

connie commented Aug 5, 2013

Got our website working as well on http://dev.rmg.mit.edu

I think we are ready to merge in this branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants