Thanks for looking into the problem Bob, I don’t know how you find the time to do so much development work, and still manage to babysit people like me.

 

I’ll try the latest version and report.  Just in case it matters, my previous results were obtained in webpages incorporating the HTML5 version of Jmol; I didn’t try the app.

 

Many thanks,

Mike

 

From: Robert Hanson [mailto:hansonr@stolaf.edu]
Sent: 18 October 2013 14:08
To: jmol-users@lists.sourceforge.net
Subject: Re: [Jmol-users] Problem with SMARTS searching using JSmol

 

Hmm, this is working as well:


x = Jmol.evaluate(jmolApplet0, "'CCCC'.find('SMARTS','[#6]')")

both in 13.2 and 13.3.  Could it just be a version issue? Please try 13.2.7 or 13.3.7

Bob

 

On Fri, Oct 18, 2013 at 8:00 AM, Robert Hanson <hansonr@stolaf.edu> wrote:

Sorry for the delay in getting back to you, Mike. I've been totally focused on converting JSpecView to JavaScript. Much success, but not trivial by any means!!



However, searching a string for a SMARTS string does not work, e.g.

X  = Jmol.evaluate(myJSmol, '"CCCC".find("SMARTS","[#6]")'

);    // X is ERROR

 

This works fine in the app:

 

$ print "CCCC".find("SMARTS","[#6]")
1
5
8
11

 

and this in the JavaScript version of the console:

 

print "CCCC".find("SMARTS","[#6]")

 

1
5
8
11

 

So there must be a problem with Jmol.evaluate() itself. Stand by....

 

 

 

On Wed, Oct 9, 2013 at 6:19 AM, Mike Casey <mike.casey@ucd.ie> wrote:

Hi All,

 

In the context of developing a tutorial site I need to compare user generated (JSME) SMILES strings with the “correct” SMARTS strings without loading the structure into JSmol (the intention is that the user can subsequently opt to use JSmol to view the structure if they wish).  The powerful SMILES and SMARTS features of JSmol seemed ideal for this purpose, but I have run into some difficulties, as listed below. 

 

Searching an atom expression (when a structure is present in JSmol) for a SMARTS string works, e.g.

X  = Jmol.evaluate(myJSmol, '{*}.find("SMARTS","[#6]")');    //Works as expected

 

However, searching a string for a SMARTS string does not work, e.g.

X  = Jmol.evaluate(myJSmol, '"CCCC".find("SMARTS","[#6]")');    // X is ERROR

 

On the other hand, calculating a molecular formula from a SMARTS string (or an atom expression) does work, e.g.

X  = Jmol.evaluate(myJSmol, '"CCCC".find("SMARTS","MF")');  //X is C 4  Correct!!!

 

I would be very grateful if anyone can identify what I am doing wrong, or suggest an alternative approach.

 

Mike

 

Dr Mike Casey
School of Chemistry & Chemical Biology
University College Dublin
Dublin 4
Ireland

 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users




--

Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900




--

Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900