schrodinger.ui.sketcher module

This module is a wrapper for the sketcher SIP library

exception schrodinger.ui.sketcher.SketcherStructureConversionError

Bases: RuntimeError

An error that occurs when converting the Sketcher workspace molecule to a Structure object.

class schrodinger.ui.sketcher.SketcherWidget

Bases: SketcherWidget

setStructure(st: Structure)

Replace the current Sketcher workspace contents with the given molecule

getStructure(sanitize: bool = False, dialog_on_conversion_error=False) Structure

Return the current Sketcher workspace contents as a Structure object with 3D coordinates.

Parameters:
  • sanitize – whether to sanitize the extracted structure

  • dialog_on_conversion_error – if True, any operation that raises a SketcherStructureConversionError (see below) will instead display a dialog and return None

Raises:

SketcherStructureConversionError – If dialog_on_conversion_error is False and any of the following are true: the Sketcher workspace is empty, the Sketcher workspace contains more than one molecule, sanitize` is True and the molecule in the Sketcher workspace cannot be sanitized.

class schrodinger.ui.sketcher.SelectOnlySketcherWidget(parent=None)

Bases: SketcherWidget

A Sketcher Widget that limits user-interaction to selecting atoms and bonds.

__init__(parent=None)