Molecular animation
in Python
Animate proteins, DNA, and RNA from a structure or trajectory. Add motion and labels, then export a video. Render cartoons, nucleotide bases, ball-and-stick models, and molecular surfaces.
python -m pip install proteinmotionInstall from PyPI, or use pipx for a global command.
Python 3.11+ · macOS · Windows + NVIDIA · MIT licensed
GPU rendering on Apple silicon Macs and Windows PCs with NVIDIA graphics. ProteinMotion detects your platform and selects rendering and video encoding automatically. Platform setup
Molecular representations
Cartoon, ribbon, atoms & surfaces
Animation
Movement, color & transparency
Labels & measurements
Residues, distances & interactions
States & trajectories
NMR ensembles & MD playback
Define each animation
in a Python script.
Create a protein object, add it to a scene, and call play() to animate it. The API follows Manim’s scene syntax. Set the duration of each animation and combine animations in one call to run them together.
Read a complete scriptProteinMotion runs as a standalone package. Use the exported videos in Manim, presentations, or a video editor.
class MyFilm(ProteinScene):
def construct(self):
p = Protein.from_file("protein.cif").cartoon()
self.add(p)
self.camera.frame(p)
helix = p.select(residues=(23, 34))
self.play(Colorize(helix, "#50e0d0"), run_time=1.5)
self.play(Write(helix.callout("α helix")))
self.focus(helix, run_time=1.5)
self.play(PlayTrajectory(p), run_time=8)DNA and RNA
Draw bases as slabs, rings, sticks, or ladder rods. Highlight selected nucleotides and show molecular surfaces.
View code and outputNumerical properties
Color residues by B factors, RMSF, or custom values. Use cartoon thickness and a color scale to show the range.
View code and outputPlots that follow the movie
Show distance traces, contact maps, and a sequence strip alongside trajectory playback.
View code and outputDensity maps and slices
Load an MRC or CCP4 map, change its contour level, and move a slice through the volume.
View code and outputDepth of field with EEVEE
Set lens focus on selected residues and animate focus changes as the camera moves. The homepage film uses EEVEE for helix close-ups, transparent surroundings, and molecular surfaces. Install Blender separately to render the scene.
View the film and full scriptUse with an AI agent
The ProteinMotion Movies skill provides instructions and examples for writing scenes, rendering videos, and checking the results. Use it with an agent that can read local files and run Python commands.
Set up the skillExample structures and scripts
Protein, DNA double-helix, and transfer RNA examples include their input structures and full scripts.