Thanks for the very fast response Otis.  Yes, I had forgotten about the
problem with '\' characters, and your solution works perfectly.

Many thanks,
Mike



Dr Mike Casey
School of Chemistry
UCD
Dublin
01 716 2420

On 6 May 2016 at 16:15, Otis Rothenberger <osrot...@icloud.com> wrote:

> Mike,
>
> I can’t comment on your SMARTS question, but your first question relates
> to escaping JavaScript strings. Hopefully, the first two lines (regular
> expression replace) of my compare function are self explanatory:
>
> function compSmiles(key, ans) {
>         key = key.replace(/\\/g, '\\\\');
>         ans = ans.replace(/\\/g, '\\\\');
>         return jmv("'" + key + "'.find('SMILES','" + ans + "') > 0");
> }
>
> If you need further explanation, let me know.
>
> Otis
>
> --
> Otis Rothenberger
> o...@chemagic.org
> http://chemagic.org
>
> > On May 6, 2016, at 11:00 AM, Mike Casey <mike.ca...@ucd.ie> wrote:
> >
> > I have only just returned to active use of Jmol, so I apologise if the
> following questions have been dealt with in the two years that I have not
> been paying attention.
> >
> > First a SMILES issue.  I use Jmol.evaluateVar (Jmol 14.4.4 2016-04-22)
> to check whether a structure drawn by a student in JSME (2013-06-09) is
> correct, but get odd behaviour when comparing SMILES strings for geometric
> isomers of alkenes.  The following examples, in which actual SMILES strings
> are shown, rather than variable names, for clarity, are indicative.
> >
> > C/C=C\C.find("SMILES", C/C=C/C)  does not give a match, as expected, but
> >
> > C/C=C/C.find("SMILES", C/C=C\C)  DOES give a match!
> >
> > In passing, it seems that the most recent distribution of JSME seems to
> have lost the ability to generate SMILES strings with stereochemical
> information for alkenes.
> >
> >
> > Searching for partial structures using SMILESstring.find("SMARTS",
> SMARTSstring) worked perfectly with an older version of Jmol (13.2.7), but
> v14.4.4 is different.  For example, checking for the presence of an alcohol
> functional group using
> >
> > CCCO.find("SMARTS", [#6,H]C([OH])([#6,H])[#6,H])
> >
> > gave a match in the old version, but not in the new one.  It is
> necessary to add explicit hydrogens on the O and the carbinol C to get a
> match in v14.4.4.
> >
> > Am I missing something, or are these real issues?  The SMILES & SMARTS
> features in Jmol are extremely useful, and I look forward to any comments
> or suggestions.
> >
> > Mike Casey
> >
> >
> ------------------------------------------------------------------------------
> > Find and fix application performance issues faster with Applications
> Manager
> > Applications Manager provides deep performance insights into multiple
> tiers of
> > your business applications. It resolves application problems quickly and
> > reduces your MTTR. Get your free trial!
> >
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
> > Jmol-users mailing list
> > Jmol-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications
> Manager
> Applications Manager provides deep performance insights into multiple
> tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to