Skip to content

Support default InChI (Key) generation #3524

@BrillBay

Description

@BrillBay

Background
The current Indigo-InChI support implements some magical adjustments to the options used by the generator. In fact, the code does something like this:

   iterate the all stereocenters
       if (type == MoleculeStereocenters::ATOM_AND)
            setOptions("/SRac");
        else if (type == MoleculeStereocenters::ATOM_OR)
            setOptions("/SRel");

This setOptions changes the options for all follow-up calls to the InChI with other molecules.

This has two implications:

  • Depending on the order of molecules used to call the generator, the result might differ for specific molecules (if you had already called it with some stereo before or not). You can circumvent that by calling resetOptions() before each call.
  • There is no chance to really control the generator:
    • No chance to force the generation of standard InChIs.
    • No chance to provide other options.
      This is a major problem for us because we are working with molecules from different systems that have already assigned standard InChI keys. There is no way to compare this with the InChI key we have generated using Indigo.

From my understanding, InChI (keys) are designed to be system-independent, and this magical adjustment of the options is exactly the opposite.

Solution
Provide a new method (or possibly a parameter to the existing one) to allow for exact control of all options to be used.

Alternatives
Add a way to set the options to be used globally.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions