metamolecular / inchi-js

InChI for the Browser
http://metamolecular.com/inchi-js
Other
14 stars 5 forks source link

MOL file bond types aromatic single (6) and aromatic double (7) not recognized #2

Open BobHanson opened 8 years ago

BobHanson commented 8 years ago

MOL files created using some software use the "single or aromatic" (6) and "double or aromatic" (7) bond types as described in http://accelrys.com/products/informatics/cheminformatics/ctfile-formats/no-fee.php

The presence of these bond types causes a loading error:

Molfile is invalid.

But these would be easily interpreted as "single" and "double", respectively. Suggestion is to read bond type 6 as single and bond type 7 as double

rapodaca commented 8 years ago

The error is propagating from InChI itself, which returns a molecule with no atoms:

https://github.com/metamolecular/inchi-js/blob/master/src/inchi.c#L34

The aromatic bond are only valid for queries. As the CTfile Formats documentation states in the Bond Block table:

Types 4 through 8 are for queries only.

BobHanson commented 8 years ago

Isn't a lot of what this is about "queries"? I understand you are saying that is more of a "SMARTS" version of a mol file, not SMILES. But they do exist, and it seems to me a very simple request.

On Wed, Mar 9, 2016 at 12:22 PM, Richard Apodaca notifications@github.com wrote:

The error is propagating from InChI itself, which returns a molecule with no atoms:

https://github.com/metamolecular/inchi-js/blob/master/src/inchi.c#L34

The aromatic bond are only valid for queries. As the CTfile Formats documentation states in the Bond Block table:

Types 4 through 8 are for queries only.

— Reply to this email directly or view it on GitHub https://github.com/metamolecular/inchi-js/issues/2#issuecomment-194435772 .

Robert M. Hanson Larson-Anderson Professor of Chemistry Chair, Department of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr

If nature does not answer first what we want, it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

rapodaca commented 8 years ago

Although the request is simple, the solution is not.

InChI.js is the actual InChI C library, compiled to JavaScript. The C file I linked is a thin wrapper that the JavaScript runtime communicates with. All InChI.js is doing is handling an error propagated from the InChI C library.

The InChI team might be in a position to address your request, though.

BobHanson commented 8 years ago

Sure, that makes sense. OK.

On Wed, Mar 9, 2016 at 1:12 PM, Richard Apodaca notifications@github.com wrote:

Although the request is simple, the solution is not.

InChI.js is the actual InChI C library, compiled to JavaScript. The C file I linked is a thin wrapper that the JavaScript runtime communicates with. All InChI.js is doing is handling an error propagated from the InChI C library.

The InChI team might be in a position to address your request, though.

— Reply to this email directly or view it on GitHub https://github.com/metamolecular/inchi-js/issues/2#issuecomment-194457748 .

Robert M. Hanson Larson-Anderson Professor of Chemistry Chair, Department of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr

If nature does not answer first what we want, it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900