Wow, this is terrific!
A few comments:
Something in that load is usurping the $ jQuery alias. Glad to see Jmol
does not care. (This is the magic of the Google Closure Compiler and
anonymous functions.) So that's throwing an error in your loading script.
You could trim down that code (I'm sure you know) that you copied from
chemapps. All the xxxx stuff, for example. No need for that.
You can get essentially any small molecule within Jmol with the prefix $:
load $caffeine
load $2-bromo-3-nitrobenzene # note the incorrect name - still works!
load $tylenol
This uses the NCI resolver (http://cactus.nci.nih.gov/chemical/structure).
There is no longer any need to save such files on your own. (Provided that
server is up...)
You can get any PDB ligand using ==
load ==hem
You can access standard InChI and standard InChIKeys using pubChem and ":"
load :inchikey:RYYVLZVUVIJVGH-UHFFFAOYSA-N
I got that from the following at your blog using:
show chemical stdinchikey
Actually, from the developer console, I used:
Jmol.evaluateVar(jmolApplet0,"show('chemical stdinchikey')")
Note that "std" there is important -- PubChem keys models on standard
InChIKeys specifically.
$show chemical inchikey
InChIKey=RYYVLZVUVIJVGH-UHFFFAOYSA-N
$show chemical stdinchikey
InChIKey=RYYVLZVUVIJVGH-UHFFFAOYNA-N
(Henry can tell us why there is a difference there.)
You can also use SMILES at NCI:
load $C\C=C/C#C
or PubChem:
load :smiles:C\C=C/C#C
The difference there is that at PubChem the chemical you want has to be in
their database; at NCI, they will use Peter Murray-Rust's incredible OPSIN
program to determine the structure from the name. No database necessary!
Jmol can create SMILES code natively. So the following code takes a
currently loaded molecule and reloads the equivalent from NCI:
load @{"$" + {*}.find("SMILES")}
or from PubChem:
load @{":smiles:" + {*}.find("SMILES")}
And the following loads it from PubChem if it finds it, and if not, from
NCI:
s = {*}.find("SMILES")
try {
load @{":smiles:"+s}
} catch(e) {
load @{"$"+s}
}
etc. etc.
Bob
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users