Hi Jmol Users,

I tried the following script to compare two SMILES. It works fine.
In the script, the *function Match();* fails to compare. But, by setting 1
second delay of execution it works fine.

*setTimeout(function(){ Match(); }, 1000);*

How to decide the execution time automatically?

<script type="text/javascript">
$(document).ready(function() {
Info = {
j2sPath: "JSmol/j2s",
disableJ2SLoadMonitor: true,
disableInitialConsole: true,
allowjavascript: true
}

$("#App").html(Jmol.getAppletHtml("jmolApplet0", Info));
document.getElementById('App').style.display = 'none';

function Match() {
var x = 'C(C(=CC1O)O)=C(C=1C(C2O)=O)OC=2C(C=CC3O)=CC=3O';
var y = 'C1=CC(=C(C=C1C2=C(C(=O)C3=C(C=C(C=C3O2)O)O)O)O)O';
var query = " 'ANS'.find('SMILES','KEY')".replace(/KEY/, x).replace(/ANS/,
y).replace(/\\/g, "\\\\");
var result = Jmol.evaluateVar(jmolApplet0, query);
if (result > 0) {
document.getElementById('Output').innerHTML = "Both SMILES are
same.<br/>Score: " + result;
} else {
document.getElementById('Output').innerHTML = "Both SMILES are different.";
}
}

Match();
setTimeout(function(){ Match(); }, 1000);
});
</script>

-- 
*T. Ashok Kumar*
Head, Department of Bioinformatics
Noorul Islam College of Arts and Science
Kumaracoil, Thuckalay - 629 180
Kanyakumari District, INDIA
Mobile:- 00 91 9655307178
*E-Mail:* *ashok.bioinformat...@gmail.com <ashok.bioinformat...@gmail.com>*,
             *as...@biogem.org <as...@biogem.org>*
*Website:* *www.biogem.org <http://www.biogem.org>*
&lt;hr&gt;
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to