schrodinger.livedesign.draw module¶
- class schrodinger.livedesign.draw.ImageGenOptions(img_format: ~schrodinger.livedesign.draw.Format = Format.SVG, width: int = 400, height: int = 300, background_color: ~PyQt6.QtGui.QColor = <PyQt6.QtGui.QColor object>, show_stereo_annotation: bool = True, show_simplified_stereo_annotation: bool = True, show_terminal_methyl: bool = False, show_wiggly_bonds: bool = False, aromatic_bond_display: ~schrodinger.livedesign.draw.AromaticBondDisplay = AromaticBondDisplay.KEKULE, wiggly_bonds_to_potential_chiral_centers: bool = False, show_symbol_for_H_isotopes: bool = True, highlight_style: ~schrodinger.livedesign.draw.ColoringStyle = ColoringStyle.HALO, highlight_atoms: ~typing.Optional[~typing.List[int]] = None, highlight_bonds: ~typing.Optional[~typing.List[int]] = None, highlight_atom_colors: ~typing.Optional[~typing.Dict[int, ~PyQt6.QtGui.QColor]] = None, highlight_bond_colors: ~typing.Optional[~typing.Dict[int, ~PyQt6.QtGui.QColor]] = None)¶
Bases:
NamedTuple
- Variables:
img_format – image format to be returned
width – width of the image
height – height of the image
background_color – background QColor
show_stereo_annotation – whether to label stereochemistry
show_simplified_stereo_annotation – whether to use molecular labels
show_terminal_methyl – whether to render terminal methyl groups
show_wiggly_bonds – whether to render wiggly bonds instead of crossed
aromatic_bond_display – how aromatic bonds should be drawn
wiggly_bonds_to_potential_chiral_centers – Make a wiggly bond to each “unknown” stereo center
show_symbol_for_H_isotopes – whether to show H isotopes
highlight_style – how to highlight atoms and bonds
highlight_atoms – indices of atoms to highlight
highlight_bonds – indices of bonds to highlight
highlight_atom_colors – colors to assign to each atom highlight
highlight_bond_colors – colors to assign to each bond highlight
- width: int¶
Alias for field number 1
- height: int¶
Alias for field number 2
- background_color: QColor¶
Alias for field number 3
- show_stereo_annotation: bool¶
Alias for field number 4
- show_simplified_stereo_annotation: bool¶
Alias for field number 5
- show_terminal_methyl: bool¶
Alias for field number 6
- show_wiggly_bonds: bool¶
Alias for field number 7
- aromatic_bond_display: AromaticBondDisplay¶
Alias for field number 8
- wiggly_bonds_to_potential_chiral_centers: bool¶
Alias for field number 9
- show_symbol_for_H_isotopes: bool¶
Alias for field number 10
- highlight_style: ColoringStyle¶
Alias for field number 11
- highlight_atoms: Optional[List[int]]¶
Alias for field number 12
- highlight_bonds: Optional[List[int]]¶
Alias for field number 13
- highlight_atom_colors: Optional[Dict[int, QColor]]¶
Alias for field number 14
- highlight_bond_colors: Optional[Dict[int, QColor]]¶
Alias for field number 15
- schrodinger.livedesign.draw.set_rgroup_highlight(match_mol: Mol, rgroup_decomp: Dict[str, Mol], options: Optional[ImageGenOptions] = None) ImageGenOptions ¶
Sets the highlighting to use for each atom and bond according to which of the rgroups or core the atom/bond belongs to.
- Parameters:
mol – molecule to highlight rgroup decoposition of
rgroup_decomp – core and rgroups from rgroup decomposition
options – image generation options to update
- Returns:
options with updated atoms/bonds to highlight
- schrodinger.livedesign.draw.set_highlight(mol: Mol, highlight_mol: Mol, substructure_options: Optional[QueryOptions] = None, options: Optional[ImageGenOptions] = None) ImageGenOptions ¶
Sets the atoms and bonds that match a specified highlight core.
- Parameters:
mol – query molecule
highlight_mol – core to highlight matches of
substructure_options – substructure matching options
options – image generation options to update
- Returns:
options with updated atoms/bonds to highlight
- schrodinger.livedesign.draw.assign_highlight_options(draw_opts: ImageGenOptions, sk_opts: RenderOptions)¶
Maps the colors set on the ImageGenOptions object to a RenderOptions object
- schrodinger.livedesign.draw.to_RenderOptions(draw_options: ImageGenOptions) RenderOptions ¶
- Parameters:
draw_options – input options defined in this module
- Returns:
translated sketcher compatible RenderOptions
- schrodinger.livedesign.draw.draw_image(mol: Union[Mol, ChemicalReaction], options: Optional[ImageGenOptions] = None) bytes ¶
Generates an image from an RDKit molecule or reaction
- Parameters:
mol – molecule or reaction to get image of
options – image generation options
- Returns:
generated image as a string (SVG) or as bytes (PNG)