Hi,

Thanks for the update to the download script. I will incorporate your change 
into the svn. The change you made to CMakeLists.txt is not necessary. To turn 
on InChI support, you could just add `-DRDK_BUILD_INCHI_SUPPORT=ON` as an 
argument when you run the `cmake` command:

cmake .. -DRDK_BUILD_INCHI_SUPPORT=ON

The InChI wrapper supports all options recognized by the InChI software. 
Supported options are documented on page 22 of the official user guide found 
here. Using your example:

>>> AllChem.MolToInchi(m, '/DoNotAddH')
[09:36:55] WARNING: Accepted unusual valence(s): C(1); C(2)
'InChI=1S/C4/c1-3-4-2'

However, unlike SMILES, hydrogen layer is always explicit. So the above InChI 
string actually corresponds to a different molecule:

>>> m = Chem.MolFromInchi('InChI=1S/C4/c1-3-4-2')
>>> Chem.MolToSmiles(m)
'[C-]#CC#[CH2+]'

This is explained here, and I quote:

> Does InChI require all atoms including hydrogens?
> 
> While bond orders are not used in the representation, hydrogen atoms are 
> required. If there is ambiguity concerning the number of H-atoms in a 
> structure (i.e., its chemical formula is not clear), a reliable InChI cannot 
> be created.


So use these options with cautions.

Hope this helps.

Regards,
Eddie



On Jan 26, 2012, at 7:01 AM, JP wrote:

> I guess I should have just tried harder.
> 
> Anyway, attached please find the updated download-inchi.sh script which works 
> for me on Ubuntu 10.10, just in case anyone is interested.
> This script also downloads the InchI 1.04 source instead of 1.03.  (this file 
> should go in $RDKIT_SOURCE/External/INCHI-API)
> 
> There is a small twist on the instructions offered by the RDKit distro.
> 
> In $RDKIT_SOURCE/CMakeLists.txt, this has to be ON (rather then OFF) - line 22
> 
> option(RDK_BUILD_INCHI_SUPPORT "build the rdkit inchi wrapper" ON )
> 
> Then start from your build directory cmake .. and you should see something 
> like 
> 
> -- Could NOT find InChI in system locations  (missing:  INCHI_LIBRARY 
> INCHI_INCLUDE_DIR)
> -- Found InChI software locally
> 
> The last line means, the download worked and everything is fine.  make && 
> make install and from python:
> 
> >>> from rdkit import Chem
> >>> from rdkit.Chem import AllChem
> >>> AllChem.INCHI_AVAILABLE
> True
> >>> m = Chem.MolFromSmiles('CCCC')
> >>> m
> <rdkit.Chem.rdchem.Mol object at 0x1314de0>
> >>> AllChem.MolToInchi(m)
> 'InChI=1S/C4H10/c1-3-4-2/h3-4H2,1-2H3'
> 
> What I still cannot figure out is what "options" are allowed in the method 
> call.
> How do I get the InchI without the H layer for example?  Do I python split 
> the string?
> 
> Thanks
> JP
> 
> 
> 
> 
> 
> -
> Jean-Paul Ebejer
> Early Stage Researcher
> 
> 
> On 26 January 2012 14:05, JP <[email protected]> wrote:
> AllChem.INCHI_AVAILABLE
> 
> <download-inchi.sh>------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d_______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to