On Tue, Apr 1, 2008 at 2:17 PM, Gianfranco Frau <[EMAIL PROTECTED]> wrote:
> please look out this code. It creates a IMolecule object from SMILES of
> benzene, uses the aromaticity detector and than generates again the SMILES
> from the molecule.
First of all, the SmilesGenerator will not use 'c' in its output,
unless you explicitly indicate you want that. (Possible).
> The code print out the string: "C1CCCCC1", so a molecule without
> aromaticity.
The above code does not apply deduction of double bond orders. The
input SMILES does not explicitly have bond orders, and the
SmilesParser in trunk/ will not do this for you automatically.
> Is it correct? What's the matter?
However, the combination is a bit ugly in use... adding the extra line
below should address the issue, though:
> try{
>
> //create molecule parsing the smile
> SmilesParser sp = new
> SmilesParser(DefaultChemObjectBuilder.getInstance());
> IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
> IMolecule m = builder.newMolecule( sp.parseSmiles("c1ccccc1"));
>
> //aromaticity
> AtomContainerManipulator.percieveAtomTypesAndConfigerAtoms(m);
> CDKHueckelAromaticityDetector.detectAromaticity(m);
DeduceBondSystemTool dbst = new DeduceBondSystemTool();
molecule = dbst.fixAromaticBondOrders(molecule);
> //generation of new fingerprint
> SmilesGenerator sg = new SmilesGenerator();
>
> System.out.print(sg.createSMILES(m));
>
> }
>
> catch (Exception e){
> e.printStackTrace();
> }
Please let me knows if this solved your problem.
Kind regards,
Egon Willighagen
--
----
http://chem-bla-ics.blogspot.com/
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user