coordinates for atoms in a rxnmolecule

User 56c4fc7140

06-03-2007 20:59:41

Hi,





Does marvin provide any facility to automatically assign coordinates to atoms in a rxn molecule? Is there a standard way of generating coordinates w/o having to assign the individual x,y,z manually?





Thanks!

ChemAxon 7c2d26e5cf

07-03-2007 08:39:03

Clean the molecule to generate coordinates for the the structure: MoleculeGraph.clean(int,String)

User 56c4fc7140

07-03-2007 10:24:34

Thanks,





This question is actually related to my previous posts. So i've created a rxnmolecule, generated the coordinates of the atoms, created an eflow between two atoms using the coordinates, added both rxnmolecule and eflow objects to an mdocument.





BUT how come the generated png or jpeg contain a blank white box. the mrv export contains all of the information, however.





what exactly am i missing in order to generate the arrows in png or jpeg outputs?

ChemAxon 7c2d26e5cf

07-03-2007 10:31:43

Can you show an example? An output image (and an rxn/mrv file) would be useful.


Have you tried export the created doc into mrv format then open this mrv file in MarvinSketch or in MarvinView? MarvinSketch/View displayed it fine?

User 56c4fc7140

07-03-2007 10:58:06

Attached is a copy of the generated mrv file. Btw, thanks for replying so quickly!





I haven't tried loading this yet using the applets as I've been trying to learn the API as of late. It's fairly late in the west coast at the moment =)





Here is the reaction i'm trying to draw:





C[C:1](=[O:2])[OH:3]>>CC(=O)OCC





Although not chemically correct, I assumed that marvin libs didn't check the correct source/sink atoms. The eflow I created had an electron flow from C:1 to O:2... Maybe this is the issue (but I'll test this tomorrow when my brain isn't fried!)





Thanks again for you help

User 56c4fc7140

07-03-2007 19:09:20

Hi Tamas,





I've loaded the generated mrv files onto marvin sketch and I have created the correct objects (eflow,etc) and the arrows are properly shown. I've attached a jpeg generated by the applet.





What other steps am I missing to generate the same image file?





Thanks!
theoryno3 wrote:
Attached is a copy of the generated mrv file. Btw, thanks for replying so quickly!





I haven't tried loading this yet using the applets as I've been trying to learn the API as of late. It's fairly late in the west coast at the moment =)





Here is the reaction i'm trying to draw:





C[C:1](=[O:2])[OH:3]>>CC(=O)OCC





Although not chemically correct, I assumed that marvin libs didn't check the correct source/sink atoms. The eflow I created had an electron flow from C:1 to O:2... Maybe this is the issue (but I'll test this tomorrow when my brain isn't fried!)





Thanks again for you help

ChemAxon 7c2d26e5cf

08-03-2007 16:39:03

Try something like that:


Code:



   Molecule mol = importer.read();


   mol.addExplicitHydrogens(Molecule.OMIT_POSTCLEAN);


   if(mol.getDim() == 0) {


       mol.clean(3, null);


   }


   


   MDocument doc = mol.getDocument();


   if(doc == null) {


       doc = new MDocument(mol);


   }


   DPoint3 p1 = mol.getAtom(1).getLocation();


   DPoint3 p2 = mol.getAtom(0).getLocation();


   MPoint mp1 = new MPoint(p1);


   MPoint mp2 = new MPoint(p2);


   MEFlow eflow = new MEFlow(mp1,mp2,1);


   doc.addObject(eflow);


   //MEFlow eflow = new MEFlow(p1,p2);


   String format = "jpeg:wireframe,#ffffff";


   byte[] data = doc.exportToBinFormat(format);