Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataSGroups #18

Closed
reyh-EIS opened this issue Jan 14, 2022 · 2 comments
Closed

DataSGroups #18

reyh-EIS opened this issue Jan 14, 2022 · 2 comments

Comments

@reyh-EIS
Copy link

I have an issue with DataSGroups. In my environment (accessing inchi.dll via old C interface) I always get valid output. With jna-inchi, I get only valid output without DataSGroups. Is this an issue on my side or can you reproduce this behaviour?
test_IXA_DataSGroup.mol.txt
test_IXA.mol.txt

@dan2097
Copy link
Owner

dan2097 commented Jan 14, 2022

I can reproduce this using test_IXA_DataSGroup.mol.txt

JnaInchi.molToInchi(molStr).getMessage() gives the following message from the IXA API:
Could not interpret Molfile polymer data: M STY 1 1 DAT; M SAL 1 2 11 14; M SBL 1 1 15

In the C code for the IXA API, IXA_MOL_ReadMolfile calls

    mol_data = ReadMolfile( inp_file,
                            NULL,       /*    MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock, */
                            &OnlyCtab,
                            0, /* bGetOrigCoord ... NULL != szCoord*/
                            1, /* treat_polymers */
                            pseudos_allowed,
                            NULL, /* *pname */
                            0,  /* lname */
                            NULL,   /* *Id */
                            NULL,   /* pSdfLabel */
                            NULL,   /* pSdfValue */
                            &err, error_string,
                            0 /*bNoWarnings */ );

which is hard coded to attempt to read polymer data from the S-groups (the treat_polymers flag).

My initial thoughts are that, at least using the IXA API, that there isn't an elegant fix as IXA_MOL_ReadMolfile doesn't give any control of the parameters it's sending to ReadMolfile. I'm slightly surprised that an uninterpretable S-group is treatd as an error rather than a warning.

@dan2097
Copy link
Owner

dan2097 commented Jan 14, 2022

I think it would be quite straightforward for me to use MakeINCHIFromMolfileText from the "classic" API instead, just did a quick prototype.

Am I right in saying that the expected behaviour is, for the default InchiOptions to give:
InChI=1S/C21H19NO3/c1-24-21(23)15-9-6-14(7-10-15)8-11-20-22-18-12-16-4-2-3-5-17(16)13-19(18)25-20/h6-13H,2-5H2,1H3/b11-8+
(with a status of Warning with the explanation that polymer data was ignored)

Adding the flag InchiFlag.Polymers gives no InChI, a status of Error and the following explanation:
Error 65 (no InChI; Could not interpret Molfile polymer data: M STY 1 1 DAT; M SAL 1 2 11 14; M SBL 1 1 15) inp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants