polymerist.rdutils.rdkdraw ========================== .. py:module:: polymerist.rdutils.rdkdraw .. autoapi-nested-parse:: Tools for drawing and visulaizing RDKit molecules Functions --------- .. autoapisummary:: polymerist.rdutils.rdkdraw.set_rdkdraw_size polymerist.rdutils.rdkdraw.enable_substruct_highlights polymerist.rdutils.rdkdraw.disable_substruct_highlights polymerist.rdutils.rdkdraw.enable_kekulized_drawing polymerist.rdutils.rdkdraw.disable_kekulized_drawing polymerist.rdutils.rdkdraw.clear_highlights polymerist.rdutils.rdkdraw.tight_norm_for_rdmol_prop polymerist.rdutils.rdkdraw.rdmol_prop_heatmap polymerist.rdutils.rdkdraw.rdmol_prop_heatmap_colorscaled Module Contents --------------- .. py:function:: set_rdkdraw_size(dim: int = 300, aspect: float = 3 / 2) Change image size and shape of RDKit Mol images .. py:function:: enable_substruct_highlights() -> None Turns on highlighting of found substructures when performing substructure matches .. py:function:: disable_substruct_highlights() -> None Turns off highlighting of found substructures when performing substructure matches .. py:function:: enable_kekulized_drawing() -> None Turns on automatic kekulization of aromatic bonds before drawing molecules in Jupyter Notebooks .. py:function:: disable_kekulized_drawing() -> None Turns off automatic kekulization of aromatic bonds before drawing molecules in Jupyter Notebooks .. py:function:: clear_highlights(rdmol: rdkit.Chem.rdchem.Mol) -> None Removes the highlighted atoms flags from an RDKit Mol if present .. py:function:: tight_norm_for_rdmol_prop(rdmol: rdkit.Chem.rdchem.Mol, prop: str, prop_type: Union[Type[int], Type[float]]) -> tuple[matplotlib.colors.Normalize, tuple[int, Ellipsis]] Generate a matplotlib Normalize object with bounds matching the maxima, minima, and midpoint of a numeric Prop .. py:function:: rdmol_prop_heatmap(rdmol: rdkit.Chem.rdchem.Mol, prop: str, cmap: matplotlib.colors.Colormap, norm: Optional[matplotlib.colors.Normalize] = None, annotate: bool = False, annotate_precision: int = 5, img_size: tuple[int, int] = (1000, 1000)) -> PIL.Image.Image Take a charged RDKit Mol and color atoms based on the magnitude of a particular atomwise property .. py:function:: rdmol_prop_heatmap_colorscaled(rdmol: rdkit.Chem.rdchem.Mol, prop: str, cmap: matplotlib.colors.Colormap = plt.get_cmap('turbo'), norm: Optional[matplotlib.colors.Normalize] = None, ticks: Optional[tuple[float]] = None, cbar_label: str = '', orient: Optional[str] = None, **heatmap_args) -> tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] Plot a labelled heatmap of the charge differences between 2 structurally identical RDKit Molecules with different partial charges