Jpeg with non-aromatic smiles

User 979012b3b3

15-07-2008 14:21:49

Hi, I'm using


chemaxon.formats.MolImporter,


chemaxon.struc.Molecule,chemaxon.formats.*,


chemaxon.util.*


for designing smiles in web.





// Setting content type


String type = format.indexOf(":") == -1 ?


format : format.substring(0, format.indexOf(":"));


response.setContentType("image/" + type);


Molecule mol = null;


mol = MolImporter.importMol(molstring);


//......


byte[] b = mol.toBinFormat(format);


ServletOutputStream outs = response.getOutputStream();


outs.flush();


outs.write(b,0,b.length);


outs.close();





If I have an aromatic smiles I see a "circle" in my jpeg, I'd like to "convert" my smiles from aromatic to non-aromatic ones. How can I change my code?


Thanks a lot, Cristina

ChemAxon 7c2d26e5cf

15-07-2008 22:22:46

Dearomatize the structure before export it into image format or give the dearomatization option for image export.





1st way: Dearomatize the structure directly: Molecule.dearomatize()





2nd way: Ask the exporter to dearomatize the structure before displaying. In this case, the dearomatization export option has no influence to the original molecule.


Code:
byte[] b = mol.toBinFormat("jpeg:-a");



See more export options in the following document:Basic export options.

User 979012b3b3

16-07-2008 08:08:00

Hi, thanks a lot for the reply.


In any case I continue to visualize a circle.


The problem seems to be for aromatic n, in which the hidrogen bond is not indicated in the smiles, example c1cncccc1.


thanks, Cristina

User 979012b3b3

21-07-2008 09:03:37

any idea?


Thanks


Cristina

ChemAxon 25dcd765a3

21-07-2008 13:46:02

Dear Cristina,





I don't think your molecule is aromatic even it is drawn such a way.


So c1cncccc1 is probably a bad description of a molecule.


So if I take your original molecule: c1cncccc1, it is not possible to draw single and double bonds such a way that the result will be aromatic also.


My solution would be N1C=CC=CC=C1 which is not aromatic.


I don't see the connection between the hydrogen atoms in the smiles and aromatic ring. Even if you set the implicit H to the Nitrogen in the smiles string, your molecule will not be aromatic.


Andras