From: Bob Hanson <hansonr@st...>  20080723 09:01:42

There's a bug in 11.5.49 that precludes using syntax such as $line[1] in Jmol scripts. Nico, if you would please release 11.5.50, that would be nice. I haven't given an update in a long time as to what is new in Jmol. http://chemapps.stolaf.edu/jmol/docs/examples11/new.htm is fairly up to date. There are quite a few new capabilities of Jmol arising from my research this summer into the use of quaternions in protein structure determination. Do check them out. Some of the more useful capabilities include: select {some atoms} draw ramachandran Draws curved arrows for PHI an PSI around the appropriate bonds. If you're like me, it can drive you nuts figuring out exactly what those mean. Now it's relatively easy to visualize them. draw ID xxx .... With the added explicit ID keyword, you can name draw objects just about anything, and you can construct names on the fly. This has been very useful in my work, where I create numerous (thousands) of arrows and lines on a page, each of which have to have separate names. An example is http://chemapps.stolaf.edu/quaternions/jmol/q_pqa.spt For example: for (j = 0; j < 360; j = j + 30) draw ID @{"ptbq" + pt+"_" + j} scale 1.5 \ vector @atomN @{(quaternion({0 0 1},j) * p[pt]) %4} \ color white end for Note that the draw ID is constructed on the fly. quaternions If you take a look at that script linked to above, you will see that just about all of it involves new capabilities. Jmol now saves a sort of variable that can be interpreted as a rotation  unit quaterions. In the above example, pt is just a number; p[pt] is a quaternion. quaternion({0 0 1},j) represents a rotation around the Z axis, * means "carry out the two rotations in order (from right to left), and %4 means "the unit normal rotation axis corresponding to the specified quaternion". Pretty neat, eh? Quaternions allow for easy specification of composite rotations. Jmol has syndax such as: var qRot = quaternion({0 0 1},nDeg) * quaternion({1 0 0},tau) That says, "define a composite rotation that consists of a rotation of tau degrees around the X axis followed by an nDeg rotation around the Z axis." A = qRot%{0 0 1}; says "return the result of applying the saved rotation to the Z axis." Take a look at http://chemapps.stolaf.edu/jmol/docs/index.htm?ver=11.6#Jmolmath for more details on how quaternions can be used. Jmol is reporting quaternions for all sorts of things now. For some fun, see if you can figure out how http://chemapps.stolaf.edu/quaternions/jmol/dq.htm works. Notice that you cannot rotate the bottom lefthand axis set. That's because it represents the "fixed" frame of reference for the other three applets. This page requires feedback relating to the exact orientation of the frames on the right. That's done using this JavaScript function: function getOrientation(n) { var S = jmolScriptEcho("show orientation moveto", n).replace(/\{ /,"{").split("{")[1].split("}")[0].split(" "); return "quaternion({"+S[0] + " " + S[1] + " " + S[2] + "}," + S[3] + ")" } where "show orientation moveto" is reporting the axisAngle of the current rotation, and that return constructs a quaternion that expresses it. In fact, the following Jmol script command resets the rotation without resetting the zoom: rotate @{!quaternion(script("show rotation"))} That's because "show rotation" reports a quaternion for the rotation, !quaternion(...) inverts that, and the rotate command now allows for rotation using quaternions. It's a simple as that. It turns out that comparing quaternion differences allows for defining and visualizing the "straightness" of helices and sheets. Try this at http://Jmol.proteinExplorer.org after loading any model. calculate straightness color straightness That uses quaternion differences to measure how alike adjacent amino acid orientations are. With 1d66, note the highlighted cytidine base (in blue, easiest to see using cartoons or spacefill). That's an inverted base. If you want to see something interesting, in Jmol Protein Explorer take a look at: load =1sva quaternion r difference2 spacefill 0.1 This is a map that shows the relative orientation of amino acids. Note that they are strongly correlated with the X axis. That's because there is an interesting simple rotational correlation from one Calpha to the next in ALL transpeptideplane linked proteins. Now try that using 1d66. You will see a few crazy atoms that are offaxis. What's so special about those, do you think? Or, here's an interesting one: load =1a6g quaternion difference You will see the helix residues (in pink) in a set of clusters. Bring a cluster around to the front  right between you and the origin of that sphere. Now click the [<] button to go back to the model frame. What do you see? I'll bet you will see that you are looking straight down a helix. So quaternions provide a very simple way to determine the *exact* direction of a helical axis. If you go back to the quaternion using [>] and take a closer look, you will see that some clusters are more compact than others. That's because some are straighter than others. The amount of curvature in a run of a helix shows up as scatter in the quaternion difference graph. Where it turns out quaternions are particularly interesting is in the area of NMR spectroscopy. I think someone with an interest in NMR and some knowledge of Jmol could go wild with interactive demonstrations of pulse sequences and spin relaxation using quaternions. As one author put it, "after all, quaternions *are* spinors." It's a natural fit. My group has been exploring the use of quaternions to correlate solid state PISEMA spectra with structures. That work is at http://chemapps.stolaf.edu/quaternions/PISEMA/pisema.htm. Not a lot of explanation there, but for the Jmol user, some interesting stuff. Click on a point on the graph on the right to see that amino acid highlighted. For our work this summer we have had the need to generate idealized proteins. Some of that can be seen at http://chemapps.stolaf.edu/quaternions/jmol/test.htm which uses quaternions extensively for its tests, and http://chemapps.stolaf.edu/quaternions/PISEMA/helix.htm which generates "custom" idealized polyalanine runs. So anyway, that's what I've been up to. Quaternions rock! Bob Most interesting to me has been using quaternions to describe the rotational orientation of protein amino acid residues and DNA and RNA bases. The commands quaternion quaternion derivative quaternion r derivative2 have been essential in what we have been working on recently. write ramachandran  Robert M. Hanson Professor of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr If nature does not answer first what we want, it is better to take what answer we get.  Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 