Hi Nick,

Sorry, no - there is no implementation of the InChI canonicalization
routine in the CDK (that I know of!) that doesn't involve actually
generating the InChI using the c-libraries.

The best you can get is to do something like:

    public int[] getCanonicalPermutation(IAtomContainer container) {
        int atomCount = container.getAtomCount();
        try {
            CDKInChI cdkInchi = new CDKInChI();
            List<INCHI_OPTION> options = new ArrayList<INCHI_OPTION>();
            options.add(INCHI_OPTION.DoNotAddH);
            cdkInchi.getInChI(container, options);   // do nothing with it!
            String auxInfo = cdkInchi.getAuxinfo();
            int[] permutation = InchiReader.getPermutationFromAuxInfo(auxInfo);
            int[] invP = new int[atomCount];
            for (int i = 0; i < atomCount; i++) {
                invP[permutation[i]] = i;
            }
            return invP;
        } catch (CDKException c) {
            int[] permutation = new int[atomCount];
            for (int index = 0; index < atomCount; index++) {
                permutation[index] = index;
            }
            return permutation;
        }
    }

which will give you a permutation of the atoms according to the inchi.
Of course, it generates an inchi at the same time...

gilleain

On 9/10/13, Nick Vandewiele <[email protected]> wrote:
> Hi,
>
>
>
> Imagine I created an IAtomContainer by adding atom after atom. Now I want
> to
> reorder the atoms so that their atom numbers comply to the rules of the
> canonicalization scheme of inchi. I want to do that without actually
> generating the inchi of the atom container and re-using the inchi to create
> a new atom container. Just reshuffling the atom numbers so that they are
> canonical.
>
>
>
> Does CDK have something that does this?
>
>
>
>
>
> regards
>
> Nick
>
>
>
>

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to