Welcome to this tutorial on Animation using Script Commands.
In this tutorial, we will learn to show animations using Jmol script commands.
For demonstration, we will use models of ethane and hemoglobin as examples.
Jmol script commands with the following keywords will be used for animations.
move, delay, slab, loop and capture.
To follow this tutorial, you should have knowledge of high school chemistry and familiar with operations from Jmol window.
If not, for relevant tutorials, please visit our website.
To record this tutorial, I am using Ubuntu OS version 14.10,
Jmol version 14.1.11 and Java version 7.
This slide shows the function of each animation command in detail.
move command allows you to rotate, zoom and translate a model within a specified period of time.
delay command is used to pause a script for the specified number of seconds.
slab command is used to control the percentage of the molecule to be displayed on panel.
loop command causes the script to restart at the beginning with an optional time delay.
capture command captures animations as animated GIF files.
For more details on Jmol script command, visit the web page for Jmol interactive script documentation.
Let us open the Jmol window and demonstrate an animation using move command.
I will begin with a simple move command using ethane as an example.
Create a model of ethane using modelkit menu.
Click on the modelkit icon, a model of methane appears on the screen.
Click on the hydrogen. Now we have a model of ethane on screen.
Open the console using File menu.
At the prompt, type the following command.
The command line starts with the word "move"
followed by the numbers that quantify a set of animation parameters.
More information about move command: There are nine parameters in the move command.
The first three parameters are rotations around X, Y and Z axes.4is the zoom modifier, expressed in positive or negative numbers,
positive for zoom in and negative for zoom out.
The next three parameters deal with translation along the three axes.
8th is the slab parameter. Slab slices the molecule.
It removes atoms to a specified depth so that interior features may be easily observed.
Parameter 9 is the amount of time, in seconds, taken in performing the move command.
Back to the Jmol panel.
Press Enter and observe the panel.
We can create more interesting animation by adding more commands to the existing ones.
Press up-arrow key on the key board to get the previous command.
Type: delay space 2 after the semicolon.
Here, the delay command pauses the script for 2 seconds, before executing the next command.
Then type another move command after this delay command.
Don't forget to add semicolon at the end of each keyword command. Press Enter. Observe the panel.
We can also change the color of the atoms during this animation.
Again, press up-arrow key to get the previous command.
Edit the command as I have shown here, on the console.
Use select keywords to change the color of the hydrogens and carbons. Press Enter.
Again observe the panel.
Add a "slab" command to make certain parts of the molecule to disappear and appear.
Press up-arrow key again and edit the previous command as shown on the console.
Type: "slab on" after the select command.
Type: "slab off" at the end of the command.
Press Enter and observe the panel.
You can see parts of the molecule disappear and appear again.
You can save this animation as a GIF file, using capture keyword.
Press up-arrow key to get the previous command.
Type the "capture" command and specify the file name and path at the beginning of the command.
You can type the name of your home folder to save the GIF file.
I am saving this animation as file “sneha”, on the desktop. Press Enter.
Now the animation will be saved as GIF file on my desktop.
Navigate to the location of the GIF file.
Open the saved GIF file with Image Viewer software.
Back to the Jmol panel.
Similarly, open a pdb file of any macromolecule; for example- oxygenated hemoglobin with a pdb code "2DN1".
Download the structure directly from pdb database using File menu.
Type the pdb code in the text-box, "2DN1". Press OK.
A model of hemoglobin is displayed on the panel.
Type the following command in the Console.
We have used select keyword command to change the color of different units of the protein.
We have also used move command.
This command will display protein in red cartoons.
The Haem part in yellow spacefill display and cut away 50% of the molecule.
Rotate 360º on X-axis in 4 seconds and restore all atoms.
Press Enter and observe the panel.
Let us now use the loop command to repeat all the above steps.
Press up-arrow key to get the same command. Type "loop 2" at the end of the command.
"loop 2" indicates the previous script commands will be repeated after a 2 second delay.Press Enter.
You can be creative and type many more such commands to animate.
Now, let's summarize. In this tutorial, we have learnt to
create animation of ethane and haemoglobin using script commands such as move, delay.
We have also made use of loop and slab commands.
Saved the animations as a GIF file using capture command.
For the assignment-Take a molecule of your choice and create animation using move and delay commands.
Change display, color and size of the bonds to create animation.
The video at the following link summarizes the Spoken Tutorial project. Please download and watch it.
The Spoken Tutorial project team conducts workshops and gives certificates for those who pass an online test.
For more details, please write to us.
Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.
More information on this mission is available at the link shown.
This is Snehalatha from IIT Bombay, signing off. Thank you for joining.