Bob, This is very nice indeed, but after testing various Smiles strings on your demo page, the results are mixed. When extra hydrogens are added to a structure (e.g. trans-4-methylcyclohexanol), the new Smiles matches the one from the same structure lacking the hydrogens. However, if the same Smiles string lacking the hydrogens is compared with itself your demo reports they are different. Curiously, comparing identical strings from the added hydrogen structures reports a match.
My chief interest concerns the comparison of strings in which added hydrogens are not present. This is usually the way in which I ask students to write stereo-formulas with JME, because in most cases the formulas are unambiguous and require less drawing. Your demo does not recognize different Smiles strings from identical structures unless extra hydrogens are added to at least one of the strings. If you really want to test your ability to recognize different strings created by drawing the same structure in different ways use inositol as a model. Myoinositol can have adozen different strings. Bill Robert Hanson wrote: > It doesn't matter how you draw the structure. > > It doesn't matter if you include extra hydrogen atoms or not, because > what Jmol is doing is creating a topologically (though not > dimensionally) correct model from the SMILES string, then checking it. > So it doesn't matter how you indicate H atoms or what order the > stereochemical notation of the SMILES string ends up being. It should > work. > > Jmol should give a definitive answer as to whether the structure drawn > matches your specified SMILES string, as long as your string is valid. > Or, if you wish, it can tell you if a subset of the SMILES string is > some particular grouping of atoms, with or without stereochemistry. > > JmolSmilesApplet.jar > ----------------------------- > > You can see a demo of this at > http://chemapps.stolaf.edu/jmol/docs/examples-11/JmolSmiles.htm > > This page uses a mini-version of Jmol that I just made that JUST does > ONE THING -- checks SMILES strings for patterns. It's just 41K in > size. But you can use Jmol itself if you want. This mini version just > has one function: > > var retValue = document.getElementById("JmolSmiles1").find("pattern", > "smilesString", asSMARTS, isAll) > > where > > asSMARTS (true or false) indicates whether you want a substructure > search (SMARTS, true) or an exact search (SMILES, false) > > isAll indicates whether you want Jmol to return the total number of > matches or just the number 1 indicating a match and 0 indicating no > match. (-1 means there was an error handling the string) > > > 3D: > > Jmol will also check a 3D model against a SMILES string or a SMARTS > pattern. Within Jmol, this is done within the SELECT command using the > smiles() function (for exact match) or using the search() function > (for a substructure search). You can also use this construct within Jmol: > > Var x = {*/1.1}.find("smarts","C=O", true) > > This function is actually VERY powerful and can return either a set of > all matching atoms (false) or a list of sets of atoms (true). I've > added one bit to SMARTS -- so I'm calling it now "3D-SEARCH" -- that > allows you to select out WHICH atoms you want returned. To do this, > just add { } around the atoms you want returned. > > So, for example: > > print {*}.find("a") # all aromatic atoms > > print {*}.find("{C}=O") # all carbonyl carbons > > print {*}.find("{C}=CC(=O)[O,N]") # all beta carbons on alpha-beta > conjugated esters or amides > > Cool, huh? > > The only problem with matching a 3D structure may be with what other > programs use to define "aromatic". Jmol should do just fine with > structures that are typically aromatic. In addition, though, it will > assign all the ring carbons of quinone to be aromatic as well (which > is what JME does). Basically it defines aromatic as "flat ring that is > all sp2-hybridized" regardless of what the bonding indicates. (This is > kind of cool, because you can then use it in PDB files to find all the > aromatic rings in HIS, TYR, TRP, A, T, C, G, etc.) > > Bob > > ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ _______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users