Constructing an Molecule object containing a superatom

ChemAxon 587f88acea

07-01-2005 11:44:19

Hi,





I want to construct a molecule using the class Molecule. The location of the atoms and the arbitrary atomsymbols are given as Point2D and String object respectively. If that molecule contains a superatom x represented by a string e.g. PO3 (it might also be given as a string in SMILES format), I have to specify the structure of this superatom. How can I reconstruct the structure of a superatom from a string representation?





Many thanks for help!


lt

ChemAxon 587f88acea

07-01-2005 16:57:46

The problem is solved.





Best regards,


lt

ChemAxon 587f88acea

17-01-2005 13:13:30

Hello,





I have the same problem. I want to generate a molecule that contains some superatoms. How can I specify the superatom group, the crossing bond and its label for the contracted state? Let say I have to construct one simple molecule like that one in the image. What methods can I use for this purpose?





Thanks a lots,


Jean

ChemAxon 7c2d26e5cf

17-01-2005 19:09:49

Here is an example to create a molecule with a superatom.


Code:



            // import a molecule


            String smiles = "[H]OOCCC";


            Molecule m = MolImporter.importMol(smiles.getBytes());


            m.clean(2,null);


            // define an sgroup


            SuperatomSgroup sgroup = new SuperatomSgroup(m,true);


            sgroup.setSubscript("COOH");


            // add atoms to sgroup


            for(int i=0;i<m.getAtomCount()-2;i++) {


                MolAtom a = m.getAtom(i);


                m.setSgroupParent(a, sgroup, true);


            }