I encountered an issue with InChI API when processing PubChem Compound 10775979. Using the SDF downloaded from PubChem website and the InChI Windows binary distribution, I was able to get the following InChI string:
InChI=1S/C11H11N3O3/c1-6-4-3-5-8(7(6)2)14-9(10(12)15)11(16)17-13-14/h3-5H,1-2H3,(H2-,12,13,15,16)
This is consistent with the InChI string embedded in the PubChem SDF.
I then use the C++ program [source attached below] to test whether InChI API was able to correctly parse the InChI string into a molecule and then get back the same InChI string. The program calls GetStructFromINCHI with the above InChI string, and gets back a molecule structure. It then passes this structure to the GetINCHI function get back an InChI string. This round trip to the InChI API should give the same InChI as above. Unfortunately, it alters the InChI string slightly and gives the following:
InChI=1S/C11H11N3O3/c1-6-4-3-5-8(7(6)2)14-9(10(12)15)11(16)17-13-14/h3-5H,1-2H3,(H2-,12,15,16)
The C++ program is listed below:
// InChI round trip test
#include <inchi_api.h>
#include <iostream>
int main()
{
// inchi to mol
char inchi[] = "InChI=1S/C11H11N3O3/c1-6-4-3-5-8(7(6)2)14-9(10(12)15)11(16)17-13-14/h3-5H,1-2H3,(H2-,12,13,15,16)";
inchi_InputINCHI inchiInput;
inchiInput.szInChI = inchi;
inchiInput.szOptions = NULL;
// output structure
inchi_OutputStruct inchiOutput;
// DLL call
GetStructFromINCHI(&inchiInput, &inchiOutput);
// mol to inchi
// create input
inchi_Input input;
input.atom = inchiOutput.atom;
input.stereo0D = inchiOutput.stereo0D;
input.szOptions = NULL;
input.num_atoms = inchiOutput.num_atoms;
input.num_stereo0D = inchiOutput.num_stereo0D;
// create output
inchi_Output output;
// call DLL
GetINCHI(&input, &output);
std::cout << output.szInChI << std::endl;
return 0;
}