cc:Sam (author of the CDK-InChI bridge)

On Sun, Sep 4, 2011 at 7:52 AM, Nina Jeliazkova
<[email protected]> wrote:
> This usually happens, when the molecule does not contain explicit
> hydrogens.

I was not aware of that. Doesn't sound very useful. We don't have a
unit test for this yet, right? That tests for InChI generation for a
compound with and without explicit hydrogens, do we?

Does this happen for any compound?

> e.g. the test below fails with exactly the same message : "Accepted unusual
> valence(s): C(3); Cannot process aromatic bonds"
>  SmilesParser p = new
> SmilesParser(NoNotificationChemObjectBuilder.getInstance());
>  IMolecule mol = p.parseSmiles("CN1C=NC2=C1C(=O)N(C(=O)N2C)C");
> /*
> CDKHydrogenAdder ha =
> CDKHydrogenAdder.getInstance(NoNotificationChemObjectBuilder.getInstance());
> ha.addImplicitHydrogens(mol);
> AtomContainerManipulator.convertImplicitToExplicitHydrogens(mol);
> */
>  InChIGeneratorFactory factory = InChIGeneratorFactory.getInstance();
>  InChIGenerator gen = factory.getInChIGenerator(mol);
>  INCHI_RET ret = gen.getReturnStatus();
>  if (ret != INCHI_RET.OKAY) {
>       throw new Exception(String.format("InChI failed: %s [%s]",
> ret.toString(),gen.getMessage()));
>  }
>  String inchi = gen.getInchi();
>  Assert.assertEquals("InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3",
> inchi);

I'll try to use this to create a unit test. I'll also make one for
methane... wondering how widespread this issue is...

> Uncomment the hydrogen adder code and the test will succeed.
> I haven't investigated whether the explicit H requirement is the normal
> InChI behaviour or something in the cdk-inchi interaction, perhaps others
> could help.  Otherwise, I agree the current behaviour is not quite
> convenient.

Sam, do you know what is going on?

Egon


-- 
Dr E.L. Willighagen
Postdoctoral Researcher
Institutet för miljömedicin
Karolinska Institutet (http://ki.se/imm)
Homepage: http://egonw.github.com/
LinkedIn: http://se.linkedin.com/in/egonw
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to