how to convert smiles to structure

User feea1b68c9

07-05-2009 12:57:38

hi Group,


 


can any one help me in how to convert smiles to structure, while converting getting an exception "The type initializer for 'com.jnbridge.jnbcore.ObjectWrapper' threw an exception." at MolHandler mh = new MolHandler(smiles);


can any one help please


 


Thanks in advance.


Kolan

ChemAxon 25dcd765a3

08-05-2009 13:38:02

Hi,


 


Here is an example code to read a molecule from String:


// Read molecule from given string
Molecule m = MolImporter.importMol("CC=CC", "smiles");


And an other to read from file:


InputStream is = new BufferedInputStream( new FileInputStream( "filename.smi" ) );
MolImporter molimp = new MolImporter( new MolInputStream( is ) );

Molecule m = new Molecule();
while(molimp.read(m)){
// put your code here

}


If you can attach your code I could help more deeply.


 


Andras

User feea1b68c9

09-05-2009 05:39:57

hi  Andras,


Thanks for your kind reply..


 


please find my code as listed below ...


 


MolHandler mh = new MolHandler(smiles);


mh.aromatize();


Molecule mol = new Molecule();


mol=mh.getMolecule();


mol.clean(2, null);


sbyte[] s1 = mol.toBinFormat("png:w300, 4300,b32");


 


but in the first line itself i am getting metioned exception ..


pls help


Thanks & Regards


Raveendar Reddy Kolan


 


 


 


 

ChemAxon a9ded07333

12-05-2009 09:40:06

Hi Kolan,


Could you send the whole error message (that contains class names, line numbers, ...)?


Regards,
Tamás