Tuesday, 11 December 2007

Using Jmol for Drug Design - Installation

Jmol is well known as the program for showing 3D structures in webpages. It's free, it's open source and it has excellent support. However, I've often felt that Jmol's potential is not being fully realised by chemists in general, and by me in particular. So this series of posts will describe how to use Jmol to create publication quality pictures of drug molecules in a protein active site. More about that in the next post; first we have to install Jmol.

I'm going to be running Jmol as an applet in Firefox on my Win XP machine. Note that Jmol also comes as a stand-alone application. The benefit in running Jmol in a web browser is that you have access to the JavaScript scripting language. The only downside is that you need to remember to use the signed applet (as described below) or else you will have problems opening files at arbitary locations on your computer.

Step one is to download the absolutely latest Jmol. If you look at the download page, see under Jmol Prerelease Tests for the cutting edge (currently 11.3.54). There's a new version practically every day. The file you want is called something like jmol-11.3.54-binary.zip. Download and unzip the file into something like D:\Tools\Jmol\jmol-11.3.54.

Next, download the protein structure 1hnn from the PDB and save as something like D:\Proteins\1hnn.pdb.

Now we can create the "Hello World" of Jmol applets, which simply loads and displays the protein structure you have just downloaded. Save the following code as something like D:\Applet\HelloWorld.htm. You should change the paths in the following HTML to correspond to the actual paths on your computer:
<html>
<head>
<script type="text/javascript"
src="file:///D:/Tools/Jmol/jmol-11.3.54/Jmol.js">
</script>
</head>
<body>
<script type="text/javascript">
jmolInitialize("file:///D:/Tools/Jmol/jmol-11.3.54", true);
var jmolcmds = [
"load file:///D:/Proteins/1hnn.pdb",
];
jmolApplet(700, jmolcmds.join("; "));
</script>
</body>
</html>

Open the HTML file with Firefox. The first time you do this, you will be asked whether you trust Jmol to access your hard drive responsibly. You should say yes to this if you wish to proceed. This warning indicates that you are using the signed applet rather than the unsigned applet. Using the signed applet on a live website will probably discourage users, so is best avoided, but it is very useful when running locally on your machine, as the unsigned applet is restricted to opening files in particular directories.

The next post takes Jmol to the next level, uh, level 2.

8 comments:

Egon Willighagen said...

He, how did you do that HTML coloring? Did you do that from within blogger? Or used some external tool to create colored HTML code which you copy-pasted?

Noel O'Boyle said...

The second option. I use gvim. I set it up so that when I press CTRL+H it gives me coloured HTML corresponding to whatever code is in the window. It's explained at http://www.redbrick.dcu.ie/~noel/vim.html. Don't ask me how it works :-)

Felix said...

so the trick is the "true". I thought you just could not run a local file in your browser.

i am looking forward to your posts but I don't think you can beat pymol :)

Egon Willighagen said...

Felix, Jmol *already* beats the hell out of PyMol. PyMol does not run in FireFox!

(Or: depends on what you want... Jmol and PyMol deliberately different scopes, en deliberately keep it that way. Warren has done an excellent job)

Felix said...

but this article is about producing publication style pictures.
pymol has really nice features for selecting parts of the molecule interactively. and its raytraced pictures look better than with jmol and povray in my opinion
jmol is nice for other things: vibrations, optimisations, dynamics and of course applets

Noel O'Boyle said...

We can do a Jmol and Pymol round-up later in the series, for which I will need some help (Felix?). Last week, I needed to decide which to use, but both seemed equally incomprehensible to a first-time user.

Egon Willighagen said...

Felix, quite right. Warren and the Jmol (at least, it's been discussed in the past) team still have the wish to be able to exchange scenes. PyMol is very good for making print quality images indeed.

Felix said...

I guess both programs are very nice. after your posts i can tell you if i think it would have been easier with pymol. but I remember it took me a while to understand all those functions