importStructure Function with smiles

User 247a2c5018

09-03-2016 09:56:55

Hi, 


 


i used your example to set a molecule : 


 








































































































































































































































<script>

var marvinSketcherInstance;

$(document).ready(function handleDocumentReady (e) {
MarvinJSUtil.getEditor("#sketch").then(function (sketcherInstance) {
marvinSketcherInstance = sketcherInstance;
marvinSketcherInstance.importStructure("mol", s).catch(function(error) {
alert(error);
});
initControls();
},function (error) {
alert("Cannot retrieve sketcher instance from iframe:"+error);
});
});

function initControls () {

// Reset mol button
$("#btn-setmol").on("click", function (e) {
marvinSketcherInstance.importStructure("mol",s);
});
}

var s = "\n\n\n"+
" 14 15 0 0 0 0 0 0 0 0999 V2000\n"+
" 0.5089 7.8316 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 1.2234 6.5941 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 1.2234 7.4191 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" -0.2055 6.5941 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" -0.9200 7.8316 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 0.5089 5.3566 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" -0.2055 7.4191 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 0.5089 6.1816 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" -0.9200 6.1816 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 0.5089 8.6566 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 2.4929 7.0066 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 2.0080 7.6740 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 2.0080 6.3391 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 2.2630 8.4586 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n"+
" 1 7 1 0 0 0 0\n"+
" 8 2 1 0 0 0 0\n"+
" 1 3 1 0 0 0 0\n"+
" 2 3 2 0 0 0 0\n"+
" 7 4 1 0 0 0 0\n"+
" 4 8 1 0 0 0 0\n"+
" 4 9 2 0 0 0 0\n"+
" 7 5 1 0 0 0 0\n"+
" 8 6 1 0 0 0 0\n"+
" 1 10 2 0 0 0 0\n"+
" 3 12 1 0 0 0 0\n"+
" 2 13 1 0 0 0 0\n"+
" 13 11 2 0 0 0 0\n"+
" 12 11 1 0 0 0 0\n"+
" 12 14 1 0 0 0 0\n"+
"M END\n";

</script>


 


but i would like to replace mol by smiles and it doesn't work :


 


<script>


 


var marvinSketcherInstance;


 


$(document).ready(function handleDocumentReady (e) {


MarvinJSUtil.getEditor("#sketch").then(function (sketcherInstance) {


marvinSketcherInstance = sketcherInstance;


marvinSketcherInstance.importStructure("smiles", s).catch(function(error) {


alert(error);


});


initControls();


},function (error) {


alert("Cannot retrieve sketcher instance from iframe:"+error);


});


});


 


function initControls () {


 


// Reset mol button


$("#btn-setmol").on("click", function (e) {


marvinSketcherInstance.importStructure("smiles",s);


});


}


 


var s = "CC(=O)Oc1ccccc1C(O)=O";


 


</script>


 


why?


 


Kiet


ChemAxon 76c88f5366

09-03-2016 11:16:09

Hi Kiet,


I have tested your code in our environment, and it worked for me.


For SMILES import-export Marvin JS needs web service connection. Please check, whether the web service is available for the application:


* Please check if the location of the web service was set for Marvin JS. (If not, there is an example, how to set/reset it:  https://marvinjs-snapshot.chemaxon.com/marvin4js-stable-latest-snapshot/examples/example-customize-service.html)


* Please check also the network traffic of your browser. 


Please let us know your findings.


Any information would help to find a solution for this problem. 


Best regards,
Eszter

User 247a2c5018

09-03-2016 13:47:21

hi Eszter,


no web services connection set, so that's why it doesn't work



ChemAxon 76c88f5366

10-03-2016 12:30:06

Thank you for your reply.


Do you need any assistance from our side? 

User 247a2c5018

10-03-2016 13:07:47

No tried yet but it looks very hard to integrate Marvinjs compared to marvinsketch and Marvin view...

ChemAxon f052bdfe3c

16-03-2016 13:01:03

It is different, but we hope it worth the effort.


Best regards,


Efi

User 247a2c5018

29-04-2016 08:17:36

Hi,


 


i'm trying to install webservices release 14.11.170.0 and i have few questions : 


 


1- why jdk-6u45 is required? could we install jdk 7?


2- in the installation guide, a license.cxl is noted. Which plugin license do I need?


I have already a license.cxl containing Jchem cartridge, marvin server, calculator plugins license. Is it enough for webservices use?


 


best 


 


Kiet

ChemAxon 13811e1703

02-05-2016 13:36:38

Hi Kiet,


 1. You can use also jdk 7 for that version. (Although I recommend using the latest version, and please note that since version 16.2.29.0  only Java 8 is supported! https://restdemo.chemaxon.com/docs/installationguide.md)

2. You can use JChem Web Services with the MarvinJS license, if you need only the functionality that is supported by MarvinJs. I suppose that is enough for you.

(For full functionality you would need JChem Web Services license and optionally separate licenses for doing some special calculations like structure2name or standardization, etc., https://restdemo.chemaxon.com/apidocs/)


Regards,
Peter