Although I don't have demo pages, the latest prerelease of Jmol, 12.0.RC10
at http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol-11.jar should have
greatly expanded SMILES and SMARTS capability. Two new functions:

  select smiles("......")

and

  select smarts("......")

are added, which deprecate

  select substructure("....")

The problem with substructure() is that it uses SMILES strings, which are
really whole-molecule descriptors and not meant for substructure searching.
That's what SMARTS are for [
http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html]. So while I'm
not saying I've fully implemented SMARTS or SMILES, some important
improvements are now in place. In particular:

select smarts("...")

allows a more natural search:

select smarts("C(C)=CC")

rather than

select smiles("[C]([C])=[C][C]")

More importantly, double bond, tetrahedral, and allenic stereochemistry are
now available. So you can quickly find out, for example, if a double bond is
cis or trans:

  select smarts("C/C=C/C")  # trans only

  select smarts("C/C=C\\C")  # cis only

And you can check stereochemistry around a tetrahedral or allenic center:

  select smarts("C(F)[...@](Cl)H")

  select smarts("C(F)(H)=[C@@]=C(Cl)H")

The more general form of this function allows finding ALL matches:

  allTrans = {*}.find("smarts","C/C=C/C")


Note that now you can also find SMILES or SMARTS within smiles strings, so
the following allows a quick test of the equivalence of two SMILES strings:

print "CCC(O)C".find("smiles",anotherSmilesString)

If anotherSmilesString is functionally identical to "CCC(O)C", no matter how
it is written, Jmol will report "1", otherwise it will report "0".

FIND with the "smarts" option allows a simple substructure search of SMILES
strings:

  print "CCCC".find("smarts","CCC")

prints "1" meaning it was found;

  print "CCCC".find("smarts","CCC", true)

prints "2" meaning there are two total;

If this is done on an atom selection instead of a string, then the return is
one or more atom sets:
   print {atomno < 18}.find("smarts","CC")

({6 7})
({8 16})
({9 11})
({9 15})
({10 12})
({13 14})

   print {atomno < 18}.find("smarts","CC")[2]

({8 16})

I suppose at some point I need to make Jmol create SMILES strings, but I
don't have that yet.

Useful?

Bob

-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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
------------------------------------------------------------------------------
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to