boltz_data.draw

Contents

boltz_data.draw#

General code for visualisation.

Functions

draw_rdmol(rdmol, /[, caption, atom_color])

Draw an RDKit molecule to an SVG with stable coordinate generation.

boltz_data.draw.draw_rdmol(rdmol, /, caption=None, atom_color=None)[source]#

Draw an RDKit molecule to an SVG with stable coordinate generation.

Generates 2D coordinates canonically and renders the molecule as SVG. Optionally highlights atoms with custom colors based on a scheme or callable.

Parameters:
  • rdmol (Mol) – The RDKit molecule to draw.

  • caption (str | None) – Optional caption to display below the molecule.

  • atom_color (str | Callable[[Atom], tuple[float, float, float] | None] | None) – Optional atom coloring scheme. Can be: - “residue_alternating”: Colors atoms by even/odd residue number - A callable taking an Atom and returning RGB tuple or None

Return type:

str

Returns:

SVG string representation of the molecule.

Modules

color

Color utilities for visualization.

mol3d

Code for generating SVGs of 3D molecules.