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 --+    
                                      |    
  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
ResidueFormat
getResidueDisplayMode(self)
Returns: The residue display mode in current use
 
setResidueDisplayMode(self, mode)
 
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.
 
_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.
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.
 
_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.
 
_sortByData(self, col, seq, role)
Data used for sorting the table
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

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

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

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, setRoleNames, setSupportedDragActions, 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

Properties [hide private]
  aln
An alias for the table model's _rows attribute

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

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:

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: float
The difference between the max and min values

_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)

_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)

_sortByData(self, col, seq, role)

 

Data used for sorting the table

See table_helper for argument documentation.

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

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:

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