rdtools.view.mol#

Module for viewing RDKit Molecules using py3Dmol.

rdtools.view.mol.mol_animation(mols: list[Mol], conf_ids: list[int] | None = None, interval: int = 1000, **kwargs: Any) view#

Create an animation viewer for viewing the RDKit Molecules.

This viewer accepts additional keyword arguments for viewer specs, following the same way animation_viewer is implemented.

Parameters:
  • mols (list[Chem.Mol]) – A list of RDKit Molecules, each assumes to contain at least one conformer.

  • conf_ids (Optional[list[int]], optional) – A list of IDs of the conformers to view. If None, the first conformer of each molecule will be displayed. Defaults to None.

  • interval (int, optional) – The time interval between each frame in millisecond. Defaults to 1000.

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

Returns:

py3Dmol.view – The viewer.

rdtools.view.mol.mol_viewer(mol: Mol, conf_id: int = 0, **kwargs: Any) view#

Create a viewer for viewing the RDKit Molecule.

This viewer accepts additional keyword arguments for viewer specs, following the same way base_viewer is implemented.

Parameters:
  • mol (Chem.Mol) – The RDKit Molecule.

  • conf_id (int, optional) – The ID of the conformer to view.

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

Returns:

py3Dmol.view – The viewer.

rdtools.view.mol.ts_viewer(mol: Mol, broken_bonds: list[tuple[int, int]] = [], formed_bonds: list[tuple[int, int]] = [], broken_bond_color: str = 'red', formed_bond_color: str = 'green', broken_bond_width: float = 0.1, formed_bond_width: float = 0.1, **kwargs: Any) view#

Create a viewer for transition state.

Parameters:
  • mol (Chem.Mol) – The RDKit Molecule.

  • broken_bonds (list[tuple[int, int]], optional) – The broken bonds. Defaults to [].

  • formed_bonds (list[tuple[int, int]], optional) – The formed bonds. Defaults to [].

  • broken_bond_color (str, optional) – The color of the broken bond. Defaults to “red”.

  • formed_bond_color (str, optional) – The color of the formed bond. Defaults to “green”.

  • broken_bond_width (float, optional) – The width of the broken bond. Defaults to 0.1.

  • formed_bond_width (float, optional) – The width of the formed bond. Defaults to 0.1.

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

Returns:

py3Dmol.view – The viewer.