Bug in Marvin JS 14.8.4 ?

User 26d9368720

07-08-2014 15:23:30

Hi,


We have got gwt exception when use importAsMrv(). Below browser's log


[marvin UnchaughtException]:Class$S1159: (TypeError)


__gwt$exception: <skipped>: undefined is not a function gui-0.js:3960


No matter what mrv data used. It happens every time.


Only importAsMrv(null) works fine - it clears the screen without exceptions.


So we guess problem with rendering (also taking into account gwt exception)


Opposite function exportAsMrv() works well.


Previous release (but ~one year older) on our production site works well..


Is there way to fix this situation?


Ps. Checked out under Chrom, FF, Opera.. 


Pss. mrv sample


<?xml version="1.0"
encoding="windows-1251"
?>

 



- <cml version="ChemAxon file format v6.0, generated by v6.0.3">



- <MDocument>



- <MChemicalStruct>



- <molecule molID="m1">



  <atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22
" elementType="C O C C C C C C C O N C N C
C S C C C C C C
" x2="-1.333679121828033 2.6645352591003757E-15
3.552713678800501E-15 1.3336791218280424 1.3336791218280415
4.440892098500626E-15 -1.3336791218280304 -1.3336791218280313
5.329070518200751E-15 -1.3336791218280304 1.3336791218280406 1.333679121828041
2.579565293165459 2.1036791218280406 0.563679121828041 0.08779295049062164
3.00886841035845 4.540432129225595 5.445621417756003 4.819246987419271
3.28768326855213 2.38249398002172
"
y2
="6.929999999999999 6.160000000000001 4.62
3.8499999999999988 2.309999999999998 1.5399999999999983 2.309999999999998
3.8499999999999988 -8.881784197001252E-16 -0.7700000000000005
-0.7700000000000014 -2.3100000000000014 -3.215189288530409 -4.679816323624946
-4.679816323624946 -3.21518928853041 -5.925702494962365 -5.764728661530177
-7.010614832867597 -8.4174748376372 -8.578448671069388
-7.332562499731971
" />



- <bondArray>



  <bond atomRefs2="a1 a2"
order
="1"
/>



  <bond atomRefs2="a2 a3"
order
="1"
/>



  <bond atomRefs2="a3 a4"
order
="2"
/>



  <bond atomRefs2="a4 a5"
order
="1"
/>



  <bond atomRefs2="a5 a6"
order
="2"
/>



  <bond atomRefs2="a6 a7"
order
="1"
/>



  <bond atomRefs2="a7 a8"
order
="2"
/>



  <bond atomRefs2="a3 a8"
order
="1"
/>



  <bond atomRefs2="a6 a9"
order
="1"
/>



  <bond atomRefs2="a9 a10"
order
="2"
/>



  <bond atomRefs2="a9 a11"
order
="1"
/>



  <bond atomRefs2="a11 a12"
order
="1"
/>



  <bond atomRefs2="a12 a13"
order
="2"
/>



  <bond atomRefs2="a13 a14"
order
="1"
/>



  <bond atomRefs2="a14 a15"
order
="2"
/>



  <bond atomRefs2="a15 a16"
order
="1"
/>



  <bond atomRefs2="a12 a16"
order
="1"
/>



  <bond atomRefs2="a14 a17"
order
="1"
/>



  <bond atomRefs2="a17 a18"
order
="2"
/>



  <bond atomRefs2="a18 a19"
order
="1"
/>



  <bond atomRefs2="a19 a20"
order
="2"
/>



  <bond atomRefs2="a20 a21"
order
="1"
/>



  <bond atomRefs2="a21 a22"
order
="2"
/>



  <bond atomRefs2="a17 a22"
order
="1"
/>


  </bondArray>



  </molecule>



  </MChemicalStruct>



  </MDocument>



  </cml>


ChemAxon 996dedebe0

08-08-2014 11:06:28

Dear mikky,


 


importAsMrv() function is deprecated, and we are going to remove it. I suggest you to use importStructure() as described in this example. we also recommend you to use exportStructure() instead of exportAsMrv(). However we will look after the issue, to be sure it does not belong to other problems.


all the best,


Janos

User 26d9368720

08-08-2014 14:58:36

Thank you for your reply.


I tried importStructure() like 


el.importStructure('mrv', mol);


result:


[marvin UnchaughtException]:Class$S1159: (TypeError)
__gwt$exception: <skipped>: undefined is not a function
gui-0.js:3960


BUT when I used MOL format (sample from you example link)  then no problem - it works.


With mrv data both function do not work.


Due to this issue we cannot update our production env on last marvin version.


I would like to point that we already have all this stuff working with older marvin js..


Maybe it makes sense to note that MRV data is still generated by older version of JChem - 6.0.3.


 


 



ChemAxon 996dedebe0

08-08-2014 18:04:47

Hi,


 


I've removed trhe unneccessary dashes (first characters in line 1,2,3,4 and 9) from your molecule, then i pasted to this example (ofc, i changed the format to MRV). It worked for me perfectly. Please try it and notify us, if it does not work. In the example, you can see what code has to be used.


 


i would like to point on an important difference:


old version was:


$(document).ready(function handleDocumentReady (e) {
getMarvinPromise("#sketch").done( 
........

but the new one is:


$(document).ready(function handleDocumentReady (e) {
MarvinJSUtil.getEditor("#sketch").then(
........ 

please double check if this change causes the trouble. If i can help you with anything, please contact us again, we'll reply swiftly.


 


Regards,


 


Janos

User 26d9368720

11-08-2014 08:25:19

Hi,


i've solved this issue.


Problem was in parameter type. Our code passed Object.array to js marvin and it failed


Old marvin did not make any difference: both types were ok. JChem applet also accepts both types.


So explicit toString() solves the issue.


Thanx for your help


 


 


 

ChemAxon f052bdfe3c

13-08-2014 13:40:12

Thank you for the information.


Best regards,


Efi