InchiKey and options

User dfeb81947d

02-10-2012 14:18:30

Dear support,


I tried to export molcule using


public static String toInchiKey(Molecule m, String options) throws IOException {
        return MolExporter.exportToFormat(m, "inchikey:"+options);
}

But when using "SNon", "SRel", "SAbs", "SUCF", "ChiralFlagOn", ... and even combinations if : "SUCF,ChiralFlagOn", I don't find any difference between calculated InChiKey between the two molecules in SDFile attached. They are the same, the only difference is one is without chiral flag, and the other with chiral flag. I thought that using options on stereochemistry for chiral flag and absolute stereo InChiKey would be different.


Didi I do something wrong? Do I need to use Inchi 1.04 instead of Inchi 1.03?

I'm using JChem Base 5.11.1 with JDK 1.6.


Thank you very much for your help


Kind Regards,


Jacques

User dfeb81947d

02-10-2012 15:06:52

By the way, I tested the calculation of inchikey using IUPAC GUI for inchi 1.03.
I have the same the same inchikey using Absolute stereo without flag:

But with calculation set by flag I have
for the first molecule: IMYHGORQCPYVBZ-QTZDTBTRNA-N
for the second: IMYHGORQCPYVBZ-NBGIEHNGNA-N


is the parameter to set chiral flag into account for stereo is "SUCF"?

If I compare the two inchi calculated with SUCF options they are the same.


I think I"m doing something wrong with those parameters. I you ever have an hint for me I'd be really glad.


 


Thank you again


Kind Regards,


Jacques

ChemAxon d26931946c

03-10-2012 13:06:23

Hi Jacques,


I think there are some issues in our documentation and in our inch-export too.


If you use the option SUCF, our documetaion suggests that absolute stereo will be taken into account, but we just pass this otpion to JNI-Inchi. According to JNI-Inchi's documentation the SUCF export option is used to mark the molecule as absolute stereo.


So if you generate the inchikey of a molecule with the SUCF option the result will include the absolute stereo even if the molecule don't.


As long as we don't fix this problem you may use this workaround:


 


public static String toInchiKey(Molecule m, String options) throws IOException {
  
String modifiedOpts = m.isAbsoluteStereo()? "SUCF,"+options , options;  
    
return MolExporter.exportToFormat(m, "inchikey:"+modifiedOpts);

}

 


 


Regards, 


Peter

User dfeb81947d

03-10-2012 14:31:20

Hello Peter,


I didn't understand clearly this part of the documentation, but with your explanation it makes sense.


This workaround is fine for me. But there's  something I want to be sure of: I'm not sure what kind of options I need to activate to obtain the inchikeys as in IUPAC's program.


See attached SDFile for example.


Using IUPAC program I have:


Input_File: "D:\RUBY\inchikey_test2.sdf"
Structure: 1. ID=105940 => InChIKey=IMYHGORQCPYVBZ-QTZDTBTRNA-N
Structure: 2. ID=230914 => InChIKey=IMYHGORQCPYVBZ-NLFFAJNJNA-N
Structure: 3. ID=230915 => InChIKey=IMYHGORQCPYVBZ-NBGIEHNGNA-N


If I use your workaround with only SUCF :MolExporter.exportToFormat(m, m.isAbsStereo()? "inchikey:SUCF" : "inchikey"))


it works with the last sdfile (two same structure but one with chiral flag), but with this example :
Structure: 1. ID=105940 => InChIKey=IMYHGORQCPYVBZ-NBGIEHNGSA-N
Structure: 2. ID=230914 => InChIKey=IMYHGORQCPYVBZ-QTZDTBTRNA-N
Structure: 3. ID=230915 => InChIKey=IMYHGORQCPYVBZ-QTZDTBTRNA-N


Structure 2 and 3 have the same inchikey but one is RS and the other SR


If I use MolExporter.exportToFormat(m, m.isAbsStereo()? "inchikey:SUCF,ChiralFlagOn" : "inchikey")


I'm back to the problem I explained first with same molecule one with chiral flag and the other without having same inchi key


Structure: 1. ID=105940 => InChIKey=IMYHGORQCPYVBZ-NBGIEHNGSA-N
Structure: 2. ID=230914 => InChIKey=IMYHGORQCPYVBZ-NLFFAJNJNA-N
Structure: 3. ID=230915 => InChIKey=IMYHGORQCPYVBZ-NBGIEHNGNA-N


And with ChiralFlagOn parameter (MolExporter.exportToFormat(m, m.isAbsStereo()? "inchikey:SUCF, ChiralFlagOn" : "inchikey: ChiralFlagOn")), I obtain:

Structure: 1. ID=105940 => InChIKey=IMYHGORQCPYVBZ-NBGIEHNGSA-N
Structure: 2. ID=230914 => InChIKey=IMYHGORQCPYVBZ-NLFFAJNJNA-N
Structure: 3. ID=230915 => InChIKey=IMYHGORQCPYVBZ-NBGIEHNGNA-N


With MolExporter.exportToFormat(m, m.isAbsStereo()? "inchikey:SUCF, ChiralFlagOn" : "inchikey:SUCF")


I obtain the same things as IUPAC program:


Structure: 1. ID=105940 => InChIKey=IMYHGORQCPYVBZ-QTZDTBTRNA-N
Structure: 2. ID=230914 => InChIKey=IMYHGORQCPYVBZ-NLFFAJNJNA-N
Structure: 3. ID=230915 => InChIKey=IMYHGORQCPYVBZ-NBGIEHNGNA-N


So the workaround is as follow MolExporter.exportToFormat(m, m.isAbsStereo()? "inchikey:SUCF, ChiralFlagOn" : "inchikey:SUCF")


Can you confirm it?


Thank you so far for your help, it really helped me.


Kind Regards,


Jacques

ChemAxon d26931946c

04-10-2012 11:59:43

Hi Jacques,


Thanks for the investigation.


The documentation of JNI-Inchi is also a bit confusing, so I've read the documentation on www.inchi-trust.org, because they say the options will have the same effect. The original IUPAC program is converting from file to Inchi, and there the SUCF option meant that "Use Chiral Flag in MOL/SD file record", if this option is absent it uses absolute stereo by default. 


I've tried it in several molecules and your workaround seem to be good. 


The only thing I don't understand is why the second(R/S) and the third(S/R) structures have the same key without the SUCF option. 


Thanks for the report, we will have a closer look at our Inchi export.


Regards, 


Peter

User dfeb81947d

04-10-2012 17:13:41

Dear Peter,


I checked 11 stereoisomers using both JChem API calculation and IUPAC software (see files attached).


SDF contains structures of the stereoisomers and inchikey calculated using the following code:


INCHIKEY_ABSOLUTE = MolExporter.exportToFormat(m, "inchikey");
INCHIKEY_CHIRAL_FLAG = MolExporter.exportToFormat(m, (m.isAbsStereo()? "inchikey:SUCF,ChiralFlagOn" : "inchikey:SUCF"));


Results are the same when calculated using IUPAC 1.03 software.


I believe that the reason why, when using chiral flag for stereo is as follow: RR (no chiral) and SS (no chiral have the same inchikey,  and RS (no chiral)  and SR (no chiral) have also the same inchi is that when using chiral flag hte program considered that only molecule with chiral flag are unique. And molecule with stereo but no chiral flag are considered as mix of enantiomers. so both molecule enantiomers have the same inchi representation.


I hope this help.


Thank you very much for your help


Kind Regards,


Jacques

ChemAxon d26931946c

05-10-2012 08:33:50

Hello Jacques,


Thanks for the information, I think now I understand how it works.


Kind regards, 


Peter



ChemAxon d26931946c

06-03-2013 14:14:06

Dear Jacques,


We managed to fix this issue, InChi and InChiKey will contain the absolute stereo flag according to the Molecule.isAbsoluteStereo() call.


The fix will be available in 5.12.1.


 


Best Regards,


Peter