MarvinSketch export data

User bb2ba884f2

01-02-2011 14:07:42

Hi to all !


I am trying to use MarvinSketch with Javascript/PHP. The goal is - User drawn his molecule in MarvinSketch.
After pressing an "export" or "submit" button the script must do the following:


1. Save this molecule in "pdf" format with mapping => Map atoms (first file)


2. Save this molecule in mol format with Explicit Hydrogens and Clean3D (second file)

I searched the API documentatiion and Forum but didn't find the answer or example.


Any ideas, examples will be apreciated.

Thanks,


Andrew.

ChemAxon 5433b8e56b

03-02-2011 14:26:30

Hi Andrew,


i think you should use the getMol(String) method on applet in the client side from javascript.


Documentation for the method can be found here. After you got the data from the applet you can send it to the server side.


An example on this can be found here.


I hope that helps.


Regards,
Istvan

User bb2ba884f2

03-02-2011 15:06:17










ifajth wrote:

Hi Andrew,


i think you should use the getMol(String) method on applet in the client side from javascript.


Documentation for the method can be found here. After you got the data from the applet you can send it to the server side.


An example on this can be found here.


I hope that helps.


Regards,
Istvan



Hi Istvan!


Thanks for your reply.
For the second question "2. Save this molecule in mol format with Explicit Hydrogens and Clean3D (second file)" yes i use the getMol method, but for the 1 question - "1. Save this molecule in "pdf" format with mapping => Map atoms (first file)" i think the answer is by using toBinFormat method - http://www.chemaxon.com/marvin/help/formats/images-doc.html

But how to use/define this method (toBinFormat) in  javascript ? Any examples ?

Thanks,

ChemAxon 5433b8e56b

03-02-2011 15:24:54

Hmm, i see...


I missed that the getMol method returns a string. In this case i suggest you to use either the MarvinBenas API on the server side to generate the pdf, or if you are not familiar with Java technologies on the server side, you should simply use the molconvert utility which is also included in the MarvinBeans package. To run the molconvert utility, you will need an installed MarvinBeans and an installed Java on the server side.


You can found information on molconvert here. You can find install instructions here if needed.


Istvan

ChemAxon 7c2d26e5cf

03-02-2011 16:41:00

I recommend to check the examples under the following URL:


Image Generation Using MarvinBeans


It demonstrates how you can pass molecule structure to server that provides you the image representation of the structure.

User bb2ba884f2

04-02-2011 08:07:45










Tamas wrote:

I recommend to check the examples under the following URL:


Image Generation Using MarvinBeans


It demonstrates how you can pass molecule structure to server that provides you the image representation of the structure.



Hi Tamas.

Thanks for this URL. I tried this example http://www.chemaxon.com/test/image-generation/show-image-ajax1.html , but it fails on run (MarvinSketch didn't run).
Also I am not familiar with JSP/ApacheTomcat and I also have to check if i my hosting suport it.


There is another way to do this ? For example to call "Java export image method" from Javascript like doing with getMol here - http://www.chemaxon.com/marvin/examples/applets/sketch/js_io.html(funtcion exportMol).

And for the second question that I posted "Save this molecule in mol format with Explicit Hydrogens and Clean3D " I found the answer how to add Explicit H (by adding "mol:H"), but how to add a clean3D at export?

Thanks.

User bb2ba884f2

04-02-2011 08:33:47










ifajth wrote:

Hmm, i see...


I missed that the getMol method returns a string. In this case i suggest you to use either the MarvinBenas API on the server side to generate the pdf, or if you are not familiar with Java technologies on the server side, you should simply use the molconvert utility which is also included in the MarvinBeans package. To run the molconvert utility, you will need an installed MarvinBeans and an installed Java on the server side.


You can found information on molconvert here. You can find install instructions here if needed.


Istvan




Hi Istvan!


Thanks again. I saw this "molConverter", but I have to do export  when user press the export buton. Maybe exist another way to export as image like doing with mol file - i meaning this example - http://www.chemaxon.com/marvin/examples/applets/sketch/js_io.html (save the image or pdf dates in an "input tag", "textarea tag" and then save it as file)

Please see also the quote that i posted to Tamas.


P.S.
Sorry for my bad English, hope you understood what i meaning.


Best regards.

User bb2ba884f2

08-02-2011 20:06:51










Tamas wrote:

I recommend to check the examples under the following URL:


Image Generation Using MarvinBeans


It demonstrates how you can pass molecule structure to server that provides you the image representation of the structure.



Hi Tamas!


I posted an quote to your mesage.
I still dind't find answer to my question , i mean an accepted solution for me.


I think exist a way to get an image using "javascript / php", because i found this link that realise exactly what i need - http://www.webqc.org/moleculareditor2.php


Hope that you can provide any help.


Best regards.


Andrei.

ChemAxon 5433b8e56b

09-02-2011 13:27:43

Hi,


I checked the webqc site, and i found the following. For me the image did not generated, but as i observed, it is generating after posting molecule data to the server side, so they use either our java library, or the molconvert utility  from php thru command line.


So i can suggest again, to use our java library, or install marvinbeans onto the server, and use the molconvert.sh to generate images. You can install java, and marvinbeans into a user directory also if you do not have administrator rights on the server.


Regards,
Istvan

User bb2ba884f2

09-02-2011 21:00:39










ifajth wrote:

Hi,


I checked the webqc site, and i found the following. For me the image did not generated, but as i observed, it is generating after posting molecule data to the server side, so they use either our java library, or the molconvert utility  from php thru command line.


So i can suggest again, to use our java library, or install marvinbeans onto the server, and use the molconvert.sh to generate images. You can install java, and marvinbeans into a user directory also if you do not have administrator rights on the server.


Regards,
Istvan



Hi Istvan!


ok, i have to check how to use molconvert


And how about "clean3D"? how to export molecule in 3D using getMol ?


thanks for reply.

ChemAxon 5433b8e56b

10-02-2011 15:15:09

Hi,


with molconvert you can use the -3 option, it has optional 3D cleaning options, you can sepcify them as -3[:options] detailed information on using molconvert can be found here.


If you want to get the molecule in 3D from the applet, you should call the clean3D() method before calling getMol().


Regards,
Istvan

User bb2ba884f2

11-02-2011 06:10:32










ifajth wrote:

Hi,


with molconvert you can use the -3 option, it has optional 3D cleaning options, you can sepcify them as -3[:options] detailed information on using molconvert can be found here.


If you want to get the molecule in 3D from the applet, you should call the clean3D() method before calling getMol().


Regards,
Istvan



Hi Istvan!


Thanks for advance. I tried the molconvert utility on windows it works. Now I have to install MarvinBeans on Linux server and call the molconvert utility from php script.
Consider this subject as solved.


I also posted a new topic here - https://www.chemaxon.com/forum/viewpost33503.html#33503.


Best regards.