creating a RxnMolecule loses coordinates

User c23c5e9da4

14-02-2006 01:21:52

While trying to create a RxnMolecule if I do this with reagent and product being Molecule objects with 2D coordinate information -





rxnMol.addStructure(reagent, RxnMolecule.REACTANTS);


rxnMol.addStructure(product, RxnMolecule.PRODUCTS);





the resulting RxnMolecule lays the reactants and products on top of each other so I have to call rxnMol.clean(2, "") which loses any rotation and drawing information that were in the original molecules. Is there any way to translate the reagents and products without cleaning the whole RxnMolecule?





Thanks.

ChemAxon fb166edcbd

14-02-2006 12:19:20

You can translate the reactants / products by





MoleculeGraph.transform(CTransform3D)
.


You should adjust the translations accordingly.





I attach an example that shows this, run it by:


Code:



java RxnTest r.mol p1.mol p2.mol > rxn.rdf








Remark: RxnMolecule.addStructure() will be deprecated and replaced by RxnMolecule.addComponent() from the next major release Marvin 4.1.

User c23c5e9da4

14-02-2006 17:23:17

Thanks - It would be nice if there was a clean option which would seperate molecules without doing a complete clean.

ChemAxon fb166edcbd

21-02-2006 18:03:36

tkram01 wrote:
Thanks - It would be nice if there was a clean option which would seperate molecules without doing a complete clean.
We will implement this in the next major Marvin release (Marvin 4.1). I will write the details here.

ChemAxon fb166edcbd

23-02-2006 23:55:11

In Marvin 4.1 there will be an API method:


MoleculeGraph.arrangeComponents()


this will fix this problem.





Furthermore, the RDF / RXN molecule import will automatically call this.