Can somebody with more experience with the builder provide a code example?
Begin forwarded message: > From: Josep Cester Bofarull <josep.ces...@urv.cat> > Date: December 19, 2008 3:26:29 AM EST > To: Rajarshi Guha <rg...@indiana.edu> > Cc: CCL Subscribers <chemis...@ccl.net> > Subject: Re: CCL: SMILES to VRML or X3D > Reply-To: josep.ces...@urv.cat > > Thank you for your response Rajarshi, > > as I did with JOELib2, I've succeeded in build a CML file from an > SMILES with CDK with this simple code: > > #### > SmilesParser sp = new SmilesParser > (DefaultChemObjectBuilder.getInstance()); > IMolecule m = sp.parseSmiles("C(=O)(N)N"); > StringWriter output = new StringWriter ( ) ; > CMLWriter cmlwriter = new CMLWriter ( output ) ; try > { cmlwriter.write ( m ) ; > cmlwriter.close ( ) ; } catch > ( Exception e ) { System.out.println ( e ) ; } > System.out.println("CML: " + output.toString ( ) ); > #### > > The problem I have is that I don't know how to specify 3d > coordinates in this CML. Could you give me some example of how to > do this? > > Thank you. > > Josep > > En/na Rajarshi Guha ha escrit: >> >> On Dec 18, 2008, at 8:58 AM, Josep Cester josep.cester]![urv.cat >> wrote: >> >>> >>> Sent to CCL by: "Josep Cester" [josep.cester===urv.cat] >>> Hello, >>> >>> I need to convert SMILES to VRML or X3D in a java application. >>> Does exists any java library to do it? >>> >>> The only way I've found to get an X3D file from an SMILES is >>> converting SMILES to CML (with OpenBabel) and then apply an XSL >>> stylesheet to convert CML to X3D. The problem I have is that >>> OpenBabel is not written in java. I have also tried JOELib2 to >>> convert SMILES to CML, but the CML I get has not got 3D coordinates. >> >> You can use the CDK to go from SMILES to CML >> >> ------------------------------------------------------------------- >> Rajarshi Guha <rg...@indiana.edu> >> GPG Fingerprint: D070 5427 CC5B 7938 929C DD13 66A1 922C 51E7 9E84 >> ------------------------------------------------------------------- >> "I'd love to go out with you, but my favorite commercial is on TV." >> >> >> > > -- > Josep Cester Bofarull > FeT - DEQ > Universitat Rovira i Virgili ------------------------------------------------------------------- Rajarshi Guha <rg...@indiana.edu> GPG Fingerprint: D070 5427 CC5B 7938 929C DD13 66A1 922C 51E7 9E84 ------------------------------------------------------------------- My Ethicator machine must have had a built-in moral compromise spectral phantasmatron! I'm a genius." -Calvin ------------------------------------------------------------------------------ _______________________________________________ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user