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:
PyQt5.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
¶
-
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.
-
class
schrodinger.application.phase.featureselector.
FeatureModel
(parent=None)¶ Bases:
schrodinger.ui.qt.table_helper.RowBasedTableModel
Features model.
-
Column
¶ alias of
<unknown>.FeatureColumns
-
ROW_CLASS
¶ alias of
FeatureRow
-
CUSTOM_HYPO_TEXT
= 'Custom'¶
-
XVOL_TEXT
= 'XVols'¶
-
featureToggled
¶
-
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.
-