MulticenterSgroup class?

User 870ab5b546

15-04-2013 18:09:47

Is there a class called MulticenterSGroup that is a subclass of Sgroup?  I see Sgroup subclasses DataSgroupMultipleSgroupRepeatingUnitSgroupSuperatomSgroup but there is no API for a MulticenterSGroup.  However, I see references to such a class.  For example, in the API for MolAtom, the constant MULTICENTER represents the '"Atomic number" of a central atom of a MulticenterSgroup;' and, in the API for Sgroup, the constant ST_MULTICENTER represents a 'Multicenter S-group type.'  I also see a class called MultiCenterChecker.  


If there is a class MulticenterSGroup, its API is missing.  Please make it available.  


I am trying to write code that will find the real atoms of a multicenter shortcut group from the central atom.  For example, in this MRV, I find that the electron-flow arrow points to the central "atom" of the multicenter shortcut group, and, from that atom, I want to get the real atoms of the multicenter shortcut group.  Note that sgroup.getAtomArray() doesn't return the central "atom" of a multicenter shortcut group, so I can't walk through the shortcut groups of the molecule and find the one that contains my central "atom".  Also, sgroup.hasAtom(atom) returns false even when atom represents the multicenter attachment point of sgroup.  


<?xml version="1.0"?>
<cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7" elementType="C C Pd X Cl Cl R" sgroupRef="sg2 sg2 0 0 0 0 sg1" x2="-2.2618751525878906 -2.2618751525878906 -3.9462499618530273 -2.2618751525878906 -5.279929083681063 -5.03519440488031 -0.9281960307598549" y2="2.2618751525878906 0.7218751525878906 1.4918750524520874 1.4918751525878906 2.261875052452088 0.4029306094248042 3.0318751525878906"/>
<bondArray>
<bond atomRefs2="a1 a2" order="2"/>
<bond atomRefs2="a4 a3" convention="cxn:coord"/>
<bond atomRefs2="a3 a5" order="1"/>
<bond atomRefs2="a3 a6" order="1"/>
<bond atomRefs2="a1 a7" order="1"/>
</bondArray>
<molecule id="sg1" role="SuperatomSgroup" title="OMe" leftName="MeO" molID="m2">
<atomArray atomID="a8 a9" elementType="O C" attachmentPoint="1 0" sgroupAttachmentPoint="1 0" x2="-0.9624999570846557 0.5775000429153443" y2="6.448750019073486 6.448750019073486"/>
<bondArray>
<bond atomRefs2="a9 a8" order="1"/>
</bondArray>
</molecule>
<molecule id="sg2" role="MulticenterSgroup" molID="m3" atomRefs="a1 a2" center="a4"/>
</molecule>
</MChemicalStruct>
<MEFlow id="o2" arcAngle="-243.32835847969886" headSkip="0.25" headLength="0.5" headWidth="0.4" tailSkip="0.3">
<MAtomSetPoint atomRefs="m1.a4 m1.a3"/>
<MAtomSetPoint atomRefs="m1.a4"/>
</MEFlow>
</MDocument>
</cml>


User 870ab5b546

16-04-2013 13:50:36

OK, I added 


import chemaxon.struc.sgroup.MulticenterSgroup;

to my class and it compiled, so now I know that there is a MulticenterSgroup class, but its API is hidden.  I really need to know how to get the multicenter "atom" from the MulticenterSgroup.  I guessed at getMulticenterAtom() but it didn't compile.  Please respond.

ChemAxon 25dcd765a3

16-04-2013 14:13:36

Dear Bob,


You have found the class, but it is intentionally not public. I would not suggest to use non public classes as they may change in the future or occasionally disappear without any notice.


I would rather focus to your problem, which is as far as I understand: "Find which atoms are located in the multicenter sgroup?" please see the following code snippet:


	Molecule m = MolImporter.importMol(molString);
MolAtom mc = null; // multicenter atom
for (MolAtom a : m.getAtomArray()){
if (a.getAtno() == MolAtom.MULTICENTER){
mc = a;
break;
}
}

Sgroup sg = m.findContainingMulticenterSgroup(mc);
for (int i = 0; i < sg.getAtomCount(); i++) {
System.out.println(sg.getAtom(i));
}

where molString is the mrv string you have attached.


 


I hope this helps

User 870ab5b546

16-04-2013 14:31:38

Thanks, that helps a lot.  I suggest that in the introduction to the API of Sgroup, you put a reference to the Molecule method you cite above.  It never occurred to me that the method I needed would be in the Molecule class.

ChemAxon 25dcd765a3

16-04-2013 14:40:16

OK we will do that definitely.


Thank you for the suggestion.