Jmol SMILES Correlation Demo

This page demonstrates how you can use Jmol to map the atom numbering of one model to another using Jmol SMILES.
We use NCI/CADD and PubChem as examples of two different sources. Search for a structure such as tylenol, then pick an atom or table entry.
You can also draw a structure using JSME and press test. Or, you could provide two structures of your own by drag-dropping them into the two applets.
Realize that PubChem only has compounds deposited to it. It will fail to load a compound it doesn't have in its database.

NCI/CADD | JSME | PubChem
NCI SMILES: | JSME SMILES: | PubChem SMILES:
Jmol fully elaborated SMILES: Jmol SMILES

How It Works
When a structure is loaded via the JSME test button, the page queries JSME for the SMILES of the drawn compound. This SMILES is passed to NCI/CADD and PubCHEM using Jmol's LOAD command. The page gets a callback to loadCallback() anytime a structure is loaded and requests from the NCI applet its compound's fully elaborated SMILES, evaluating in Jmol show('smiles/hydrogen'). This SMILES is unusual, as it includes every hydrogen atom and indicates "chirality" even at CH3 and CH2 positions.
JSmol then queries both applets for a match to that SMILES using {*}.find(smiles,'map'). The result is a zero-based array of atom indices that match every atom in the SMILES. This atom correlation map can then be used to match atoms in one structure to atoms in the other structure.