Package schrodinger :: Package application :: Package bioluminate :: Module protein_structure_quality :: Class DataModelWithChart
[hide private]
[frames] | no frames]

Class DataModelWithChart

PyQt4.QtCore.QAbstractTableModel --+    
                                   |    
     protein_report_widget.DataModel --+
                                       |
                                      DataModelWithChart

A subclass of DataModel that calls a sort callback when sorting

Instance Methods [hide private]
 
__init__(self, master)
Create a DataModel instance
 
restrictByChains(self, chains)
Restricts the data in the model to the specified chains
 
setData(self, *args)
Sets the internal data list to the specified list.
str
headerData(self, section, orientation, role)
Returns the string that should be displayed in the specified header cell.
 
sort(self, *args)
Sort the table (see parent class for argument definition).

Inherited from protein_report_widget.DataModel: columnCount, data, rowCount

Instance Variables [hide private]
  data_column
The column that the data to plot is in
Method Details [hide private]

__init__(self, master)
(Constructor)

 

Create a DataModel instance

Overrides: protein_report_widget.DataModel.__init__
(inherited documentation)

restrictByChains(self, chains)

 

Restricts the data in the model to the specified chains

Parameters:
  • chains (list of str) - list of chain names (or 'all') to display

setData(self, *args)

 

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

Overrides the parent class method to store the a copy of the data in self.all_data, since the _data property can be mutated by the restrictByChains method.

Parameters:
  • data_list (list) - the list of data for the model. Uses the actual list, not a copy
  • headers (list of str) - The column headers
Overrides: protein_report_widget.DataModel.setData

headerData(self, section, orientation, role)

 

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

Parameters:
  • section (int) - the row or column index requested
  • orientation (Qt.Orientation (Qt.Horizontal or Qt.Vertical)) - Whether this is for the horizontal or vertical header
  • role (Qt.ItemDataRole) - The data role to return - Qt.DisplayRole to return the text of the header.
Returns: str
the str representation for the requested header item
Overrides: protein_report_widget.DataModel.headerData

sort(self, *args)

 

Sort the table (see parent class for argument definition). In addition to sorting, the attribute self.sortCallback() will be called if it exists (with no arguments). This attribute must be set manually by the user.

Parameters:
  • Ncol - The column index to sort
  • order - The order in which to sort the column
Overrides: protein_report_widget.DataModel.sort