3dmol format

Class: Py3DMolFormat

3DMol format.

To use this format, py3Dmol should be installed in advance.

Conversions

Convert from System to this format

dpdata.System.to(fmt: Literal['3dmol'], f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'stick': {}, 'sphere': {'radius': 0.4}})
dpdata.System.to_3dmol(f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'stick': {}, 'sphere': {'radius': 0.4}})

Show 3D structure of a frame in jupyter.

Parameters:
f_idxint

frame index to show

sizetuple[int]

(width, height) of the widget

styledict

style of 3DMol. Read 3DMol documentation for details.

Examples

>>> system.to_3dmol()

Convert from LabeledSystem to this format

dpdata.LabeledSystem.to(fmt: Literal['3dmol'], f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'stick': {}, 'sphere': {'radius': 0.4}})
dpdata.LabeledSystem.to_3dmol(f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'stick': {}, 'sphere': {'radius': 0.4}})

Show 3D structure of a frame in jupyter.

Parameters:
f_idxint

frame index to show

sizetuple[int]

(width, height) of the widget

styledict

style of 3DMol. Read 3DMol documentation for details.

Examples

>>> system.to_3dmol()