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

Class SequenceAlignmentModel

                                  object --+        
                                           |        
 ui.qt.table_helper.DataMethodDecoratorMixin --+    
                                               |    
ui.qt.table_speed_up.MultipleRolesRoleModelMixin --+
                                                   |
                                  object --+       |
                                           |       |
 ui.qt.table_helper.DataMethodDecoratorMixin --+   |
                                               |   |
                  object --+                   |   |
                           |                   |   |
           sip.simplewrapper --+               |   |
                               |               |   |
                     sip.wrapper --+           |   |
                                   |           |   |
                PyQt5.QtCore.QObject --+       |   |
                                       |       |   |
         PyQt5.QtCore.QAbstractItemModel --+   |   |
                                           |   |   |
            PyQt5.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

Nested Classes [hide private]

Inherited from PyQt5.QtCore.QAbstractItemModel: LayoutChangeHint

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)
 
rowCount(self, parent=None)
 
headerData(self, section, orientation, role=0)
Provide column headers, and optionally column tooltips and row numbers.
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
 
_seqData(self, col, res_data)
Return the sequence for the specified row.
 
_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.
 
_columnHasAllSameResidues(self, col, res_data)
Returns True if all residues in the specified column of the alignment are the same, 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 Qt.DisplayData value for the specified global annotation role.
 
_consensusSymbolsData(self, col, res_data)
Return the raw consensus symbol value for the given column.
 
_consensusSeqData(self, col, res_data)
Return the raw consensus sequence value for the given column.
 
_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.
bool
_sequenceIncluded(self, col, seq)
Returns: Whether the sequence is included in the workspace
 
_entryID(self, col, seq)
Sequence entry ID information
 
_sortByData(self, col, seq, role)
Data used for sorting the table
 
_hasStructureData(self, col, seq)
Whether the sequence has a structure associated with it.
 
flags(self, index)
See Qt documentation for method documentation
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_speed_up.MultipleRolesRoleModelMixin: data

Inherited from ui.qt.table_speed_up.MultipleRolesRoleModelMixin (private): _fetchMultipleRoles, _multipleRolesData

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

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

Inherited from ui.qt.table_helper.DataMethodDecoratorMixin (private): _callDataMethod, _collectDataMethods

Inherited from PyQt5.QtCore.QAbstractTableModel: dropMimeData, hasChildren, index, parent, sibling

Inherited from PyQt5.QtCore.QAbstractItemModel: beginInsertColumns, beginInsertRows, beginMoveColumns, beginMoveRows, beginRemoveColumns, beginRemoveRows, beginResetModel, buddy, canDropMimeData, 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, moveColumn, moveColumns, moveRow, moveRows, persistentIndexList, removeColumn, removeColumns, removeRow, resetInternalData, revert, roleNames, rowsAboutToBeInserted, rowsAboutToBeMoved, rowsAboutToBeRemoved, rowsInserted, rowsMoved, rowsRemoved, setHeaderData, setItemData, sort, span, submit, supportedDragActions, supportedDropActions

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

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 PyQt5.QtCore.QAbstractItemModel: HorizontalSortHint, NoLayoutChangeHint, VerticalSortHint

Inherited from PyQt5.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: PyQt5.QtCore.QAbstractItemModel.columnCount

rowCount(self, parent=None)

 
Overrides: PyQt5.QtCore.QAbstractItemModel.rowCount

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

 

Provide column headers, and optionally column tooltips and row numbers.

See Qt documentation for an explanation of arguments and return value

Overrides: PyQt5.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)

_seqData(self, col, res_data)

 

Return the sequence for the specified row.

See table_helper for argument documentation.

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

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

_columnHasAllSameResidues(self, col, res_data)

 

Returns True if all residues in the specified column of the alignment are the same, False otherwise.

See table_helper for argument documentation.

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

_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 Qt.DisplayData 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))

_consensusSymbolsData(self, col, res_data)

 

Return the raw consensus symbol value for the given column.

See table_helper for argument documentation.

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

_consensusSeqData(self, col, res_data)

 

Return the raw consensus sequence value for the given column.

See table_helper for argument documentation.

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

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

_sequenceIncluded(self, col, seq)

 
Returns: bool
Whether the sequence is included in the workspace
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))

_hasStructureData(self, col, seq)

 

Whether the sequence has a structure associated with it.

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

flags(self, index)

 

See Qt documentation for method documentation

Overrides: PyQt5.QtCore.QAbstractItemModel.flags

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

_querySequenceUpdated(self)

 

Response to the query sequence being unset in an alignment.

Decorators:
  • @table_helper.model_reset_method

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