Remove a data in Molecule from array of Attached Data

User dfeb81947d

19-09-2012 10:30:27

Dear Support,


In this post, I have asked to identify stoichiometry in Molecule object and the solution works really fine.


Now I have a molecule with many informations in the attached data array, for exemple stereochemistry. I would like to know how I can using API remove just a single information identified by its group name.


See attached SDfile for example...

I would like to remove Stoichiometry (Group name = "MDLBG_FRAGMENT_COEFFICIENT") from Molecule object.


Using Standardizer, it removes every fields. But I want to keep other attached data, and remove only those from MDLBG_FRAGMENT_COEFFICIENT group.


It should be possible to do it through the API since marvin do it quite simply with its GUI, but I haven't found how to do it using Molecule object (a lot of  methods to remove SGroups are protected, but even with using an Object that override Molecule, it didn't work as needed)


Thank you in advance for your help


Kind Regards,


Jacques

ChemAxon d26931946c

19-09-2012 10:51:27

Dear Jacques,


 


You use the getDataSgroup(Molecule, String) function to get the DataSgroups with that name.


After that you can use the Molecule.ungroupSgroup(Sgroup) to remove them from the molecule.


Sorry for not responding any sooner.


 


Regards, 


Peter

User dfeb81947d

19-09-2012 12:22:59

Dear Peter,


Thank you so far, that's exactly what I was thinking about... wonderful...


Have a nice day


 


Thank you again


Jacques