schrodinger.ui.qt.select_residues_dialog module

Module of classes that allow for user selection of one or more residues based on the contents of the Maestro Workspace.

The main class to use is SelectResiduesDialog.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.ui.qt.select_residues_dialog.ResiduesModel

Bases: PyQt6.QtCore.QAbstractTableModel

This model represents the active site residues table.

__init__()
rowCount(ignored=None)

Returns number of rows

columnCount(ignored=None)

Returns number of columns

data(index, role)

Given a cell index, return the string that should be displayed in that cell. Used by the View class.

headerData(section, orientation, role)

Returns the string that should be displayed in the specified header cell. Used by the View.

setAllData(rows)
addRow(res)

Add the specified residue to the table (unless it’s already there)

removeRows(self, row: int, count: int, parent: QModelIndex = QModelIndex()) bool
removeAllRows()
getAllData()

Return a list of picking.ResidueRow objects for all rows in the table.

class schrodinger.ui.qt.select_residues_dialog.SelectResiduesDialog(panel, title=None, label_text=None, allow_empty_list=False, markers_color=None, hide_markers_on_close=False)

Bases: schrodinger.ui.picking.PickResiduesChangedMixin, PyQt6.QtWidgets.QDialog

Class for allowing the user to select one or more residues in the Workspace - for example, active site residues.

__init__(panel, title=None, label_text=None, allow_empty_list=False, markers_color=None, hide_markers_on_close=False)

Create a new dialog instance

Parameters
  • panel (QtWidgets.QWidget) – The parent panel for this dialog.

  • title – Optional title for the dialog. Default is “Active Site Residues”.

  • label_text (str) – Optional label text for describing what the residues are to be picked for. Default is “Pick residues to define the active site:”

  • allow_empty_list (bool) – Whether it is OK to remove all selected residues from the list and close the dialog with an empty res list.

  • markers_color (3-tuple of floats, 0 <= value <= 1.0, or None) – 3-tuple of floats between 0 and 1 each to define a color to use for marking selected residues. If a value of None is passed, no markers will be added.

  • hide_markers_on_close (bool) – indicates whether Maestro Workspace markers should be hidden when dialog is closed. In this mode any existing markers will be shown when dialog is shown.

display()

Open the dialog.

pickResidueAtom(anum)
openSelectDialog()

Opens an atom selection dialog. When a user specifies the ASL, all atoms matching the ASL will be extended to full residues, and each of these residues will be added to the residues table.

addResidueToTable(res)

Adds a row to the table for the specified residue.

Parameters

res (schrodinger.structure.Structure) – Residue to be added.

residuesModelUpdated()

Called when rows are added to or removed from the residues table.

residueSelectionChanged()

Called when residue rows are selected or de-selected.

removeSelectedRows()

Called when “Delete” button is clicked.

accept()

If the user input is valid, accept and close the dialog. Otherwise, display a warning message to the user.

reject()

Called when the user closes the dialog with cancel or X.

showAllMarkers()

Displays all workspace markers for each row.

hideAllMarkers()

Hides the markers for all rows.

clear()

Clear the residues table.

getResiduesList()

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

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

getResiduesCenter()

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

Returns

Tuple of center x, y, z coordinates

Return type

tuple of (float, float, float)