Looks OK to me, Otis.
But I think I wrote that up incorrectly above. The SMILES check syntax is:
ANSWER.find('SMILES',KEY)>0 not KEY.find('SMILES',ANSWER)>0. The idea is
"See if you can find the correct (KEY value) in this ANSWER", not the other
way around:
function compareSmiles(ans, key) {
var v = " 'ANS'.find('SMILES','KEY')>0"
.replace(/KEY/,key)
.replace(/ANS/,ans)
.replace(/\\/g,"\\\\") return Jmol.evaluateVar(jmolApplet0, v);
}
So, for example:
$ print "C[C@](I)(Br)Cl".find("smiles","*C[C@](I)(Br)Cl*")
5
"I'm looking for a *specific enantiomer* -- does the answer agree?" -- YES
$ print "C[C@@](I)(Br)Cl".find("smiles","*C[C@](I)(Br)Cl*")
5
"I'm looking for a *specific enantiomer* -- does the answer agree?" -- NO
(they are enantiomers)
$ print "CC(I)(Br)Cl".find("smiles","*C[C@](I)(Br)Cl*")
0
"I'm looking for *a specific enantiomer* -- does the answer agree?" -- NO
(because stereochemistry is not defined in the answer)
$ print "CC(I)(Br)Cl".find("smiles","*CC(I)(Br)Cl*")
5
"I'm looking for *either enantiomer* -- does the answer agree?" -- YES
(answer doesn't give it, either)
$ print "C[C@](I)(Br)Cl".find("smiles","*CC(I)(Br)Cl*")
5
"I'm looking for *either enantiomer* -- does the answer agree?" -- YES (I
don't care what stereochemistry is given)
Bob
------------------------------------------------------------------------------
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