schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.charge_constraints_widgets module

class schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.charge_constraints_widgets.AtomSelectionDelegate(parent)

Bases: schrodinger.application.jaguar.gui.input_tab_widgets_pka.AtomSelectionDelegate

A delegate for selecting atoms for the charge constraint.

Note:

We currently don’t allow the user to type in atom names. If the user doesn’t click on an atom in the workspace, then we have no way to determine which entry the constraint refers to. Invalid atoms names (i.e. those not in the form <element><index>) would also cause issues for the weights pop- up. Additionally, we’d have to add atom name validation to the model in order to color cells with errors and to give a tool tip explaining the problem, as is done for pKa atoms. We’d also have to implement validate() for the sub-tab. It would be possible to solve these issues, but for now we simply require that the user select atoms from the workspace.

Variables:
  • addJaguarMarker (PyQt5.QtCore.pyqtSignal) –

    A signal emitted when a workspace marker should be added. Emitted with:

    • The list of atoms to add the marker for (list)
    • The index that the atom is being marked for. (Used to determine whether the marker should be highlighted or not.) (QtCore.QModelIndex)
  • removeJaguarMarker (PyQt5.QtCore.pyqtSignal) –

    A signal emitted when a workspace marker should be removed. Emitted with:

    • The list of atoms to remove the marker for (list)
DEFAULT_DATA = {}
MAESTRO_STATUS_MESSAGE = 'Pick an atom to be included in the charge constraint'
TOOL_TIP_INSTRUCTIONS = 'Click an atoms in the workspace to\nset them as a charge constraint atom.\nClick again to remove.'
TOOL_TIP_WRONG_EID = 'The atom you selected is not\npart of this structure.'
addJaguarMarker
clearRowIfEmpty(editor, hint=None)

When the editor closes, erase a row if it does not contain any atom names. Without any atom names, the row is meaningless. By clearing the rows immediately, we avoid the need to later warn the user about them.

Parameters:
  • editor (PyQt5.QtWidgets.QLineEdit) – The recently-closed editor
  • hint – Ignored, but present for compatibility with the Qt signal
createEditor(parent, option, index)

Create an editor as in the super-class, but mark it as read-only. See the :note in the class documentation for an explanation of why.

See Qt documentation for an explanation of arguments and return values

removeJaguarMarker
setModelData(editor, model, index)

Before setting the model data, clear any workspace markers we have created and restore the markers to the model values. This avoids having the model trying to clear a marker that no longer exists, which would raise an exception.

See parent class and PyQt documentation for an explanation of arguments.

class schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.charge_constraints_widgets.ChargeConstraintRow(entry_id=None, title=None, charge=None, weights=None)

Bases: schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.base_widgets.SubTabRow

Data about a charge constraint setting

Variables:DEFAULT_WEIGHT (float) – default atom weight in charge constraint.
DEFAULT_WEIGHT = 1.0
copy()

Create a new row object that is a copy of this row

Return type:ChargeConstraintRow
Returns:A row item that is a copy of this row.
updateAtomNames(names)

Change the atom names for this constraint

Parameters:names (list) – The list of atom names
weightsByNum()

Get a dictionary of {atom index: atom weight}. (As opposed to weights, which is {atom name: atom weight})

Returns:Dictionary of {atom index: atom weight}
Return type:dict
class schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.charge_constraints_widgets.ChargeConstraintsColumns

Bases: object

ATOMS = 0
CHARGE = 3
HEADERS = ['Atom', 'ID', 'Entry Title', 'Charge']
ID = 1
NUM_COLS = 4
TITLE = 2
class schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.charge_constraints_widgets.ChargeConstraintsModel(parent=None)

Bases: schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.base_widgets.SubTabModel

COLUMN

alias of ChargeConstraintsColumns

MARKER_SETTINGS = {'color': 'green', 'alt_color': 'yellow'}
ROW_CLASS

alias of ChargeConstraintRow

UNEDITABLE = (1, 2)
addJaguarMarkerForRow(row)
copyRow(row)

Copy row into a new row in this model

Parameters:row (ChargeConstraintRow) – The row item containing the data to copy
removeJaguarMarkerForRow(row)
class schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.charge_constraints_widgets.ChargeConstraintsTableView(parent=None)

Bases: schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.base_widgets.SubTabTableView

The view for the charge constraints.

COLUMN

alias of ChargeConstraintsColumns

MARKER_SETTINGS = {'color': 'green', 'alt_color': 'yellow'}
addJaguarMarker
dataChanged(topleft, bottomright, role)

If the atoms data in a selected cell changes, make sure that the newly created markers are highlighted

removeJaguarMarker
class schrodinger.application.jaguar.gui.tabs.sub_tab_widgets.charge_constraints_widgets.ChargeSelectorDelegate(parent)

Bases: schrodinger.ui.qt.pop_up_widgets.PopUpDelegate

A delegate for selecting charge constraint atom weights.

setEditorData(editor, index)
setModelData(editor, model, index)