schrodinger.application.matsci.smartsutilsgui module¶
GUI elements for working with SMARTS patterns
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.matsci.smartsutilsgui.SMARTSNameValidator(*args, **kwargs)¶
Bases:
schrodinger.application.matsci.atomicsymbolsgui.AtomNameLabelValidator
Ensures that the line edit contains only valid SMARTS name characters
- VALID_LABEL_PUNCTUATION = '_-()[]'¶
- Acceptable = 2¶
- Intermediate = 1¶
- Invalid = 0¶
- __init__(*args, **kwargs)¶
Overwrite parent to set the valid label characters dictionary on creation
- blockSignals(self, b: bool) bool ¶
- changed¶
changed(self) [signal]
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- fixup(self, a0: str) str ¶
- inherits(self, classname: str) bool ¶
- installEventFilter(self, a0: QObject)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- locale(self) QLocale ¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- restoreLastValidValue(edit)¶
Restores edit to the last valid value validated by this Validator
- Parameters
edit (QLineEdit) – The QLineEdit to restore the value to
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setLocale(self, locale: QLocale)¶
- setObjectName(self, name: str)¶
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- signalsBlocked(self) bool ¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- validate(value, position)¶
See PyQt documentation for arguments and return values.
- schrodinger.application.matsci.smartsutilsgui.populate_smarts_edit(smarts_edit, maestro, warning, append=False, delim=' ', canvas_api=False, use_rdkit=False, fall_back=False, check_connectivity=True, allow_intermolecular=False)¶
Populates the smarts edit with smarts pattern grabbed from WS. If append is true then the smarts pattern is appended to smarts_edit with delim (space as default) as delimiter else smarts_edit is replaced with the given smarts pattern.
- Parameters
smarts_edit (swidgets.SMARTSEdit) – The smarts edit on which population of smarts pattern is to be done
maestro (schrodinger.maestro.maestro) – maestro provides structure and selected atom index
warning (function) – prints warning message
append (bool) – If flag is true then smarts is appended to smarts_edit with delim as delimiter else smarts_edit is replaced with smarts
delim (str) – The delimiter used when append is true.
canvas_api (bool) – whether to use analyze.generate_smarts or analyze.generate_smarts_canvas
use_rdkit (bool) – Whether to use rdkit
fall_back (bool) – whether to fall back on using analyze.generate_smarts if canvas/rdkit fails, used only if canvas_api is True
check_connectivity (bool) – If True, check for whether the atoms given are connected and raise a ValueError if they are not. SMARTS generation will give bogus results for unconnected atoms.
allow_intermolecular (bool) – If check_connectivity is False this controls whether matches must be intramolecular or allowed to be intermolecular
- schrodinger.application.matsci.smartsutilsgui.get_smarts_from_ws(maestro, warning, canvas_api=False, use_rdkit=False, fall_back=False, check_connectivity=True, allow_intermolecular=False)¶
Get the SMARTS pattern for the selected atoms in the workspace and insert it into the SMARTS entry
- Parameters
maestro (
schrodinger.maestro.maestro
) – maestro provides structure and selected atom indexwarning (function) – prints warning message
canvas_api (bool) – whether to use analyze.generate_smarts or analyze.generate_smarts_canvas
use_rdkit (bool) – Whether to use rdkit
fall_back (bool) – whether to fall back on using analyze.generate_smarts if canvas/rdkit fails, used only if canvas_api is True
check_connectivity (bool) – If True, check for whether the atoms given are connected and raise a ValueError if they are not. SMARTS generation will give bogus results for unconnected atoms.
allow_intermolecular (bool) – if check_connectivity is False this controls whether matches must be intramolecular or allowed to be intermolecular
- Return type
str or None
- Returns
smarts pattern selected from workspace or None if any of the validation fails