Method to identify/create Sgroups in structures?

User f05f6b8c05

25-04-2014 03:30:35

Hi,


Is it possible with Java API to take (for example) structure of toluene drawn without any Sgroups, and search for benzyl group with single aliphatic attachment, and then turn that benzyl group into collapsed Sgroup called "Bz" .. so that structure display as "Bz-CH3"?


If it is possible, can you please describe an example with Java API?


Thanks very much,


Andrew

ChemAxon fc046975bc

25-04-2014 08:04:42

Hi Andrew,


Here is an example code on how to create an Sgroup from atoms of a molecule:


SuperatomSgroup sasg = new SuperatomSgroup(mol);  // mol is the Molecule object of the toluene
mol.setSgroupParent(atom1, sasg, true); // here atom1, atom2, ... atomN are atoms
mol.setSgroupParent(atom2, sasg, true); // of the benzene ring.
sasg.setSubscript("Bz");
sasg.contract(Expandable.DEFAULT_OPTIONS);

Regarding on search for benzene ring with aliphatic attachment, I would suggest the so-called Rgroup-decomposition. The apidoc with examples is here, documentation is here.


I hope this helps!


Best Regards,


Peter

User f05f6b8c05

26-04-2014 20:56:46

Thanks very much, Peter.  This is very helpful!


Andrew