User f698d0529d
09-12-2004 18:20:02
Hi
On our Intranet site, we are using MarvinSketch.
As recommended by you in another post in this forum, I am trying to upgrade the version of Marvin in use from 3.3.2 to 3.5.1
However, there are two problems I have seen so far, which are making this not possible. Both of problems issues were not a problem using version 3.3.2
PROBLEM ONE
The first problem is that if the user specifies the SMARTS property Hydgrogen Count on an atom, this is not preserved in the Applet when the user returns to the Search page. All of the other SMARTS properties (Ring count, Ring Size, Connections and Valency) seem to be preserved OK. I have included the HTML which the client receives at the end of this message, and this shows that the SMARTS are still set in the applet parameter.
The way the application works is that client script runs on the search page when the user presses the search button. This client vbscript extracts the drawn molecule using this code
form1.hiddenSMILES.value = document.applets(0).getMol("SMARTS:a")'aromaticise
form1.hiddenMolFile.value = document.applets(0).getMol("mol")
and stores it in two formats - SMILES/SMARTS and the molfile. These are stored in hidden fields on the form.
When the user returns to the search page, the structure they had drawn is set by one of the applet parameters using server side code. I had to do this, rather than using client script to set the applet molecule, because there is no way for client script to detect when the applet has finished its initialisation.
I think problem one is something to do with the following - using version 3.3.2, I used the client script getMol("SMILES:a"), and this produced for example [C;H0] which was OK. If you used getMol("SMARTS:a"), this produced [CH0]. This only happened with Hydrogen count - all the other SMARTS produced for example [CR0] regardless of which parameter you passed to the getMol method.
However, using getMol("SMILES:a") in 3.5.1 does not work if the molecule contains SMARTS (it returns an empty string), so you have to use "SMARTS:a" all the time.
PROBLEM TWO
The second problem is that specifying the applet parameter CleanOpts, which using version 3.3.2 I had set to "e", now causes an error. If you take out the
parameter altogether, the error goes away, but I need to set this parameter. If I do not, then, as you have documented on your webstite, the applet does not behave
correctly where the E/Z stereochemistry around a double bond is unknown. Instead of marking it as unknown, it marks it either as E or Z. I have included the error stack trace at the end of this message.
Thanks
Mark
Applet HTML follows (showing that mol parameter still shows the hydrogen count, but the Marvin applet does not display it)
<APPLET id=Sketcher codeBase=../marvin_3.5.1/ height=350 archive=jmarvin.jar width=550 code=JMSketch name=MarvinSketch VIEWASTEXT>
<PARAM NAME="preload" VALUE="SmilesExport">
<PARAM NAME="molbg" VALUE="#ffffff">
<PARAM NAME="mol" VALUE="\ Marvin 12090417552D\\ 1 0 0 0 0 0 999 V2000\ -0.2187 0.8750 0.0000 C 0 0 0 1 0 0 0 0 0 0 0 0\M MRV SMA 1 [CH0]\M END\">
<PARAM NAME="background" VALUE="#ffffff">
<PARAM NAME="implicitH" VALUE="heteroterm">
<PARAM NAME="explicitH" VALUE="true">
<PARAM NAME="chiralitySupport" VALUE="all">
<PARAM NAME="ezVisible" VALUE="true">
<PARAM NAME="atomStrings" VALUE="smarts">
<PARAM NAME="reactionSupport" VALUE="false">
<PARAM NAME="molFormat" VALUE="mol">
<PARAM NAME="importConv" VALUE="">
<PARAM NAME="queryAtoms" VALUE="any,arom,conn,H,hetero,list,notlist,rings,srs,val">
<PARAM NAME="tmpls0" VALUE=":Generic:chemaxon/marvin/templates/generic.t">
<PARAM NAME="tmpls1" VALUE=":Rings:chemaxon/marvin/templates/rings.t">
<PARAM NAME="tmpls2" VALUE=":Amino acids:chemaxon/marvin/templates/aminoacids.t">
<PARAM NAME="tmpls3" VALUE=":Polycyclics:chemaxon/marvin/templates/polycyclics.t">
<PARAM NAME="tmpls4" VALUE=":Custom:chemaxon/marvin/templates/custom.t">
<PARAM NAME="tmpls5" VALUE=":Alpha-D-Sugars:chemaxon/marvin/templates/ADSUGAR.t">
<PARAM NAME="tmpls6" VALUE=":Aromatics:chemaxon/marvin/templates/aromatics.t">
<PARAM NAME="tmpls7" VALUE=":Bases:chemaxon/marvin/templates/bases.t">
<PARAM NAME="tmpls8" VALUE=":Beta-D-Sugars:chemaxon/marvin/templates/bdsugar.t">
<PARAM NAME="tmpls9" VALUE=":Bicyclics:chemaxon/marvin/templates/bicyclics.t">
<PARAM NAME="tmpls10" VALUE=":Carbonyls:chemaxon/marvin/templates/carbonyls.t">
<PARAM NAME="tmpls11" VALUE=":Chains:chemaxon/marvin/templates/chains.t">
<PARAM NAME="tmpls12" VALUE=":Crown Ethers:chemaxon/marvin/templates/crown.t">
<PARAM NAME="tmpls13" VALUE=":D-Sugars:chemaxon/marvin/templates/dsugars.t">
<PARAM NAME="tmpls14" VALUE=":Functional Groups:chemaxon/marvin/templates/functional_groups.t">
<PARAM NAME="tmpls15" VALUE=":Fused Rings:chemaxon/marvin/templates/fused_rings.t">
<PARAM NAME="tmpls16" VALUE=":Heterocyclic Rings:chemaxon/marvin/templates/heterocyclic_rings.t">
<PARAM NAME="tmpls17" VALUE=":More Rings:chemaxon/marvin/templates/more_rings.t">
<PARAM NAME="tmpls18" VALUE=":Nitrogen:chemaxon/marvin/templates/Nitrogen.t">
<PARAM NAME="tmpls19" VALUE=":Phosphorous:chemaxon/marvin/templates/Phosphorous.t">
<PARAM NAME="tmpls20" VALUE=":Polycyclics_ISIS:chemaxon/marvin/templates/Polycyclics_isis.t">
<PARAM NAME="tmpls21" VALUE=":Rings_ISIS:chemaxon/marvin/templates/rings_isis.t">
<PARAM NAME="abbrevgroups" VALUE="chemaxon/marvin/templates/mcr.abbrevgroup">
<PARAM NAME="xtmpls" VALUE="chemaxon/marvin/templates/custom.t">
<PARAM NAME="extraBonds" VALUE="arom,any,wedge,either">
(YOU CANNOT SEE A JAVA APPLET HERE)</strong></APPLET>
Error message stack trace follows (showing the result of setting the cleanOpts parameter to "e" in the applet HTML)
java.lang.NullPointerException at chemaxon.marvin.common.UserSettings.d(Unknown Source) at
chemaxon.marvin.common.swing.MolPanel.setClean2dOpts(Unknown Source) at chemaxon.marvin.common.swing.MolPanel.propertyChange(Unknown
Source) at chemaxon.marvin.sketch.swing.SketchPanel.propertyChange(Unknown Source) at
java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at chemaxon.marvin.common.swing.m.a(Unknown Source) at
chemaxon.marvin.common.swing.MolPanel.setClean2dOpts(Unknown Source) at chemaxon.marvin.common.swing.MolPanel.propertyChange(Unknown
Source) at chemaxon.marvin.sketch.swing.SketchPanel.propertyChange(Unknown Source) at
java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at chemaxon.marvin.common.UserSettings.d(Unknown Source) at
chemaxon.marvin.common.swing.MolPanel.setClean2dOpts(Unknown Source) at chemaxon.marvin.common.swing.MolPanel.z(Unknown Source) at
chemaxon.marvin.sketch.swing.SketchPanel.z(Unknown Source) at chemaxon.marvin.common.swing.MolPanel.init(Unknown Source) at
chemaxon.marvin.common.swing.MolPanel.init(Unknown Source) at JMSketch.init(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at
java.lang.Thread.run(Unknown Source)
On our Intranet site, we are using MarvinSketch.
As recommended by you in another post in this forum, I am trying to upgrade the version of Marvin in use from 3.3.2 to 3.5.1
However, there are two problems I have seen so far, which are making this not possible. Both of problems issues were not a problem using version 3.3.2
PROBLEM ONE
The first problem is that if the user specifies the SMARTS property Hydgrogen Count on an atom, this is not preserved in the Applet when the user returns to the Search page. All of the other SMARTS properties (Ring count, Ring Size, Connections and Valency) seem to be preserved OK. I have included the HTML which the client receives at the end of this message, and this shows that the SMARTS are still set in the applet parameter.
The way the application works is that client script runs on the search page when the user presses the search button. This client vbscript extracts the drawn molecule using this code
form1.hiddenSMILES.value = document.applets(0).getMol("SMARTS:a")'aromaticise
form1.hiddenMolFile.value = document.applets(0).getMol("mol")
and stores it in two formats - SMILES/SMARTS and the molfile. These are stored in hidden fields on the form.
When the user returns to the search page, the structure they had drawn is set by one of the applet parameters using server side code. I had to do this, rather than using client script to set the applet molecule, because there is no way for client script to detect when the applet has finished its initialisation.
I think problem one is something to do with the following - using version 3.3.2, I used the client script getMol("SMILES:a"), and this produced for example [C;H0] which was OK. If you used getMol("SMARTS:a"), this produced [CH0]. This only happened with Hydrogen count - all the other SMARTS produced for example [CR0] regardless of which parameter you passed to the getMol method.
However, using getMol("SMILES:a") in 3.5.1 does not work if the molecule contains SMARTS (it returns an empty string), so you have to use "SMARTS:a" all the time.
PROBLEM TWO
The second problem is that specifying the applet parameter CleanOpts, which using version 3.3.2 I had set to "e", now causes an error. If you take out the
parameter altogether, the error goes away, but I need to set this parameter. If I do not, then, as you have documented on your webstite, the applet does not behave
correctly where the E/Z stereochemistry around a double bond is unknown. Instead of marking it as unknown, it marks it either as E or Z. I have included the error stack trace at the end of this message.
Thanks
Mark
Applet HTML follows (showing that mol parameter still shows the hydrogen count, but the Marvin applet does not display it)
<APPLET id=Sketcher codeBase=../marvin_3.5.1/ height=350 archive=jmarvin.jar width=550 code=JMSketch name=MarvinSketch VIEWASTEXT>
<PARAM NAME="preload" VALUE="SmilesExport">
<PARAM NAME="molbg" VALUE="#ffffff">
<PARAM NAME="mol" VALUE="\ Marvin 12090417552D\\ 1 0 0 0 0 0 999 V2000\ -0.2187 0.8750 0.0000 C 0 0 0 1 0 0 0 0 0 0 0 0\M MRV SMA 1 [CH0]\M END\">
<PARAM NAME="background" VALUE="#ffffff">
<PARAM NAME="implicitH" VALUE="heteroterm">
<PARAM NAME="explicitH" VALUE="true">
<PARAM NAME="chiralitySupport" VALUE="all">
<PARAM NAME="ezVisible" VALUE="true">
<PARAM NAME="atomStrings" VALUE="smarts">
<PARAM NAME="reactionSupport" VALUE="false">
<PARAM NAME="molFormat" VALUE="mol">
<PARAM NAME="importConv" VALUE="">
<PARAM NAME="queryAtoms" VALUE="any,arom,conn,H,hetero,list,notlist,rings,srs,val">
<PARAM NAME="tmpls0" VALUE=":Generic:chemaxon/marvin/templates/generic.t">
<PARAM NAME="tmpls1" VALUE=":Rings:chemaxon/marvin/templates/rings.t">
<PARAM NAME="tmpls2" VALUE=":Amino acids:chemaxon/marvin/templates/aminoacids.t">
<PARAM NAME="tmpls3" VALUE=":Polycyclics:chemaxon/marvin/templates/polycyclics.t">
<PARAM NAME="tmpls4" VALUE=":Custom:chemaxon/marvin/templates/custom.t">
<PARAM NAME="tmpls5" VALUE=":Alpha-D-Sugars:chemaxon/marvin/templates/ADSUGAR.t">
<PARAM NAME="tmpls6" VALUE=":Aromatics:chemaxon/marvin/templates/aromatics.t">
<PARAM NAME="tmpls7" VALUE=":Bases:chemaxon/marvin/templates/bases.t">
<PARAM NAME="tmpls8" VALUE=":Beta-D-Sugars:chemaxon/marvin/templates/bdsugar.t">
<PARAM NAME="tmpls9" VALUE=":Bicyclics:chemaxon/marvin/templates/bicyclics.t">
<PARAM NAME="tmpls10" VALUE=":Carbonyls:chemaxon/marvin/templates/carbonyls.t">
<PARAM NAME="tmpls11" VALUE=":Chains:chemaxon/marvin/templates/chains.t">
<PARAM NAME="tmpls12" VALUE=":Crown Ethers:chemaxon/marvin/templates/crown.t">
<PARAM NAME="tmpls13" VALUE=":D-Sugars:chemaxon/marvin/templates/dsugars.t">
<PARAM NAME="tmpls14" VALUE=":Functional Groups:chemaxon/marvin/templates/functional_groups.t">
<PARAM NAME="tmpls15" VALUE=":Fused Rings:chemaxon/marvin/templates/fused_rings.t">
<PARAM NAME="tmpls16" VALUE=":Heterocyclic Rings:chemaxon/marvin/templates/heterocyclic_rings.t">
<PARAM NAME="tmpls17" VALUE=":More Rings:chemaxon/marvin/templates/more_rings.t">
<PARAM NAME="tmpls18" VALUE=":Nitrogen:chemaxon/marvin/templates/Nitrogen.t">
<PARAM NAME="tmpls19" VALUE=":Phosphorous:chemaxon/marvin/templates/Phosphorous.t">
<PARAM NAME="tmpls20" VALUE=":Polycyclics_ISIS:chemaxon/marvin/templates/Polycyclics_isis.t">
<PARAM NAME="tmpls21" VALUE=":Rings_ISIS:chemaxon/marvin/templates/rings_isis.t">
<PARAM NAME="abbrevgroups" VALUE="chemaxon/marvin/templates/mcr.abbrevgroup">
<PARAM NAME="xtmpls" VALUE="chemaxon/marvin/templates/custom.t">
<PARAM NAME="extraBonds" VALUE="arom,any,wedge,either">
(YOU CANNOT SEE A JAVA APPLET HERE)</strong></APPLET>
Error message stack trace follows (showing the result of setting the cleanOpts parameter to "e" in the applet HTML)
java.lang.NullPointerException at chemaxon.marvin.common.UserSettings.d(Unknown Source) at
chemaxon.marvin.common.swing.MolPanel.setClean2dOpts(Unknown Source) at chemaxon.marvin.common.swing.MolPanel.propertyChange(Unknown
Source) at chemaxon.marvin.sketch.swing.SketchPanel.propertyChange(Unknown Source) at
java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at chemaxon.marvin.common.swing.m.a(Unknown Source) at
chemaxon.marvin.common.swing.MolPanel.setClean2dOpts(Unknown Source) at chemaxon.marvin.common.swing.MolPanel.propertyChange(Unknown
Source) at chemaxon.marvin.sketch.swing.SketchPanel.propertyChange(Unknown Source) at
java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source) at chemaxon.marvin.common.UserSettings.d(Unknown Source) at
chemaxon.marvin.common.swing.MolPanel.setClean2dOpts(Unknown Source) at chemaxon.marvin.common.swing.MolPanel.z(Unknown Source) at
chemaxon.marvin.sketch.swing.SketchPanel.z(Unknown Source) at chemaxon.marvin.common.swing.MolPanel.init(Unknown Source) at
chemaxon.marvin.common.swing.MolPanel.init(Unknown Source) at JMSketch.init(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at
java.lang.Thread.run(Unknown Source)