Package schrodinger :: Package application :: Package msv :: Package gui :: Module viewmodel :: Class SequenceAlignmentModel
[hide private]
[frames] | no frames]

Class SequenceAlignmentModel

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

A QTable model where each row corresponds to a sequence and each column corresponds to a residue position

Instance Methods [hide private]
 
residuesSelected(...)
 
residueFormatChanged(...)
 
__init__(self, parent=None, display_mode=<Format.one_letter: 1>, include_gaps=False)
x.__init__(...) initializes x; see help(type(x)) for signature
 
_refreshAllData(self)
We emit dataChanged so that the view will update the contents of the residue cells
ResidueFormat
getResidueDisplayMode(self)
Returns: The residue display mode in current use
 
setResidueDisplayMode(self, mode)
 
setIDDispMode(self, id_disp_mode)
Should the identities be shown as residues or dots?
IdentityDisplayMode
getIDDispMode(self)
Are the identities shown as residues or dots?
 
setAlignment(self, alignment)
Set the alignment model to display data from
schrodinger.application.msv.domain.alignment.BaseAlignment
getAlignment(self)
Return the underlying alignment object
int
sequenceCount(self)
Returns: The number of sequences in the alignment
 
notifyResidueSelection(self, selection)
Takes a list of residues and emits a list of indices corresponding to them.
 
notifyResVisibilityChanged(self, seq_indices)
Notify listeners that visibility has changed.
 
_disconnectOldModel(self)
Disconnect all signal/slot connections with the old alignment model
 
columnCount(self, parent=None)
 
headerData(self, section, orientation, role=0)
Header data for the table.
tuple of (float, float)
_calculateValueRange(self, values)
Calculate the difference between the maximum and minimum values in a list
 
_resRole(self, col, res_data)
Return the residue object at the location or an empty string
 
_residuesAtPosition(self, col, res_data)
Returns an array of indices corresponding to the residues at an index in the underlying alignment
 
_alignmentMetrics(self, col, res_data, role)
Returns alignment metric value depending on the role given.
 
_secondaryStructure(self, col, res_data)
Returns a 2-tuple of a residue's secondary structure assignment and whether that residue is at the start, middle or end of a secondary structure block.
 
_querySequence(self, col, res_data)
Returns True if the given sequence is set as the query sequence in the alignment, False otherwise.
 
_displayData(self, col, res_data)
Return the residue object at the location or an empty string
 
_seqAlignmentData(self, col, res_data)
Return the underlying alignment object
 
_textAlignmentData(self, col, res_data)
Make sure that data is center aligned
 
_seqAnnotationData(self, col, res_data, role)
Return the value for the specified sequence annotation role
 
_globalAnnotationData(self, col, res_data, role)
Return the value for the specified global annotation role
 
_seqAnnotationRangeData(self, col, res_data, role)
Return the range for the specified sequence annotation role
 
_globalAnnotationRangeData(self, col, res_data, role)
Return the range for the specified global annotation role
 
_consensusData(self, col, res_data, role)
Returns whether the residue in the specified column matches the residue at the corresponding column in the consensus sequence.
 
_sequenceInfo(self, col, seq)
Sequence Workspace inclusion data.
 
_entryID(self, col, seq)
Sequence entry ID information
 
_sortByData(self, col, seq, role)
Data used for sorting the table
object
_setData(self, col, row_data, value, role, row_num)
See table_helper for argument documentation.
tuple
annotationTypes(self)
Get the current annotation types
list
strucTitles(self)
Get all structure titles
 
_alignmentLengthAboutToChange(self, old_length, new_length)
Respond to the alignmentLengthAboutToChange signal by getting ready to insert or remove columns
 
_alignmentLengthChanged(self, old_length, new_length)
Respond to the alignmentLengthChanged signal by finishing inserting or removing columns
 
_sequenceResiduesChanged(self, seq, start_col, end_col)
Response to changes within a sequence by updating the appropriate cells
 
_sequenceNameChanged(self, seq)
Respond to a sequence name changing by updating the appropriate header row
 
_querySequenceUpdated(self)
Response to the query sequence being unset in an alignment.

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

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

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]

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

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Instance Variables [hide private]
 
fixedColumnDataChanged(...)
Signal emitted when the data in a fixed column is changed.
Properties [hide private]
  aln
An alias for the table model's _rows attribute

Inherited from ui.qt.table_helper.RowBasedTableModel: rows

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent=None, display_mode=<Format.one_letter: 1>, include_gaps=False)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • parent (QtCore.Object) - Parent of the row based table model.
  • display_mode (ResidueFormat enum) - Display mode of the residues
  • include_gaps (bool) - Whether or not to include gaps in calculating alignment metrics, such as identity, similarity, etc.
Overrides: object.__init__

getResidueDisplayMode(self)

 
Returns: ResidueFormat
The residue display mode in current use

setResidueDisplayMode(self, mode)

 
Parameters:
  • mode (ResidueFormat) - The display mode for residue text

setIDDispMode(self, id_disp_mode)

 

Should the identities be shown as residues or dots?

Parameters:

getIDDispMode(self)

 

Are the identities shown as residues or dots?

Returns: IdentityDisplayMode
The current setting

setAlignment(self, alignment)

 

Set the alignment model to display data from

Parameters:

getAlignment(self)

 

Return the underlying alignment object

Returns: schrodinger.application.msv.domain.alignment.BaseAlignment
The alignment

sequenceCount(self)

 
Returns: int
The number of sequences in the alignment

notifyResidueSelection(self, selection)

 

Takes a list of residues and emits a list of indices corresponding to them.

We need this signal in order to convey selection changes from the structure model to the view.

Each proxy in the proxy stack should listen to the residuesSelected signal of its own model and then emit in turn its own residuesSelected signal with the indices appropriately modified

Parameters:
  • selection (list of schrodinger.application.domain.residue. Residue) - A list of residues to select
  • residuesSelected (list of QtCore.QModelIndex)

notifyResVisibilityChanged(self, seq_indices)

 

Notify listeners that visibility has changed.

Parameters:
  • seq_indices (list of int) - Indices of the sequences whose visibilities have changed.

columnCount(self, parent=None)

 
Overrides: PyQt4.QtCore.QAbstractItemModel.columnCount

headerData(self, section, orientation, role=0)

 

Header data for the table. Untitled sequences will be given a title of "Sequence #".

See Qt documentation for argument and return value documentation

Overrides: PyQt4.QtCore.QAbstractItemModel.headerData

_calculateValueRange(self, values)

 

Calculate the difference between the maximum and minimum values in a list

Parameters:
  • values (list) - The value to calculate the range of
Returns: tuple of (float, float)
A 2-tuple of the min value, the max value.

_resRole(self, col, res_data)

 

Return the residue object at the location or an empty string

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(CustomRole.Residue)

_residuesAtPosition(self, col, res_data)

 

Returns an array of indices corresponding to the residues at an index in the underlying alignment

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(CustomRole.ResidueIndicesAtPosition)

_alignmentMetrics(self, col, res_data, role)

 

Returns alignment metric value depending on the role given.

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(CustomRole.AlignmentIdentity, CustomRole.AlignmentSimilarity, CustomRole.AlignmentHomology, CustomRole.AlignmentScore)

_secondaryStructure(self, col, res_data)

 

Returns a 2-tuple of a residue's secondary structure assignment and whether that residue is at the start, middle or end of a secondary structure block.

See table_helper for argument documantation.

Decorators:
  • @table_helper.data_method(CustomRole.SecondaryStructure)

_querySequence(self, col, res_data)

 

Returns True if the given sequence is set as the query sequence in the alignment, False otherwise.

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(CustomRole.QuerySequence)

_displayData(self, col, res_data)

 

Return the residue object at the location or an empty string

See table_helper for argument documentation.

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

_seqAlignmentData(self, col, res_data)

 

Return the underlying alignment object

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(CustomRole.Alignment)

_textAlignmentData(self, col, res_data)

 

Make sure that data is center aligned

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(Qt.TextAlignmentRole)
Overrides: ui.qt.table_helper.RowBasedTableModel._textAlignmentData

_seqAnnotationData(self, col, res_data, role)

 

Return the value for the specified sequence annotation role

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(* range(RoleBase.SeqAnnotation, RoleBase.SeqAnnotation+ MAX_ANNOTATIONS))

_globalAnnotationData(self, col, res_data, role)

 

Return the value for the specified global annotation role

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(* range(RoleBase.GlobalAnnotation, RoleBase.GlobalAnnotation+ MAX_ANNOTATIONS))

_seqAnnotationRangeData(self, col, res_data, role)

 

Return the range for the specified sequence annotation role

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(* range(RoleBase.SeqAnnotationRange, RoleBase.SeqAnnotationRange+ MAX_ANNOTATIONS))

_globalAnnotationRangeData(self, col, res_data, role)

 

Return the range for the specified global annotation role

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(* range(RoleBase.GlobalAnnotationRange, RoleBase.GlobalAnnotationRange+ MAX_ANNOTATIONS))

_consensusData(self, col, res_data, role)

 

Returns whether the residue in the specified column matches the residue at the corresponding column in the consensus sequence.

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(CustomRole.Consensus)

_sequenceInfo(self, col, seq)

 

Sequence Workspace inclusion data.

Decorators:
  • @table_helper.data_method(CustomRole.Included)

_entryID(self, col, seq)

 

Sequence entry ID information

Decorators:
  • @table_helper.data_method(CustomRole.EntryID)

_sortByData(self, col, seq, role)

 

Data used for sorting the table

See table_helper for argument documentation.

Decorators:
  • @table_helper.data_method(* list(SortBy))

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

 

See table_helper for argument documentation.

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

annotationTypes(self)

 

Get the current annotation types

Returns: tuple
A tuple of:
  • The global annotation enum
  • The sequence annotation enum

strucTitles(self)

 

Get all structure titles

Returns: list
A list containing all structure titles

_alignmentLengthAboutToChange(self, old_length, new_length)

 

Respond to the alignmentLengthAboutToChange signal by getting ready to insert or remove columns

Parameters:
  • old_length (int) - The current length of the alignment
  • new_length (int) - The new length of the alignment

_alignmentLengthChanged(self, old_length, new_length)

 

Respond to the alignmentLengthChanged signal by finishing inserting or removing columns

Parameters:
  • old_length (int) - The previous length of the alignment
  • new_length (int) - The current length of the alignment

_sequenceResiduesChanged(self, seq, start_col, end_col)

 

Response to changes within a sequence by updating the appropriate cells

Parameters:

_sequenceNameChanged(self, seq)

 

Respond to a sequence name changing by updating the appropriate header row

Parameters:

Instance Variable Details [hide private]

fixedColumnDataChanged(...)

 
Signal emitted when the data in a fixed column is changed. Passes a tuple of the role and row index that are changing.

Property Details [hide private]

aln

An alias for the table model's _rows attribute

Get Method:
unreachable.aln(self) - An alias for the table model's _rows attribute