[Rdkit-devel] A new RDKit developer + InChI support
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2011-06-18 04:05:11
|
Dear all, Two things I'm really happy to announce: 1) A new developer on the open-source RDKit project: Eddie Cao. Eddie has done some great stuff with the RDKit at work, so it's very cool to have him contributing to the open-source project as well. 2) The addition of InChI support to the RDKit. This is another open-source contribution from Novartis. It is one of Eddie's projects. The RDKit InChI support is currently in a branch: https://rdkit.svn.sourceforge.net/svnroot/rdkit/branches/InChI_13June2011 It requires the InChI source code to be available. Instructions are here: http://rdkit.svn.sourceforge.net/viewvc/rdkit/branches/InChI_13June2011/External/INCHI-API/README?revision=1748 Once you have the code installed, you can convert molecules to InChI: In [2]: inchi = Chem.MolToInchi(Chem.MolFromSmiles('c1ccccc1C(=O)O')) In [3]: print inchi InChI=1S/C7H6O2/c8-7(9)6-4-2-1-3-5-6/h1-5H,(H,8,9) and then convert the InChIs to InChI keys: In [4]: print Chem.InchiToInchiKey(inchi) WPYMKLBDIGXBTP-UHFFFAOYSA-N There is also experimental and partial support for converting InChI back into a molecule: In [5]: m2 = Chem.MolFromInchi(inchi) In [6]: print Chem.MolToSmiles(m2) O=C(O)c1ccccc1 Note that this last bit is not something InChI is actually designed for, so it's probably not a good idea to rely on it. We'll merge the changes from the branch back onto the trunk early next week. In the meantime, any feedback/suggestions/comments is welcome. Best, -greg |