schrodinger.ui.ligfilter module

Components for creating GUIs that set up Ligfilter jobs.

See the schrodinger.utils.ligfilter module for a complete description of ligfilter and its functions.

There’s not likely to be much general use for this module unless you are creating a modified interface for LigFilter or want to embed an interface to Ligfilter in your own application.

The main class in this module is the LigfilterFrame. This provides a complete interface to the Ligfilter GUI.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.ui.ligfilter.PatternModel

Bases: PyQt6.QtCore.QAbstractTableModel

Class for strring patterns (definitions) and their groups

__init__()
rowCount(parent=<PyQt6.QtCore.QModelIndex object>)

Returns number of rows

columnCount(parent=<PyQt6.QtCore.QModelIndex object>)

Returns number of columns

setItems(data_list)

Sets the internal data list to the specified list. NOTE: Will use the actual list passed to it (without making a copy)

getRowText(row)
data(index, role=ItemDataRole.DisplayRole)

Given a cell index, returns the data that should be displayed in that cell (text or check button state). Used by the view.

headerData(section, orientation, role)

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

flags(index)

Returns flags for the specified cell. Whether it is enabled or not.

class schrodinger.ui.ligfilter.DefinitionViewerDialog(parent, definitionname, definitions)

Bases: PyQt6.QtWidgets.QDialog

Frame containing a text box with a text display of the definition. Shows multi-level definitions (i.e., patterns built from other patterns) with indenting.

__init__(parent, definitionname, definitions)

Pass in a definition name and a dictionary of definitions (names and Definition objects), and this class displays the definition in a text box.

printTree(name, level)

Recursively descend through the included/excluded lists, printing to the text box and indenting the text at deeper levels.

class schrodinger.ui.ligfilter.AddDefinitionDialog(parent, definitions)

Bases: PyQt6.QtWidgets.QDialog

Frame for generating a pattern definition.

warning(text)
__init__(parent, definitions)
okPressed()
rejected()

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.

helpPressed()
display()

Brings up the dialog and waits for the user to close it. Returns None if cancelled, or modified receptor if OK.

setDefaults()
updateDefinitionState(selected=None, deselected=None)
view()
getDefinition()

Return the pattern defined in the AddDefinitionDialog. Return None if the definition is bad, or if the user opts not to overwrite an existing pattern definition.

updateText()
include()
exclude()
getSMARTSFromSelection()

Set the SMARTS entry field according to atoms selected in the Workspace.

updateInclExclState(selected=None, deselected=None)
delete()
deleteAll()
class schrodinger.ui.ligfilter.CriteriaListModel

Bases: PyQt6.QtCore.QAbstractListModel

Class for storing the criteria list information.

__init__()
rowCount(parent=<PyQt6.QtCore.QModelIndex object>)

Returns number of rows

resetData()
setAllData(lines)
data(index, role=ItemDataRole.DisplayRole)

Given a cell index, returns the data that should be displayed in that cell (text or check button state). Used by the view.

getRowCriteria(rownum)
removeRow(self, row: int, parent: QModelIndex = QModelIndex()) bool
flags(index)

Returns flags for the specified cell. Whether selectable or not.

class schrodinger.ui.ligfilter.LigfilterFrame(parent, show_properties_tab=True)

Bases: PyQt6.QtWidgets.QWidget

Frame for setting up Ligfilter jobs, including property/SMARTS criteria and new definitions. This is the main class in this module.

__init__(parent, show_properties_tab=True)
filterSelectionChanged(selected=None, deselected=None)
setPatternOptions()

Set the option menu list of keys to the predefined keys, the default patterns, and any custom patterns. There always are predefined keys, so the “add pattern criterion” widgets stay enabled. The “delete pattern” widgets are disabled if no custom patterns are defined.

getSelectedPatternName()

Return the name of the selected pattern (or None)

selectPattern()
selectPredefined()
selectProperty()
setMultiplePropCriterionState(result)
setMultiplePredefinedCriterionState(result)
setMultiplePatternCriterionState(result)
updateText()

Rewrite the text in the criteria/patterns text box

addPropCriterion()
addpropop1Modified(result)

Callback for the first operator OptionMenu on the Properties tab. Disables the rest of the “Add criterion” widgets when property existence is being checked.

checkPropertyType(prop)

Callback for modifications to the property EntryField. Adjust the operator list and value validator according to the property type entered. The EntryField may need to be cleared to prevent non-modifiable values (e.g., when switching from string to integer).

viewPattern()
addPredefinedCriterion()
addPatternCriterion()
addPattern()

Callback function for the “New” button. Pops up a dialog for construction the new definition, and incorporates the new (or redefined) pattern if the dialog returns one.

importFilterFile()

Read in an external filter file

readFilterCriteria(fh)

Reads the filter criteria from the specified open file handle or a list strings (lines in a filter file).

deleteEntry()

Delete the selected criterion or pattern

setDefaults()
setProperties(propertylist, resettable=True)

Set the available CT-level properties. If this properties list should not be reset when the user presses the Reset button (See Ev:132763), set resettable to False.

getFilterText()

Will return a string representation of the specified criteria, including any user-defined definitions. Returns a Python Unicode string.

warning(text)
setup(jobparam)

Function passed to AppFramework that is called as part of the setup cascade when a job is started/written. Place all data in the jobparam object necessary for running the job.