loading smiles file into applets

User e34a92cce5

06-07-2006 17:05:10

Hi,


I saw a demo of loading sdf files using Marvin applets on the user guide.


Link: http://www.chemaxon.com/marvin/doc/dev/example-view2.6.html





I was having trouble loading a smiles file that contains multiple structures. Is there an easy way to deal with non-sdf structure files that need to be displayed online using Marvin applets? I tried using param("smiles") etc but it would not display the structures.


Thanks!

ChemAxon 7c2d26e5cf

07-07-2006 07:58:02

There is no "smiles" applet parameter in Marvin.


To load your smiles file (with multiple structures), just change the value of the mol parameter in the refered example ( http://www.chemaxon.com/marvin/doc/dev/example-view2.6.html ) and set the max variable to the proper value (number of molecules in the SMILES file).


E.g.:


Code:
/ number of structures in the SD file


var max = 16;


...


mview_param("mol","mysmiles.smiles")



In the above example, there are 16 molecules in "mysmiles.smiles".

User e34a92cce5

07-07-2006 15:20:12

Hi Tamas,


Thanks for the reply. I was wondering if there is a way to calculate the number of structures in a file instead of specifying a fixed max value. We might have files with varying numbers of structures being submitted and so I was looking at a way to assign the 'max' variable to be dynamic.


Thanks!


Renju

ChemAxon 7c2d26e5cf

07-07-2006 15:51:19

It is the shortcoming of the applet. We will check the problem how to count molecules in structure files before loading molecules.

User e34a92cce5

18-09-2006 21:26:40

Hi Tamas,


I had a quick question regarding the SDF files that are uploaded in the applets for viewing online. Is there a way that we can display informations from the SDF field in the applet? e.g if I have a ><cd_molweight> metatag information in my SDF file, how do I display it in the applet?


Thanks!


Renju

ChemAxon 7c2d26e5cf

19-09-2006 15:09:26

Quote:
I had a quick question regarding the SDF files that are uploaded in the applets for viewing online. Is there a way that we can display informations from the SDF field in the applet?
Currently, there is no way to do it in applet.


But we will consider this request.

User e34a92cce5

01-02-2007 15:56:48

Can you think of other alternatives to load an SDF file to be viewed online with the tag information (at least the cd_id). Even if there is a roundabout workaround to this, I'd appreciate it

ChemAxon 7c2d26e5cf

01-02-2007 22:03:21

I have got two ideas to display SD field (as workaround).





#1. Pre-load SD file and filter somehow SD fields from it. Then the field values can be given at the initalization of the applet: mview_param("cell"+i,"...")





#2. Convert SD file into MRV and add field values as graphical components (MTextBox) to the document. You can do it by Marvin Beans API:


- Import compounds with MolImporter to create Molecule objects.


- Get SD fields as properties from the molecule: Molecule.getProperty(String).


- Create new text boxes and add them to the molecule's document. See the following topic about it: add text boxes through the api?

User e34a92cce5

05-02-2007 18:14:14

by pre-load, do you mean to import the file into a compounds table nd then display it

ChemAxon 7c2d26e5cf

06-02-2007 09:32:05

Exactly.


You can process SD file in a JSP. Read the file and filter SD fields into an array. When you specify MarvinView, create an advanced layout by defining labels in the cells. Then fill this fields from the array.