Open janholstjensen opened 2 years ago
Once this is implemented, will there be an API entry point? In other words, will a method be available that allows to provide already-calculated component InChIs to the native RInChI library and get back the RInChI and the three different keys? And will there also be support for AuxInfo?
There already sort-of-is an entry point for that in the C API, although I will grant that it is not obvious and you will currently have to first stitch together an RInChI string from your pre-calculated InChIs.
Have a look at the Python script src/rinchi_lib/test.py. The inchis_from_rinchi() function splits an RInChI string (and optionally RAuxInfo) and loads the InChIs/AuxInfos of the RInChI into the RInChI reaction components. It does not return keys, but a list of component InChIs as text. At least it will validate that you have built the RInChI input correctly.
To get the keys you can use rinchikey_from_rinchi() - now that you have the RInChI string - to produce the desired key. See the end of test.py for example usage.
Okay, thank you for the clarification. I'll have a look 👀
I guess what I would ideally be looking for is handing over a bunch of InChIs that have a designated reaction component role and optionally their AuxInfos and getting back the RInChI and the RAuxInfo if AuxInfos were provided.
So, adding something like this to the C API would work, right ?
rinchi_from_inchis(reactant_inchis, product_inchis, agent_inchis)
where the ..._inchis parameters could be strings with linefeed-delimited InChI strings; either
InChI #1
InChI #2
or
InChI #1
AuxInfo #1
InChI #2
AuxInfo #2
Yes, that sounds good to me! 😃
OK, I'll see what I can do to get that in. 😃
OK, I'll see what I can do to get that in. 😃
Thank you, much appreciated.
Issue #17 has been created to implement the suggested API function.
Having the ability to not link any InChI code into RInChI removes potential issues with symbol clashes and reduces the risk of other build issues.
To make this work, the end user of RInChI would have to provide already-calculated component InChI-s to RInChI, and the current RInChI 1.0 already supports that. So this is mainly a build configuration that should be offered.