How to get product, reactants etc. .NET

User 0ccd249401

07-07-2010 11:33:27

Hi!


How can I get (extract) reagent molecule or product molecule separately from reaction that was drawn in Marvin control?


Thanks!

ChemAxon 990acf0dec

08-07-2010 09:17:20

Hi Jane,


It is possible by using the RxnMolecule class:


https://www.chemaxon.com/marvin/help/developer/beans/api/chemaxon/struc/RxnMolecule.html


Best regards,


Akos

User 0ccd249401

09-07-2010 06:00:02

Thanks!


How to set to RxnMolecule class instance the reaction that I have drawn in Marvin Control? Methods GetReactant() & GetProduct() are not overloaded? If it will be GetReactant([molecule from Marvin Control]) it's will be greate, but it is not that.


Can you help me with some example (C# )?


Thanks!

ChemAxon bd13b5bd77

09-07-2010 11:03:13

Dear Jane,


from the gui component you need to get the rxn in Molecule or string format, if you get it in string format you should import it, otherwise the only thing you need to do is to type cast the generic Molecule class returned to specific (polimorphic RXNMolecule).


string solution:


// deseriaqlize reactant molecule by ChemAxon API
_rxnMolecule = (RxnMolecule)MolImporter.importMol(_rxnData);


where 
RxnMolecule _rxnMolecule;

if you have the RxnMolecule in the memory you need to check the interface in our online documentation

https://www.chemaxon.com/jchem/doc/dev/dotnet/api/html/T_chemaxon_struc_RxnMolecule.htm



































getProduct
Gets a product.

getProductCount
Gets the number of products.

getProducts
Gets all products in an array.

getReactant
Gets a reactant.

getReactantCount
Gets the number of reactants.

getReactants
Gets all reactants in an array.




















getAgent
Gets an agent.

getAgentCount
Gets the number of agents.

getAgents
Gets all agents in an array.



if you would like to write code handling the components as generic Molecules please use:















getComponent Overloaded.
getComponentCount
Gets the number of reactants, products or agents.


 


Viktor