Package schrodinger :: Package application :: Package phase :: Module featureselector :: Class FeatureModel
[hide private]
[frames] | no frames]

Class FeatureModel

         object --+                            
                  |                            
  sip.simplewrapper --+                        
                      |                        
            sip.wrapper --+                    
                          |                    
       PyQt4.QtCore.QObject --+                
                              |                
PyQt4.QtCore.QAbstractItemModel --+            
                                  |            
   PyQt4.QtCore.QAbstractTableModel --+        
                                      |        
          Qt.QtCore.QAbstractTableModel --+    
                                          |    
      ui.qt.table_helper.RowBasedTableModel --+
                                              |
                                             FeatureModel

Features model.

Nested Classes [hide private]
TableColumns Column
A class describing the table's columns.
type ROW_CLASS
A class that represents a single row of the table.
Instance Methods [hide private]
 
featureToggled(...)
 
_getData(self, col, feature_row, role)
 
_getForegroundColor(self, col, feature_row, role)
object
_setData(self, col, feature_row, value, role, row_num)
Set data for the specified index and role.
dict
getSelectedFeatures(self, include_pt_feats, include_custom_feats)
Returns dictionary of checked feature names.
list
getSelectedExcludedVolumes(self)
Returns list of hypothesis entry ids which have excluded volumes checked.
 
toggleSelection(self, hypo_eid, feature_name)
Flips use_feature flag for a given feature.
 
clearSelection(self)
Toggles of 'use' check boxes for all features.
 
selectedFeaturesCount(self)
Returns total number of selected features (excluding volumes).
 
getLastCustomFeatureNum(self)
Finds all 'custom' features and returns last feature number.
 
updateFeatureNames(self, marker_features)
This function updates feature names in the model so that they are consistent with markers feature names.
dict
_getFeatureNames(self)
Returns dictionary of all feature names in the model, which is keyed on hypothesis entry ids.

Inherited from ui.qt.table_helper.RowBasedTableModel: __init__, af2SettingsGetValue, af2SettingsSetValue, appendRow, appendRowObject, columnChanged, columnCount, data, flags, formatFloat, headerData, loadData, removeRows, removeRowsByIndices, replaceRows, reset, rowChanged, rowCount, setData

Inherited from ui.qt.table_helper.RowBasedTableModel (private): _callDataMethod, _checkEditableCols, _createTableColumnsObject, _getRowFromIndex, _rowObjectData, _textAlignmentData

Inherited from Qt.QtCore.QAbstractTableModel: setRoleNames, setSupportedDragActions

Inherited from PyQt4.QtCore.QAbstractTableModel: dropMimeData, hasChildren, index, parent

Inherited from PyQt4.QtCore.QAbstractItemModel: beginInsertColumns, beginInsertRows, beginMoveColumns, beginMoveRows, beginRemoveColumns, beginRemoveRows, beginResetModel, buddy, canFetchMore, changePersistentIndex, changePersistentIndexList, columnsAboutToBeInserted, columnsAboutToBeMoved, columnsAboutToBeRemoved, columnsInserted, columnsMoved, columnsRemoved, createIndex, dataChanged, decodeData, encodeData, endInsertColumns, endInsertRows, endMoveColumns, endMoveRows, endRemoveColumns, endRemoveRows, endResetModel, fetchMore, hasIndex, headerDataChanged, insertColumn, insertColumns, insertRow, insertRows, itemData, layoutAboutToBeChanged, layoutChanged, match, mimeData, mimeTypes, modelAboutToBeReset, modelReset, persistentIndexList, removeColumn, removeColumns, removeRow, resetInternalData, revert, roleNames, rowsAboutToBeInserted, rowsAboutToBeMoved, rowsAboutToBeRemoved, rowsInserted, rowsMoved, rowsRemoved, setHeaderData, setItemData, sibling, sort, span, submit, supportedDragActions, supportedDropActions

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CUSTOM_HYPO_TEXT = 'Custom'
  XVOL_TEXT = 'XVols'

Inherited from ui.qt.table_helper.RowBasedTableModel: CHECKABLE_COLS, COLUMN, EDITABLE_COLS, ROW_LIST_OFFSET, SHOW_ROW_NUMBERS, UNEDITABLE_COLS

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Properties [hide private]

Inherited from ui.qt.table_helper.RowBasedTableModel: rows

Inherited from object: __class__

Method Details [hide private]

_getData(self, col, feature_row, role)

 
Decorators:
  • @table_helper.data_method(Qt.DisplayRole, Qt.CheckStateRole)

_getForegroundColor(self, col, feature_row, role)

 
Decorators:
  • @table_helper.data_method(Qt.ForegroundRole)

_setData(self, col, feature_row, value, role, row_num)

 

Set data for the specified index and role. This method should be reimplemented in any subclasses that contain editable columns.

Parameters:
  • col - The column to set data for
  • row_data - The ROW_CLASS instance to modify
  • value - The value to set
  • value - object
  • role - The role to set data for
  • row_num - The row number
Returns: object
False if setting failed. All other values are considered successes.
Overrides: ui.qt.table_helper.RowBasedTableModel._setData
(inherited documentation)

getSelectedFeatures(self, 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: dict
dictionary of checked feature names

getSelectedExcludedVolumes(self)

 

Returns list of hypothesis entry ids which have excluded volumes checked.

Returns: list
list of hypothesis entry ids, which have have excluded volumes checked

toggleSelection(self, 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

getLastCustomFeatureNum(self)

 

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(self, 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.
  • marer_features (dict)

_getFeatureNames(self)

 

Returns dictionary of all feature names in the model, which is keyed on hypothesis entry ids.

Returns: dict
dictionary of feature names