schrodinger.ui.qt.atomselector module

PyQt version of the Maestro’s ASL frame.

Designed to be used within Maestro, but possible to be used outside of Maestro as well. Some options will disabled if run outside of Maestro.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.ui.qt.atomselector.generate_asl_for_atom_by_mode(atomnum: int, pick_type: int) str

Generate asl for picked atom by pick type.

Parameters
  • atomnum (int) – The atom index that’s picked.

  • pick_type (int) – pick type of atom. 0 for atoms. 1 for residues. 2 for chains. 3 for molecules. 4 for entries.

Raises

ValueError – pick_type is not in range [0,4].

Returns

asl for picked atom.

Return type

str

class schrodinger.ui.qt.atomselector.ASLPopupMenu

Bases: PyQt6.QtWidgets.QMenu

ASL menu intended to be shown off of a button.

Variables

hidden (QtCore.pyqtSignal) – A signal emitted when menu is hidden.

hidden

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.

hideEvent(event)

Emit hidden() signal when popup is hidden

class schrodinger.ui.qt.atomselector.ASLItem(text, asl, parent)

Bases: PyQt6.QtWidgets.QPushButton

Asl item to display text along with the plus button

Variables

itemClicked (QtCore.pyqtSignal) – A signal emitted when this asl item is clicked. - Asl of the item

itemClicked

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.

__init__(text, asl, parent)
Parameters
  • text (str) – Display text of the asl item

  • asl (str) – Asl of the item

  • parent (QtWidgets.QWidget) – Parent of the item

class schrodinger.ui.qt.atomselector.AtomSelector(parent, label='', pick_text='Pick atom in Workspace', show_asl=True, show_all=True, show_select=True, show_previous=True, show_selection=True, append_mode=True, show_markers=False, show_pick=True, default_pick_mode=0, show_plus=False, selection_button_text='Selection')

Bases: PyQt6.QtWidgets.QGroupBox

Variables
  • aslModified (QtCore.pyqtSignal) – Emitted when a new atom is picked or the ASL is manually edited by the user. - New asl

  • atomSelectionDialogAboutToBeShown (QtCore.pyqtSignal) – A signal emitted when ‘Atom Selection’ dialog is about to be shown.

  • atomSelectionDialogDismissed (QtCore.pyqtSignal) – A signal emitted when ‘Atom Selection’ dialog is dismissed.

  • aslTextModified (QtCore.pyqtSignal) – Emitted when there is ANY change in the asl text field. Use this in case any action button needs to be enabled/disabled based on asl text field. - New asl

aslModified

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.

atomSelectionDialogAboutToBeShown

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.

atomSelectionDialogDismissed

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.

aslTextModified

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.

DEFAULT_TOOLTIP = 'Enter ASL to define a group of atoms'
ASL_ITEMS = {'Displayed Atoms': 'displayed_atoms', 'Heavy Atoms': 'heavy_atoms', 'Hydrogens-All': 'all_hydrogens', 'Hydrogens-Nonpolar': 'non_polar_hydrogens', 'Hydrogens-Nonpolar Ligand': 'non_polar_ligand_hydrogens', 'Hydrogens-Polar': 'polar_hydrogens', 'Ions': 'ions', 'Ligands': 'ligand', 'Membrane': 'membrane', 'Metal Atoms': 'metals', 'Nucleic Acids': 'nucleic_acids', 'Protein': '(protein) and not ligand', 'Protein Backbone': '(backbone) and not ligand', 'Protein Near Ligand': 'protein_near_ligand', 'Protein Side Chains': '(withinbonds 1 sidechain) and not ligand', 'Waters': 'water', 'Workspace Selection': 'workspace_selection'}
__init__(parent, label='', pick_text='Pick atom in Workspace', show_asl=True, show_all=True, show_select=True, show_previous=True, show_selection=True, append_mode=True, show_markers=False, show_pick=True, default_pick_mode=0, show_plus=False, selection_button_text='Selection')

AtomSelector requires <parent> argument, which should be a Qt Widget into which this frame should be added.

This widget acts like any other PyQt widget.

parent - The parent widget

Parameters
  • label (str) – Label to show above the widget

  • pick_text (str) – Text that will be displayed on the bottom of the main Maestro window when the pick button is checked.

  • show_asl (bool) – Whether to show the QLineEdit field for the ASL.

  • show_all (bool) – Whether to show the “All” button. Clicking it will select the “all” ASL>

  • show_select (bool) – Whether to show the “Select…” button. Clicking it would show an ASL selection dialog.

  • show_previous (bool) – Whether to show the “Previous” button. Clicking it would select the previous ASL that was used.

  • show_selection (bool) – Whether to show the “Selection” button. Clicking it would use ASL derived from the atoms selected in the Workspace.

  • append_mode (bool) – When a new atom is picked, whether to append to an existing ASL instead of replacing it.

  • show_markers (bool) – Whther to show the “Markers” checkbox.

  • show_pick (bool) – Whether to show the “Pick” checkbox along with the pick menu.

  • default_pick_mode (int) – What the default pick mode should be. One of: PICK_ATOMS, PICK_RESIDUES, PICK_CHAINS, PICK_MOLECULES, PICK_ENTRIES. Default is PICK_ATOMS.

  • show_plus (bool) – Whther to show the “+” button.

  • selection_button_text (str) – This will be honored only if show_selection is True. By default it is “Selection”, if show_asl & show_plus are True, then selection button text will be “Load Selection”, otherwise given text will be set to the selection button.

Usage example:

atom_selector = AtomSelector(parent) layout.addWidget(atom_selector)

To get the selected ASL, simply call <AtomSelector>.getAsl()

showEvent(self, a0: Optional[QShowEvent])
hideEvent(self, a0: Optional[QHideEvent])
setupPickToggle(pick_text)

Set up pick toggle by creating pick layout, and adding pick toggle & combo menu to it.

Parameters

pick_text (str) – Text that will be displayed on the bottom of the main Maestro window when the pick button is checked.

setupPlusButton(layout, button_height, show_select, show_previous)

Setups the plus button by adding the button and its popup widget

Parameters
  • layout (QtWidgets.QLayout) – Layout to which the plus button should be added.

  • button_height (int) – Height and width of the plus button.

  • show_previous (bool) – Whether to show the “Previous” button. Clicking it would select the previous ASL that was used.

  • show_select (bool) – Whether to show the “Select…” button. Clicking it would show an ASL selection dialog.

updatePlusButtonStyle()

Update plus_button style

setAsl(asl)
reset()

Reset the widget to the defaults

aslItemClicked(asl)

Update the asl according to the clicked asl item.

loadWorkspaceSelection()

Loads workspace selection to the AtomSelector

getAsl()

Return the selected ASL string

setDarkStyle()

Set dark style to ‘All’ and ‘+’ buttons

setMarkersEnabled(enable: bool)

Set enabled/disabled state of the Markers checkbox. Note: Disabling the Markers checkbox hides the workspace markers.

Parameters

enable – Whether to enable or disable the Markers checkbox.

class schrodinger.ui.qt.atomselector.MappableAtomSelector(*args, **kwargs)

Bases: schrodinger.models.mappers.TargetMixin, schrodinger.ui.qt.atomselector.AtomSelector

__init__(*args, **kwargs)
targetGetValue()
targetSetValue(asl)
schrodinger.ui.qt.atomselector.panel()