importing SGroupAtom

User 870ab5b546

19-05-2008 19:45:07

How do we create an SGroupAtom from the definition in the default.abbrevgroups file?





It seems like this ought to work:





Code:
Molecule abbrevGroup = importer.importMol(smilesDef);


MolAtom attachAtom = abbrevGroup.getAtom(attachAtomNum - 1);


SuperAtomSGroup sasGroup = new SuperAtomSGroup(abbrevGroup);


sasGroup.addAttachAtom(attachAtom);


SGroupAtom sgAtom = new SGroupAtom(sasGroup);






Unfortunately, SuperAtomSGroup.addAttachAtom() is protected.





Is there another way to do it? Why is addAttachAtom() protected, anyway?

ChemAxon e500b51457

21-05-2008 12:12:51

Hi Bob,





You can find a simplified example for abbreviated group creation in the attached code.


The example code:


- creates a SuperatomSgroup in a molecule from specified atoms.


- sets the subscript of the Sgroup.


- sets attachment points on specified atoms of the Sgroup.





The SgroupAtom is automatically created with the SuperatomSgroup.





Regards,


Erika.

User 870ab5b546

21-05-2008 13:29:43

Ahh, interesting...





I suggest you add your final comment to the documentation on SgroupAtom and SuperatomSgroup constructors in the API. There is no way to know it otherwise.