rdtools.view.reaction#

Module for visualizing chemical reactions using RDKit and Py3Dmol.

rdtools.view.reaction.reaction_viewer(r_mol: Mol, p_mol: Mol, ts_mol: Mol | None = None, alignment: Literal['horizontal', 'vertical'] = 'horizontal', **kwargs: Any) view#

View reactant, product and ts of a given reaction.

The broken bonds in the TS will be shown with red lines while the formed bonds in the TS will be shown with green lines. Uses keywords from mol_viewer function, so all arguments of that function are available here.

Parameters:
  • r_mol (Chem.Mol) – The reactant complex.

  • p_mol (Chem.Mol) – The product complex.

  • ts_mol (Optional[Chem.Mol], optional) – The TS corresponding to r_mol and p_mol. It will be placed in between.

  • alignment (Literal["horizontal", "vertical"], optional) – Indicate if geometries are displayed horizontally (horizontal) or vertically (vertical). Defaults to horizontal.

  • **kwargs (Any) – Additional keyword arguments to be passed to the viewer.

Returns:

py3Dmol.view – The viewer.