Aromatize - Dearomatize (again)

User b22f714996

05-04-2005 06:38:18

Hello...





I'm using the jchem API and have a question regarding heteroaromatic compounds.


As Ferenc pointed out in another thread n1cccc1 is not the correct SMILES for pyrrole, but [nH]1cccc1. The problem now is: How do you get this correct SMILES.





In an example application I used the following snippet to create pyrrole:





Molecule mol = new Molecule();


//Adding atoms


MolAtom n_1 = new MolAtom(7);


MolAtom c_1 = new MolAtom(6);


MolAtom c_2 = new MolAtom(6);


MolAtom c_3 = new MolAtom(6);


MolAtom c_4 = new MolAtom(6);


mol.add(n_1);


mol.add(c_1);


mol.add(c_2);


mol.add(c_3);


mol.add(c_4);


//Adding bonds


mol.add(new MolBond(n_1, c_1, 1));


mol.add(new MolBond(n_1, c_4, 1));


mol.add(new MolBond(c_1, c_2, 2));


mol.add(new MolBond(c_2, c_3, 1));


mol.add(new MolBond(c_3, c_4, 2));





If I create a SMILES from this molecule with:





String da_smiles = mol.toFormat("SMILES");





I get:





N1C=CC=C1





After:





mol.aromatize();


String a_smiles = mol.toFormat("SMILES");





I get:





c1ccnc1





So obviously, the first SMILES is not unique, the second one is not correct.


The solution (at least in my opinion) would be to aromatize, add a hydrogen to all aromatic heteroatoms and create the SMILES afterwards.





I tried different ways to achieve that, but I have not succeded so far.





I would be very thankful for a solution to this problem.





Thanks a lot,





tobias

ChemAxon 25dcd765a3

05-04-2005 13:35:23

Hi


Only one line is missing from the code:


Code:



// after you have created the molecule run valenceCheck to correct missing implicit H-s.


mol.valenceCheck();


// aromatization


mol.aromatize();


String a_smiles = mol.toFormat("SMILES");








I have checked and it works for me.


All the best


Andras