schrodinger.application.jaguar.gui.input_tab_widgets_pka module¶
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
ProjEntryPka
(row=None)¶ Bases:
schrodinger.application.jaguar.gui.input_tab_widgets.ProjEntry
-
PKA_ATOM_PROP
= 's_m_pKa_atom'¶
-
PKA_VALID
= 0¶
-
PKA_INVALID
= 1¶
-
PKA_MISSING
= 2¶
-
update
(row)¶ Update this entry with information from the provided row
Parameters: row ( schrodinger.project.ProjectRow
) – The project row
-
getStructureWithJagNames
()¶ Return the entry structure with jaguar atom naming applied
Returns: The structure with jaguar atom naming applied Return type: schrodinger.structure.Structure
-
reset
()¶ Reset any user-specified settings
-
checkPkaAtom
()¶ Make sure that a valid pKa atom(s) is specified
Returns: PKA_VALID if all valid pKa atoms are specified, PKA_INVALID if any invalid pKa atom is specified, and PKA_MISSING is no pKa atom is specified. Return type: int
-
getPkaAtom
()¶ Get the currently selected pKa atom(s)
Returns: If the currently selected pKa atom(s) is valid, returns the list of atoms itself. Otherwise, returns None. Return type: list or NoneType
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
ProjEntryTuplePka
(entry_id, struc, charge, spin_mult, pka_atom)¶ Bases:
tuple
-
charge
¶ Alias for field number 2
-
entry_id
¶ Alias for field number 0
-
pka_atom
¶ Alias for field number 4
-
spin_mult
¶ Alias for field number 3
-
struc
¶ Alias for field number 1
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
InputEntriesColumnsPka
¶ Bases:
object
Column constants for the pKa selected entries table
-
HEADERS
= ['ID', 'In', 'Entry Title', 'Charge', 'Spin Mult.', 'pKa Atom']¶
-
NUM_COLS
= 6¶
-
ID
= 0¶
-
INCLUSION
= 1¶
-
TITLE
= 2¶
-
CHARGE
= 3¶
-
SPIN_MULT
= 4¶
-
PKA_ATOM
= 5¶
-
BASIS
= -1¶
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
PickingModes
¶ Bases:
enum.Enum
An enumeration.
-
MANUAL
= 1¶
-
AUTO
= 2¶
-
SMARTS
= 3¶
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
InputEntriesModelPka
(parent)¶ Bases:
schrodinger.application.jaguar.gui.input_tab_widgets.InputEntriesModel
The data model for the pKa selected entries table
Variables: - set_pka_marker (
PyQt5.QtCore.pyqtSignal
) –A signal emitted when a new pKa atom should be marked in the workspace. Emitted with two arguments:
- The entry id of the structure to be marked (str)
- The atom to be marked (
schrodinger.structure._StructureAtom
)
- projUpdated – A signal emitted when the project changes which should trigger a SMARTS search again if picking mode is SMARTS
-
COLUMN
¶ alias of
InputEntriesColumnsPka
-
set_pka_marker
¶
-
projUpdated
¶
-
ROW_CLASS
¶ alias of
ProjEntryPka
-
setPickingMode
(mode)¶ Set the picking mode. This impacts what is shown in the pKa atom column.
Parameters: mode (PickingModes) – the new picking mode
-
data
(self, QModelIndex, role: int = Qt.DisplayRole) → Any¶
-
flags
(index)¶ Enable or disable the pka column depending on whether manual editing is enabled or not
Parameters: index ( QtCore.QModelIndex
) – The model index to get flags for.
-
setData
(index, value, role=2)¶ Set data for the specified index. The spin multiplicity tool tip will be shown if an invalid spin multiplicity is set, or if a charge is set that renders the spin multiplicity invalid. (The tool tip explains that the default spin multiplicity is being used because the user-specifed value is invalid.)
Parameters: - index (
PyQt5.QtCore.QModelIndex
) – The index to modify - value – The value to set
- role (int) – The role to set data for. Must be Qt.EditRole or setting will fail.
Returns: True if setting succeeded. False if it failed.
Return type: bool
- index (
-
updatePkaAtomsFromSmarts
(smarts_models)¶ Update pKa atoms of entry rows based on patterns given by a list of SMARTS patterns and atom positions.
Parameters: smarts_models (list(SmartsPageModel)) – a list of smarts patterns to search for in each structure. The list may be empty.
-
projectUpdated
()¶ Update the table when the project is updated
-
getStructures
()¶ Get a list of all structures loaded into the table (i.e. all structures selected in the project table) and the associated settings.
Returns: A list of ProjEntryTuple objects Return type: list
-
checkPkaAtoms
()¶ Make sure that all structure have a valid pKa atom selected
Returns: A tuple of - A list of structures with invalid pKa atoms - A list of structures with no pKa atom Return type: tuple
-
addPkaMarkers
(index, start_row, end_row)¶ Add pKa workspace atom markers for the specified rows
Parameters: - index – Not used, but present for Qt compatability
- start_row (int) – The first row to add a pKa marker to
- end_row (int) – The last row to add a pKa marker to
-
removePkaMarkers
(index, start_row, end_row)¶ Remove the pKa workspace atom markers for the specified rows
Parameters: - index – Not used, but present for Qt compatibility
- start_row (int) – The first row to add a pKa marker to
- end_row (int) – The last row to add a pKa marker to
- set_pka_marker (
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
InputEntriesViewPka
(parent)¶ Bases:
schrodinger.application.jaguar.gui.input_tab_widgets.InputEntriesView
The view for the pKa selected entries table
Variables: set_pka_marker ( PyQt5.QtCore.pyqtSignal
) –A signal emitted when a new pKa atom should be marked in the workspace. Emitted with two arguments:
- The entry id of the structure to be marked (str)
- List of atoms (
schrodinger.structure._StructureAtom
) to be marked
-
COLUMN
¶ alias of
InputEntriesColumnsPka
-
set_pka_marker
¶
-
setEditablePkaAtomDelegate
(editable)¶ Add the delegates to the pKa column
Parameters: editable – Whether to set the editable default message delegate or to set the Qt default delegate
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
SmartsPageModel
(default_value=None, **kwargs)¶ Bases:
schrodinger.models.parameters.ParamModel
Model for a single page which contains the a single smarts string and single atom position index.
-
atom_pos
¶
-
smarts
¶
-
atom_posChanged
¶
-
atom_posReplaced
¶
-
smartsChanged
¶
-
smartsReplaced
¶
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
PkaPage
(*args, **kwargs)¶ Bases:
schrodinger.models.mappers.MapperMixin
,schrodinger.ui.qt.basewidgets.BaseWidget
-
model_class
¶ alias of
SmartsPageModel
-
initSetOptions
()¶ Suggested subclass use: set instance variables, excluding layouts and subwidgets.
-
initSetUp
()¶ Creates widget from
ui
and stores itui_widget
.Suggested subclass use: create and initialize subwidgets, and connect signals.
-
updateSpinBoxLimits
()¶ Update limits of atom position spin box to reflect the number of atoms in the SMARTS string
-
defineMappings
()¶ Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Most commonly, targets will be a basic widget, like QLineEdit or QComboBox, or a custom widget that inherits from MapperMixin or DefaultTargetMixin.
For more fine-grain custom control, instantiate a Target object, which allows custom setters, getters, and signals to be specified.
The param is an abstract param reference, e.g. MyModel.my_param.
Example:
def defineMappings(self): combo = self.style_combo return [(self.name_le, MyModel.name), (Target(combo, getter=combo.currentText, setter=combo.setCurrentText), MyModel.style), (self.coord_widget, MyModel.coord)]
-
getFromSelection
()¶ Get smarts from selected atoms in workspace and add it to the current page
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
SmartsSelector
(*args, **kwargs)¶ Bases:
schrodinger.ui.qt.basewidgets.BaseWidget
A popup widget that allows users to specify any number of SMARTS strings to specify pka atoms as well as an atom position which specifies the atom in the SMARTS
Variables: smartsChanged – a signal emitted when the popup is closed. This signal passes the list of models for the SMARTS pages Vartype: schrodinger.Qt.QtCore.pyqtSignal -
closed
¶
-
initSetOptions
()¶ Suggested subclass use: set instance variables, excluding layouts and subwidgets.
-
initSetUp
()¶ Creates widget from
ui
and stores itui_widget
.Suggested subclass use: create and initialize subwidgets, and connect signals.
-
addPage
()¶ Add an additional page for specifying SMARTS
-
removeCurrentPage
()¶ Remove the current page. If there was only one page before removing, add another after so there is always one page.
-
next
()¶ Show next page of stacked widget
-
back
()¶ Show previous page of stacked widget
-
updatePagination
()¶ Enable or disable forward and back button based on current page index and number of pages and update label indicating current page
-
getModels
()¶ Get the models for the Smarts Pages
Returns: A list of the models Return type: list(SmartsPageModel)
-
closeEvent
(ev)¶ Ensures proper handling of OK, Cancel, and [X] button clicks
-
-
class
schrodinger.application.jaguar.gui.input_tab_widgets_pka.
AtomSelectionDelegate
(parent)¶ Bases:
schrodinger.application.jaguar.gui.input_tab_widgets.CommitMultipleDelegate
,schrodinger.ui.qt.delegates.DefaultMessageDelegate
A delegate for selecting a pKa atom. The atom name can either be typed into the line edit or selected from the workspace. A tool tip containing instructions will appear when the editor is first open and any time the user hovers their mouse over the editor. If the user clicks on an atom from the wrong structure, the atom will be ignored and a tool tip warning will appear. Clicking on an atom does not close the editor so that the user can immediately pick a different atom if desired.
Variables: set_pka_marker ( PyQt5.QtCore.pyqtSignal
) –A signal emitted when a new pKa atom should be marked in the workspace. Emitted with two arguments:
- The entry id of the structure to be marked (str)
- List of atoms (
schrodinger.structure._StructureAtom
) to be marked
-
MAESTRO_STATUS_MESSAGE
= 'Pick an atom to be treated as the pKa atom'¶
-
TOOL_TIP_INSTRUCTIONS
= 'Click an atom in the workspace to\nset it as the pKa atom or type the\natom name here.'¶
-
TOOL_TIP_WRONG_EID
= 'The atom you selected is not\npart of this structure.'¶
-
set_pka_marker
¶
-
createEditor
(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget¶
-
setEditorData
(self, QWidget, QModelIndex)¶
-
setModelData
(self, QWidget, QAbstractItemModel, QModelIndex)¶
-
eventFilter
(editor, event)¶ Make sure that the editor doesn’t close when the user clicks on another window since that will prevent the user from being able to click on an atom.
Parameters: - editor (
PyQt5.QtWidgets.QWidget
) – The pKa atom line edit - event – A Qt event
- event –
PyQt5.QtCore.QEvent
Note: We don’t need to worry about the case where the user clicks on a different widget in the pKa panel after selecting an atom. Since the editor was the last widget with focus in the pKa panel, it will receive another FocusOut event when the other widget receives focus, and that FocusOut event will cause the editor to close.
- editor (