play#

biotite.interface.pymol.play(size=None, fps=30, format='gif', html_attributes='controls', pymol_instance=None)[source]#

Render an video of the PyMOL video frames and display it in the current Jupyter notebook.

Note that this function works only in a Jupyter notebook.

Parameters:
sizetuple of (int, int), optional

The width and height of the rendered video in pixels. By default, the size of the current PyMOL viewport is used.

fpsint

The number of frames per second.

format{“gif”, “mp4”}, optional

The format of the rendered video. By default, a GIF is created.

html_attributesstr, optional

The HTML attributes that are passed to the <video> tag. Only used, if format="mp4".

pymol_instancemodule or SingletonPyMOL or PyMOL, optional

If PyMOL is used in library mode, the PyMOL or SingletonPyMOL object is given here. If otherwise PyMOL is used in GUI mode, the pymol module is given. By default the currently active PyMOL instance is used. If no PyMOL instance is currently running, PyMOL is started in library mode.

Notes

Internally uses the PyMOL mpng command. This function requires either the ffmpeg (gif or mp4) or imagemagick (gif) command line tool to be installed.