schrodinger.ui.picking module

class schrodinger.ui.picking.PickAtomToggle(checkbox, pick_function, pick_text='Pick an atom', enable_lasso=False)

Bases: schrodinger.ui.picking._PickToggle

Class meant to replicate Maestro atom pick toggles. Takes an argument ‘checkbox’ that represents the checkbox for the picking toggle.

__init__(checkbox, pick_function, pick_text='Pick an atom', enable_lasso=False)

The following options are supported:

Parameters
  • checkbox (QCheckBox instance.) – Checkbox to hook up the class to.

  • pick_function (callable) – will be called when an atom is picked. Must be a callable function that accepts one argument (atom number, or ASL, if enable_lasso is True).

  • pick_text (str) – Text that will be displayed in Maestro’s status area (default “Pick an atom”).

  • enable_lasso (bool) – Whether to allow multiple atoms to be selected simultaneously via lasso.

class schrodinger.ui.picking.PickBondToggle(checkbox, pick_function, pick_text='Pick a bond')

Bases: schrodinger.ui.picking._PickToggle

Class meant to replicate Maestro bond pick toggles.

The argument ‘checkbox’ represents the QCheckBox object for the picking toggle

The following options are supported:
pick_function - will be called when a bond is picked. Must be a callable

function that accepts two arguments (atom numbers)

pick_text - text that will be displayed in Maestro’s status area

(default “Pick a bond”)

__init__(checkbox, pick_function, pick_text='Pick a bond')
class schrodinger.ui.picking.PickMixedToggle(checkbox, pick_atom_function, pick_bond_function, pick_atom_text='Pick an atom', pick_bond_text='Pick a bond', enable_lasso=False)

Bases: schrodinger.ui.picking._PickToggle

Class allowing to pick atom or bond depending on internal state.

__init__(checkbox, pick_atom_function, pick_bond_function, pick_atom_text='Pick an atom', pick_bond_text='Pick a bond', enable_lasso=False)

Initialize picker class.

Parameters
  • checkbox (QtWidgets.QCheckBox) – pick toggle

  • pick_atom_function (function) – this function is called when atom is picked. Must be a callable function that accepts one arguments (atom number, or ASL if enable_lasso is True).

  • pick_bond_function – this function is called when bond is picked. Must be a callable function that accepts two arguments (bond atoms).

  • pick_atom_text (str) – atom pick text that will be displayed in Maestro’s status area (default “Pick an atom”).

  • pick_bond_text (str) – bond pick text that will be displayed in Maestro’s status area (default “Pick an atom”).

  • enable_lasso (param) – Whether to allow multiple atoms to be selected simultaneously via lasso.

property enable_lasso
setPickAtom(state)

Turn pick atom mode on and off. If it’s off bonds will be picked instead.

Parameters

state (bool) – True or False, if True atoms will be picked. Otherwise bonds will be picked.

setPickBond(state)

Convenience function to turn pick atom mode on and off. If its off bonds will be picked instead.

Parameters

state (bool) – True or False, if True bonds will be picked. Otherwise atoms will be picked.

class schrodinger.ui.picking.PickCategoryToggle(checkbox, pick_function, pick_category)

Bases: schrodinger.ui.picking._PickToggle

Class to pick graphics objects using pick categories

__init__(checkbox, pick_function, pick_category)
Parameters
  • checkbox (QtWidgets.QCheckBox) – The checkbox instance to control picking

  • pick_function (callable) – Module-level function that takes one argument (the pick_id attribute of the picked graphics object). Must be a module-level function because maestro will call it by name, rather than by reference.

  • pick_category (str) – The pick_category attribute of the graphics objects to pick. Must be defined in mm_graphicspick.cxx

class schrodinger.ui.picking.PickAslToggle(checkbox, pick_function, picking_mode, pick_text='Pick atoms to define a group', allow_locked_entries=False)

Bases: schrodinger.ui.picking._PickGroupToggleBase

The pick toggle makes use of maestro’s picking_asl_start which allows a custom pick state to be chosen (residue, molecule, chain, etc.) These pick states are defined as constants in maestro.py. The pick function that is passed as an argument must take a string as an argument, this string will be a valid asl statement

__init__(checkbox, pick_function, picking_mode, pick_text='Pick atoms to define a group', allow_locked_entries=False)

See parent class for argument documentation.

Parameters

picking_mode (int) – The mode to set Maestro’s picker feature to. These are defined in schrodinger.maestro.maestro

class schrodinger.ui.picking.PickAtomsToggle(checkbox, natoms, pick_function, pick_text='Pick atoms to define a group', allow_locked_entries=False)

Bases: schrodinger.ui.picking._PickGroupToggleBase

This pick toggle allows you to select multiple atoms at once, each individually. Clicking on an already selected atom will unselect it. The pick_function should expect a list of integers (which correspond to atom indices) as an argument

__init__(checkbox, natoms, pick_function, pick_text='Pick atoms to define a group', allow_locked_entries=False)

See parent class for argument documentation.

Parameters

natoms (int or None) – the number of atoms in the group or None to allow any number of picks

property workspace_ct

Get a copy of the workspace structure

(lazily and cached)

reset()

Unpick all atoms and update markers

class schrodinger.ui.picking.PickAtomsLassoToggle(checkbox, pick_function, pick_text='Pick atoms to define a group', allow_locked_entries=False)

Bases: schrodinger.ui.picking.PickAtomsToggle

Class for creating a PickAtomsToggle that allows the user to pick atoms using marquee selection

__init__(checkbox, pick_function, pick_text='Pick atoms to define a group', allow_locked_entries=False)

See parent class for argument documentation.

Parameters

natoms (int or None) – the number of atoms in the group or None to allow any number of picks

class schrodinger.ui.picking.PickResiduesToggle(checkbox, pick_function, pick_text='Pick residues', allow_locked_entries=False)

Bases: schrodinger.ui.picking.PickAtomsToggle

Class for creating a PickAtomsToggle that allows the user to pick and unpick residues by clicking on any of their atoms

__init__(checkbox, pick_function, pick_text='Pick residues', allow_locked_entries=False)

See parent class for argument documentation.

Parameters

natoms (int or None) – the number of atoms in the group or None to allow any number of picks

class schrodinger.ui.picking.PickPairToggle(checkbox, pick_function, pick_text='Pick 2 atoms to define a pair', allow_locked_entries=False)

Bases: schrodinger.ui.picking.PickAtomsToggle

Class for creating a picker that allows the user to define a pair of atoms by sequentially picking 2 atoms.

__init__(checkbox, pick_function, pick_text='Pick 2 atoms to define a pair', allow_locked_entries=False)

See parent class for argument documentation.

Parameters

natoms (int or None) – the number of atoms in the group or None to allow any number of picks

class schrodinger.ui.picking.PickTorsionToggle(checkbox, pick_function, pick_text='Pick 4 atoms to define a torsion', allow_locked_entries=False)

Bases: schrodinger.ui.picking.PickAtomsToggle

Class for creating a picker that allows the user to define a torsion by sequentually picking 4 atoms.

__init__(checkbox, pick_function, pick_text='Pick 4 atoms to define a torsion', allow_locked_entries=False)

See parent class for argument documentation.

Parameters

natoms (int or None) – the number of atoms in the group or None to allow any number of picks

class schrodinger.ui.picking.Pick3DObjectToggle(checkbox, pick_function, pick_category, pick_text='Pick an object')

Bases: schrodinger.ui.picking._PickToggle

Class meant to replicate a Maestro pick toggle. This object allows you to pick objects from the schrodinger.graphics3d module. This picker allows you to pick any object assigned to the picking category argument ‘pick_category’

Parameters
  • checkbox – The QCheckBox object for the picking toggle

  • pick_function – Will be called when a bond is picked. Must be a callable function that accepts two arguments (atom numbers)

  • pick_category – The category of objects to pick. Strings must be defined in mm_graphicspick.cxx string_pick_map. This will allow picking of 3D objects with the corresponding pick_category attribute.

  • pick_text – text that will be displayed in Maestro’s status area (default “Pick an object”)

__init__(checkbox, pick_function, pick_category, pick_text='Pick an object')
class schrodinger.ui.picking.MaestrolessLigandListModel(st, parent=None)

Bases: schrodinger.ui.qt.table_helper.RowBasedListModel

Model for ligand lists that can be used outside of Maestro.

__init__(st, parent=None)
Parameters
class schrodinger.ui.picking.MaestrolessPickLigandDialog(st, parent=None)

Bases: PyQt6.QtWidgets.QDialog

Dialog to allow users to pick ligands outside of Maestro. Used by ifd_gui.py and covalent_docking_gui.py

__init__(st, parent=None)
Parameters
accept()

Called when the user clicks OK button

class schrodinger.ui.picking.ResidueRow(res, markers_color=None)

Bases: schrodinger.ui.qt.appframework2.markers.MarkerMixin

Class representing a residue in the active site. Used by ResiduesModel and SelectResiduesDialog.

__init__(res, markers_color=None)
Parameters
  • res (schrodinger.structure.Residue) – Residue to be added as a row.

  • markers_color (3-tuple of floats, each between 0.0 and 1.0, or None) – Color to add workspace markers as for this residue. If None, no markers will be added.

findInStructure(st)
class schrodinger.ui.picking.PickResidueRow(res, distance=None)

Bases: schrodinger.ui.picking.ResidueRow

Base class for rows to be used in models inheriting _BaseMaestrolessPickModel.

__init__(res, distance=None)
Parameters
  • res (schrodinger.structure._Residue) – Residue for this row

  • distance (float or None) – Distance of the residue to a ligand or None

class schrodinger.ui.picking.PickResiduesChangedMixin

Bases: object

Mixin to provide common signals for dialogs that allow users to pick residues.

residues_centroid_changed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

residues_changed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

getResiduesList(res_objs)

Return the list of residue strings (e.g. [‘A:217’, ‘A:231b’]) of the selected residues.

Parameters

res_objs (List of ResidueRow) – List of residue objects to get strings for

:return List of residue strings for each row. @rtyp: list of str

getResiduesCenter(res_objs)

Return the (x, y, z) tuple for the center of the selected residues. Will raise ValueError if no residues were picked.

@pram res_objs: Residue objects to get the center of :type res_objs: List of ResidueRow

Returns

Tuple of center x, y, z coordinates

Return type

tuple of (float, float, float)

class schrodinger.ui.picking.PickResidueColumns(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.TableColumns

Picked = Column 0 ()
Chain = Column 1 (Chain)
Residue = Column 2 (Residue)
Resnum = Column 3 (No.)
class schrodinger.ui.picking.PickResidueModel(parent, multi_select=True)

Bases: schrodinger.ui.picking._BaseMaestrolessPickModel

Model for tables to allow picking residues from a structure outside of Maestro.

Column

alias of schrodinger.ui.picking.PickResidueColumns

ROW_CLASS

alias of schrodinger.ui.picking.PickResidueRow

class schrodinger.ui.picking.MaestrolessPickResidueDialog(st, lig_st=None, find_ws_lig=False, multi_select=True, parent=None)

Bases: schrodinger.ui.picking._BaseMaestrolessPickResDialog

Class for picking residues outside of Maestro.

PickModelClass

alias of schrodinger.ui.picking.PickResidueModel

ALL_RESIDUES = 'All residues'
NEAR_RESIDUES = 'Residues near ligand (within 5A)'
__init__(st, lig_st=None, find_ws_lig=False, multi_select=True, parent=None)
Parameters
  • st (schrodinger.structure.Structure) – Structure containing the residues

  • lig_st (schrodinger.structure.Structure or None) – Ligand structure to check distances of residues against. Cannot be specified if find_ws_lig is set to True. If not specified and find_ws_lig is False, distance filtering will not be enabled.

  • find_ws_lig (bool) – Whether to search self.st for a single ligand. If more than one ligand is identified, none will be used. Cannot be True if a ligand is specified via ligand_st.

  • multi_select (bool) – Whether to allow selection of multiple residues, vs a single residue only. Default is True.

  • parent (QtWidgets.QWidget) – Parent widget to the dialog

af2SettingsGetValue()

Used with schrodinger.ui.qt.appframework2.settings.SettingsMixin to save the dialog state to JSON.

Returns

List of panel attributes to serialize

Return type

list

af2SettingsSetValue(value)

Used with schrodinger.ui.qt.appframework2.settings.SettingsMixin to reload the dialog state from JSON.

Parameters

value (list) – Values to set for the panel

onShowComboIndexChanged()

Called when the index of the Show combo box is changed. Updates the available residues based on the selected option.

updateNumPickedResiduesLabel()

Update the label for number of picked residues.