schrodinger.application.phase.featureselector module¶
Widget for letting the user show/hide or enable/disable features in a hypothesis. All features are shown in a grid, and each has a checkbox next to it.
- class schrodinger.application.phase.featureselector.FeatureSelector(parent=None)¶
Bases:
PyQt6.QtWidgets.QScrollArea
This frame contains widgets for selecting one or more features in a hypothesis (e.g. A1, A2, H1, etc.). The editor has a checkbox for each feature. This frame is intended to be embedded in a layout.
- selectionChanged¶
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__(parent=None)¶
- reset()¶
Unchecks all available checkboxes.
- clear()¶
Remove all checkboxes from the features layout.
- setFeatures(feature_names)¶
Initialize the editor with checkbox for each specified feature.
- getFeatureCheckbox(feature_name)¶
Return the checkbox for the feature.
- Parameters
feature_name (str) – The name of the feature (e.g. “A2”)
- setSelectedFeatures(features)¶
- Parameters
features (set of str) – The features to select/check.
Checks the checkboxes corresponding to the given set of feature, and unchecks the other checkboxes.
- getSelectedFeatures()¶
Return a set of selected features (their names).
- class schrodinger.application.phase.featureselector.FeatureRow(hypo_eid, hypo_name, feature_name, is_xvol, use_feature)¶
Bases:
object
Data class that contains information about single feature in a hypothesis. This can be a regular feature or excluded volume.
- __init__(hypo_eid, hypo_name, feature_name, is_xvol, use_feature)¶
Initialize feature data.
- Parameters
hypo_eid (int) – hypothesis entry id
hypo_name (str) – hypothesis name. For custom features hypothesis name should be set to None!
is_xvol (bool) – True if this is excluded volume and False otherwise
feature_name (str) – feature name (empty string in case of excluded volume)
use_feature (bool) – indicates whether checkbox for this feature is toggled on or off
- class schrodinger.application.phase.featureselector.FeatureColumns(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.TableColumns
- HypoName = Column 0 (Hypothesis Name)¶
- FeatureName = Column 1 (Feature)¶
- class schrodinger.application.phase.featureselector.FeatureModel(parent=None)¶
Bases:
schrodinger.ui.qt.table_helper.RowBasedTableModel
Features model.
- Column¶
alias of
schrodinger.application.phase.featureselector.FeatureColumns
- ROW_CLASS¶
alias of
schrodinger.application.phase.featureselector.FeatureRow
- CUSTOM_HYPO_TEXT = 'Custom'¶
- XVOL_TEXT = 'XVols'¶
- featureToggled¶
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.
- getSelectedFeatures(include_pt_feats, include_custom_feats)¶
Returns dictionary of checked feature names. It is keyed on hypothesis entry ids and contains feature names for each hypothesis.
- Parameters
include_pt_feats (bool) – indicates that selected features that came from PT hypotheses should be included
include_custom_feats (bool) – indicates that selected features that were manually added by the user should be included
- Returns
dictionary of checked feature names
- Return type
dict
- getSelectedExcludedVolumes()¶
Returns list of hypothesis entry ids which have excluded volumes checked.
- Returns
list of hypothesis entry ids, which have have excluded volumes checked
- Return type
list
- toggleSelection(hypo_eid, feature_name)¶
Flips use_feature flag for a given feature.
- Parameters
hypo_eid (int) – feature’s hypothesis entry id
feature_name (str) – feature name
- clearSelection()¶
Toggles of ‘use’ check boxes for all features.
- selectedFeaturesCount()¶
Returns total number of selected features (excluding volumes).
- getLastCustomFeatureNum()¶
Finds all ‘custom’ features and returns last feature number. For example, if custom features are [‘A1’, ‘D11’, ‘R5’] last custom feature number will be 11.
- updateFeatureNames(marker_features)¶
This function updates feature names in the model so that they are consistent with markers feature names. This is needed when user changes feature type using edit feature dialog. In this case only a single feature row needs to be modified.
- Parameters
marker_features – dictionary of feature marker names keyed on hypothesis entry ids.