API Documentation for MoleculeVisualizer

class mdonatello.mdonatello.MoleculeVisualizer(ag: AtomGroup, show_atom_indices: bool = False, width: int = -1, height: int = -1)[source]

Bases: object

A class for small molecule 2D visualization in jupyter notebook

Parameters:

agMDAnalysis.core.groups.AtomGroup

An AtomGroup object representing the molecules that need to be visualized.

show_atom_indicesbool, optional

Whether to display atom indices of the molecule. Default is False.

widthint, optional

The width of the image in pixels. Default is -1.

heightint, optional

The height of the image in pixels. Default is -1.

initialize_output()[source]

Initializes the output display and arranges the widgets in the interface.

initialize_widgets()[source]

Initializes the interactive widgets for molecule visualization.

link_widget_callbacks()[source]

Links the interactive widgets to the update_display method to reflect changes.

save_selected_molecule(_)[source]

Saves the currently selected molecule as a PNG file.

Parameters:

_ (any, optional) – A placeholder parameter for button callback compatibility.

update_display(_=None)[source]

Updates the molecule display based on the current selections.

Parameters:

_ (any, optional) – A placeholder parameter for widget callback compatibility.

MoleculeVisualizer(ag[, show_atom_indices, ...])

A class for small molecule 2D visualization in jupyter notebook