pátek 30. ledna 2009

Converting old InChI strings to the new standard InChI format

Today I was faced with a task of converting a list of InChI strings in the format used prior to the release of InChI 1.02 final to the new standard format.
Even though it would be a no-brainer to write a small script for OASA to do it, it seemed to me that the InChI software itself should allow something like this.
After some poking around the stdinchi-1 help messages, here is my solution:
cat test.inchi | stdinchi-1 -STDIO -InChI2Struct 2>/dev/null |
grep AuxInfo | stdinchi-1 -STDIO -InpAux 2>/dev/null |
grep InChI=
(the code was broken into multiple lines to display properly)

This command assumes you have the stdinchi-1 program in your path and that you are using a decent OS, with grep and cat commands available (or at least some approximation like Cygwin).
The input file test.inchi contains a list of InChIs - one per line. The output is in the same format.
The sequence of commands at first converts the old InChI into the AuxInfo format used by the InChI program, then uses it as input to generate a new standard InChI.
Hopefully someone would find this information useful.

1 komentář:

  1. beda blogging.. who would say that ? :)

    it seems that change of iupac inchi software from 1.02beta to 1.02 version is huger than one would expect.. should we consider cinchi (inchi <=1.02b) non-standard, thus obsolete ?