Which version are you using, works okay for me on 2.2-SNAPSHOT and not much
should have changed their since a few years:

public static void main(String[] args) throws CDKException {
    String             smi =
"C[C@]12CC[C@H]3[C@@H](CCC4=CC(O)=CC=C34)[C@@H]1CC[C@@]2(O)C#C";
    IChemObjectBuilder bldr = SilentChemObjectBuilder.getInstance();
    SmilesParser       smipar = new SmilesParser(bldr);
    IAtomContainer mol = smipar.parseSmiles(smi);
    
System.out.println(InChIGeneratorFactory.getInstance().getInChIGenerator(mol).getInchiKey());
    // not needed
    // AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol);
    AtomContainerManipulator.convertImplicitToExplicitHydrogens(mol);
    
System.out.println(InChIGeneratorFactory.getInstance().getInChIGenerator(mol).getInchiKey());
}

You don't need to assign the atom types, but I tried with/without the
answer was the same.

BFPYWIDHMRZLRN-SLHNCBLASA-N
BFPYWIDHMRZLRN-SLHNCBLASA-N

John

On 7 February 2018 at 22:06, Yannick .Djoumbou <y.djoum...@gmail.com> wrote:

> Hi all,
>
> I have been under deep debugging more for a few hours, only to find that
> there seem the InChIKey of molecules seem to change when I use the
> AtomContainerManipulator to convert implicit hydrogens into explicit ones.
>
> For instance
>
> I have the following 17-Ethinylestradiol molecule:
>
> C[C@]12CC[C@H]3[C@@H](CCC4=CC(O)=CC=C34)[C@@H]1CC[C@@]2(O)C#C
>
> PubChem CID: 5991
>
>
> If I use
>
>
> InChIGeneratorFactory inchiGenFactory = InChIGeneratorFactory.
> getInstance();
>
> System.out.println("INCHIKEY BEFORE ADDING EXPLICIT HYDROGEN: ") +
> inchiGenFactory.getInChIGenerator(molClone).getInchiKey());
>
>
> AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms("
> 17-Ethinylestradiol");
>
> AtomContainerManipulator.convertImplicitToExplicitHydrogens("
> 17-Ethinylestradiol");
>
>
> System.out.println("INCHIKEY AFTER ADDING EXPLICIT HYDROGEN: ") +
> inchiGenFactory.getInChIGenerator(molClone).getInchiKey());
>
>
> I get the following output:
>
>
> INCHIKEY BEFORE ADDING EXPLICIT HYDROGEN: BFPYWIDHMRZLRN-SLHNCBLASA-N
>
> INCHIKEY AFTER ADDING EXPLICIT HYDROGEN: BFPYWIDHMRZLRN-OQPPHWFISA-N
>
> This causes a problem down the path for me.
>
>
> An interesting point is that I used the structures generated (via isomeric
> SMILES) upon conversion of implicit hydrogen by CDK and visualized them
> using Marvin Sketch (Seee attached file), and the look identical to me. I
> also used the isomeric SMILES strings before and after conversion to search
> for same stereoisitopes in PubChem, and found the exact same structure. So
> I am confused as to why CDK would return different InChIKeys.
>
>
> Is there an explanation for this, or may be some other steps I should take
> to avoid this?
>
>
> Thank you for your consideration.
>
>
> Best,
>
>
> Yannick
>
>
>
>
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Cdk-user mailing list
> Cdk-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cdk-user
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to