Sunday, June 14, 2009

Just one of those links

Every once in a while you come across a web page that really blows your mind. This is one of them. My first reaction was "I have to learn how to do this!", and this is what really got me interested in Jmol. It took a while, but eventually I came up with something a little bit similar (helped in no small part by this excellent tutorials page) and showed it to everyone that came within shouting distance. You can watch it on a separate page or click on the image here.

In a previous post I showed how to get the coordinate file and the html code. However, the set of commands for this animation is too lengthy to include in the html, so I used a separate script file, which can be downloaded here.

The script is kind of long but of most the lines are actually the same commands used over and over again. For example, here is how I go from a spacefilling model of the protein to just the backbone chain:

select protein
spacefill 400; wireframe 0.0; trace
spin on
set echo top center
echo A protein is long chain that is folded| in a certain way
delay 2
spacefill 300; wireframe 0.3; trace; delay 0.2
spacefill 200; wireframe 0.3; trace; delay 0.2
spacefill 100; wireframe 0.3; trace; delay 0.2
spacefill 0.0; wireframe 0.3; trace; delay 1.0
spacefill 0.0; wireframe 0.2; trace; delay 0.2
spacefill 0.0; wireframe 0.1; trace; delay 0.2
spacefill 0.0; wireframe 0.0; trace;
delay 5
spin off

The key command here is "delay x" which stops the script for x seconds and this is what drives the animation forward. x is what you play with (endlessly).

Then there is the "moveto" command which does the cool repositioning.

echo Let's have a closer look at BADX
moveto 1.0 { -109 890 -443 149.21} 245.66 0.0 0.2 {32.302 28.212 29.408} 45.037945 {0.0 0.0 0.0} 42.396088 -68.80987 50.0;

The input to the moveto command looks very intimidating, but can be generated very easily by the "show moveto" command, as I show in this screen cast.

Finally, the subject of the animated presentation is an ongoing research project. Just like in teaching, animation can be used to bring across very complicated and detailed points to the viewer. Imagine explaining the content of this animation in words! I think molecular animation is a powerful, and overlooked, recruiting tool - as long as there is some kind of guiding narration. So you can also find a link to the animation on my research page.

I have also used snippets of the animation in research talks. But there I have broken the animation into segments, and installed buttons so I can control the timing, using html. More about this in a later post.

No comments: