Simplest web method to convert a SMILES to an image?

User 5e8d4b0dd3

11-08-2007 09:18:58

Dear colleagues,





I have a need to present a number of structures stored in a database in either mol or SMILES format, on the fly, as gif/jpg/png images on a web page - is there a way to do this using very simple web technology? At this time I only have access to a plain IIS server, and the technologies I can use are html, asp & javascript (php at a push). Is this feasible?





KR & TIA,





Gaspode

ChemAxon 7c2d26e5cf

13-08-2007 12:16:12

You can do it with Marvin Beans.


Please see the JSP examples on the following page: Image Generation Using Marvin Beans

User 5e8d4b0dd3

14-08-2007 07:05:30

Thanks Tamas, I shall have to see what my options for running JSP are...

ChemAxon 7c2d26e5cf

14-08-2007 09:42:00

You need Java and a JSP capable web server (e.g. Tomcat) to host JSP examples.

User 5e8d4b0dd3

16-08-2007 15:59:28

Outstanding! I can't believe it was so easy!





In my simplest example I pass a SMILES string and an image height from a link, e.g.





Code:



<html>


<body>


<a href="smiles2image.asp?s=c1cccc1&h=100">Show image</a>


</body>


</html>








...then use the simple HTML/vbscript code in file smiles2image.asp below to generate the image in place:





Code:



<html>


<body>


<img src="http://server:8080//generate_image.jsp?mol=<%=Server.URLEncode(request.querystring("s"))%>&format=<%=Server.URLEncode("jpeg:h" + request.querystring("h") + ",#ffffff")%>" />


</body>


</html>








Many thanks again,





Gaspode