Bob,

I'm not sure how stable it is, but the JS function below works. I'm also 
not sure how cross browser (platform) friendly it is. My Mac buddy is OOO 
for six weeks.

If a PubChem molfile with partial chages is pasted into our model kit 
script field on the Molecular Editor screen and then run, the PubChem model 
will load with partial charges:

http://chemagic.com/web_molecules/script_page_large.aspx

In the function, I display the MEP on load because that seems to light-up 
the Jmol menu's Surfaces/MEP selection, but this light-up is erratic. 
Nevertheless, Jmols script will display the MEP. Here are three PubChem SDF 
links for getting cut/paste files for testing:

cholesterol
http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=5997&disopt=3DDispla
ySDF

benzoquinone
http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=4650&disopt=3DDispla
ySDF

And a pretty one Aspirin
http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=2244&disopt=3DDispla
ySDF

In some cases the charges are pretty primitive, but the MEP's get the point 
across. As you can see above, direct loading of the file requires the 
PubChem CID. By finagling, I think these can be pulled from a PubChem 
InChiKey query via Resolver. More to the point, I'm going to write to 
Markus about the possibility of Resolver returning PubChem CID's directly 
on a SMILES query. I'm betting these are already in Resolver's many 
database connections.

Even if this does not work out, the PubChem SDF's are available via a name 
search and two clicks at the PubChem site. This puts MEP display for lots 
of models within reach of high school chemistry classes. What I'm really 
after, however is:

1) Draw a simple structure in JME
2) Load it into Jmol
3) Click a link that takes you to PubChem for this Model
We have it to this point. The last is within reach.
4) Load the MEP of the model that started in JME directly from PubChem 
data.

The JS function, in my usual verbose and chaotic style, follows.

Otis

function pcpc() {
    var mf = document.getElementById("script").value;
    if (mf.toUpperCase().indexOf("PUBCHEM_MMFF94_PARTIAL_CHARGES") < 0) { 
return; }
    mf = mf.replace(/(\r\n|\n|\r)/gm, "|");
    var scpt1 = ""; var scpt2 = "";
    var re = /PARTIAL_CHARGES>\|(.*?)\|\|/;
    var chgis;
    var chgDs = mf.match(re);
    var chgs = chgDs[1].split("|");
    for (var x = 1; x <= chgs[0]; x++) {
        chgis = chgs[x].split(" ");
        scpt1 += "{atomno=" + chgis[0] + "}.partialCharge=" + chgis[1] + 
";"
    }
    scpt2 = "{*}.partialCharge = 0;" + scpt1 + "isosurface vdw 80% map mep 
translucent;";
    jmolScript(scpt2);
}

--


Otis Rothenberger

Department of Chemistry

Illinois State University
Normal, IL 61790-4160

http://chemagic.org


----------------------------------------
From: "Robert Hanson" <[email protected]>
Sent: Tuesday, January 18, 2011 6:55 PM
To: [email protected], [email protected]
Subject: Re: [Jmol-users] PubChem SDF 

Of course, Otis is so good at JavaScript, he could easily write a little 
JavaScript parser for this....;)

 
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to