This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Convert A Simulation Trajectory To A Animation

I have simulated a protein(Lysozyme) for 5ns using gromacs. I want to visually see the simulation trajectoryin the form of a movie starting from initial PDB structure to final 5ns structure. I have taken snapshot of the simulation every 2ps. I have tried searching on internet but I have not found any tutorial. Please let me know how to create a animation(movie) of the trajectory using VMD or any tool.

Thanks in advance

simulation

Sorry for misunderstanding. I don't have any images, what I just have is a trajectory file with snapshots(atomic coordinates) every 2ps of the PDB. I want to convert that into a movie or a animation.

3 answers

You can use ffmpeg to convert a collection of images into an animation. Here is an example of how to use the ffmpeg command to do something like this.

Sorry for misunderstanding. I don't have any images, what I just have is a trajectory file with snapshots(atomic coordinates) every 2ps of the PDB. I want to convert that into a movie or a animation.

VMD has option to make movies directly from trajectory.

If you have GIF files, another option is gifsicle. Animated GIFs can be much smaller files than MPEG movies and easier to distribute and embed in electronic documents.

Let's say your snapshots are named frame000.gif through frame123.gif, the following command makes a single-shot animated GIF file called animation.gif:

$ gifsicle --delay 10 --no-loopcount --colors 256 frame*.gif > animation.gif

Add the --loopcount option if you wanted an infinitely-repeating animation. Use --loopcount=n for n loops.

MPEG files can require certain codecs and plug-ins. Animated GIFs work nicely with web browsers without any extra work. There have been patent issues with GIF, but broad browser support is not one of them. (APNG might be an option one day, but practically no browsers support that format and I'm not aware of any tools that make them easily.)

Update - Looks like some developers are making open source C++ tools for creating APNG over at Kickstarter.

Sorry for misunderstanding. I don't have any images, what I just have is a trajectory file with snapshots(atomic coordinates) every 2ps of the PDB. I want to convert that into a movie or a animation.

Log in to answer this question.