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