epam / Indigo

Universal cheminformatics toolkit, utilities and database search tools
http://lifescience.opensource.epam.com
Apache License 2.0
314 stars 102 forks source link

Why is the code InChI=123 valid? #914

Closed digitalroll closed 1 year ago

digitalroll commented 1 year ago

I am sending a request in a container to the address /indigo/validate

{
  "data": {
    "type": "validation",
    "attributes": {
      "compound": {
        "structure": "InChI=123",
        "format": "auto"
      },
      "validations": [
        "stereo3D"
      ]
    }
  }
}

Why don't I get a message that this substance is incorrect?

Indigo/Bingo version Docker-container: epmlsop/indigo-service:1.8.2

Wadym commented 1 year ago

It has been corrected, and as soon as it is released, the user will receive a message "inchi-wrapper: Indigo-InChI: no structural data has been provided: (null). Code: -1."

Wadym commented 1 year ago

Proposed mapping of return codes from InChI library into Indigo's return messages:

`inchi_Ret_BREAK = -100 => throw an error: "Internal error parsing InChI string"

inchi_Ret_SKIP = -2, / not used in InChI library / => throw an error: "Internal error parsing InChI string"

inchi_Ret_EOF = -1, / no structural data has been provided / => throw an error: "Wrong InChI format"

inchi_Ret_OKAY = 0, / Success; no errors or warnings / => Just return a result, no additional steps are required

inchi_Ret_WARNING = 1, / Success; warning(s) issued / => Transmit a warning message from InChI library

inchi_Ret_ERROR = 2, / Error: no InChI has been created / => throw an error: "Internal error parsing InChI string"

inchi_Ret_FATAL = 3, / Severe error: no InChI has been created (typically, memory allocation failure) / => throw an error: "Internal error parsing InChI string"

inchi_Ret_UNKNOWN = 4, / Unknown program error / => throw an error: "Internal error parsing InChI string"

inchi_Ret_BUSY = 5 / Previuos call to InChI has not returned yet / => throw an error: "Internal error parsing InChI string"`