Mittwoch, 22. Juni 2011

Jmol 002: Control over Two Structures

I loaded two structures into a jmolApplet by the following code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>UI Controls example</title>
<script src="./jmolDir/Jmol.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
jmolInitialize("./jmolDir");
jmolApplet(400, "load 1AVD.pdb;\
load APPEND nwSurface.xyz;\
axes on;\
boundbox on;");
</script><br />
</body>
</html>
This results in the figure below.
A protein structure is placed above an array of carbon atoms which are supposed to illustrate the surface of a nanowire. What I would like to do now is to be able to rotate the protein with respect to the surface (i.e. keeping the surface in the same orientation regarding the indicated coordinate system).
Unfortunately, I dont know how to include Jmol on Blogspot, otherwise I naturally would have included it directly here as well.
The input from Bob Hanson at the Jmol Mailing list is actually pointing me into exactly the correct direction. This script was tested in a local version of Jmol but it should just as well be working in a browser.

load 1PDB.pdb
load APPEND nwSurface.xyz
select protein
set allowRotateSelected True
set dragSelected True

Now using <ALT>+<Left_Mouse> the user can rotate the protein structure without changing the surface and <ALT>+<SHIFT>+<Left_Mouse> to drag the structure over the surface.

Keine Kommentare:

Kommentar veröffentlichen