Molecule Analyzer (mass,etc.)

User 0ccd249401

11-01-2013 21:36:28

Hello!


I need to calculate molecular weight by using ChemAxon.NET.IKVM.Marvin.Plugin.MarvinElementalAnalyser class. The input molecule is from MarvinEditorControl (in MRV format). But to get mass using MarvinElementalAnalyser's Mass() method I need as parameter molecule as chemaxon.struc.Molecule type.


How can I convert or parse MRV molecule to chemaxon.struc.Molecule type?


And why there are two different namespaces: ChemAxon... and chemaxon...


Thanks!


Sorry for my english)

User 0ccd249401

11-01-2013 22:08:47

I've solved that problem in such way:


chemaxon.struc.Molecule[] mols = chemaxon.struc.MDocument.parseMRV(myMolecule).getAllMolecules();

return mols[0].getMass();

 


Where "myMolecule" molecule from MarvinEditorControl in string format.


Is it right solution or is it another right posible way?


 


P.S. Simplest way:


return chemaxon.struc.MDocument.parseMRV(myMolecule).getPrimaryMolecule().getMass();

ChemAxon bd13b5bd77

11-01-2013 22:25:47

Hi,


I would stay in the ChemAxon.NET.IKVM namespace.


var molecule = new JChemMolecule(new JChemMoleculeData(sMRVData, Formats.MRV));


return molecule.Mass;


It is simple in this way..


 


if you have batch molecules, or Markush structure your code is also valid if you want to get back more molecules.


JChemMolecule provides the struc.Molecule from the underlying library via a property (object) NativeMolecule.


Viktor


 


 

User 0ccd249401

11-01-2013 22:56:37

Thanks, Viktor!


 


But to my mind it's impossible to find this way by himself, I think that the ChemAxon API library is powerful but not intuitively understandable. Sometimes to find some decision I must to become a visionary. To my opinion it's must be some framework with most common properties, methods etc. that will help developer more easy use such greate product as JChem for .NET.


But maybe it's I'm few stup))


 


Sorry for my english.


 

User 0ccd249401

12-01-2013 08:33:14


Few hours of work shows that problem is in me. Almost all are understandable. The matter is that I didn't knew the difference between chemaxon and ChemAxon namespaces and I often used them together. Now I use only ChemAxon namespace and it's fully simple to work with it.


Thank you very much for product and support!


ChemAxon bd13b5bd77

12-01-2013 10:20:06

Agreed. The new ChemAxon.NET library is not well documented yet.


Once we are ready with it we try to quickly document it up.


We have now two layers. JChem.NET API, which is very native and sometimes complicated. And nowadays we would like to collect some functionalities in a brand new layer in ChemAxon.NET area I suggested.


We try to centralize an object (JChemMolecule) because based on our questionares all the users look for a molecule to start their work with. It is understandable. So we defined a new molecule approach over the low level JChem.NET API to provide and make all other services available via the molecule.


So possibly your last comment was different because you moved ahead in the tree of properties deifned on the new molecule interface.


 In 5.12 this API is going to be more matured, some customers wanted to keep the simple interface proeperties on the editor like: moleculestring and format as strings, so we kept that. In 5.12 we will be able to provide the molecule data as a property getter/setter in order to build up the JChemMolecule object very easily after the data editing.


Thank you for the feedback (both negative and positive), we need infromation if our users can find the most proper way of using the library (even without doucmentation)


we think that the new approach through JChemMolecule is more intuitive for the users, that was my impression on your last comment that it is more easy-to-use.