schrodinger.application.msv.gui.view module

class schrodinger.application.msv.gui.view.AbstractAlignmentView(parent=None)

Bases: schrodinger.application.msv.gui.view.GroupExpansionViewMixin, schrodinger.ui.qt.table_speed_up.SpeedUpDelegateViewMixin, schrodinger.application.msv.gui.view.ColorFirstRowMixin, PyQt5.QtWidgets.QTreeView

Class for viewing sequence alignments in a table

Variables:
DATA_CACHE_SIZE = 75000
DELEGATE_CLASS

alias of DispatchDelegate

contextMenuEvent(event)
deleteSelResiduesRequested
mouseReleaseEvent(event)
residuesSelected
resizeEvent(event)

Update the row wrapping whenever the table is resized

See Qt documentation for argument documentation

saveImage(file_name, file_format='PNG')

Saves current view to an image file

Parameters:
  • file_name (string) – image file
  • file_format (string) – format of the image file (PNG or PDF)
setContextMenu(ContextMenuClass=<class 'schrodinger.application.msv.gui.view.DefaultContextMenu'>)
setModel(model)

Set the model and ensure that changes to the model columns trigger updates in the delegates

See Qt documentation for argument documentation

class schrodinger.application.msv.gui.view.AbstractMsvContextMenu

Bases: PyQt5.QtWidgets.QMenu

deleteSelection
editSelection
popup(pos, selected_count=None, seq_count=None)
class schrodinger.application.msv.gui.view.AlignmentInfoContextMenu(seqs, parent=None, add_set_as_reference=True, add_move_seq=True, add_remove_seq=True)

Bases: PyQt5.QtWidgets.QMenu

Class for context menus in the info section of the view.

Variables:
  • setAsReferenceSeq (QtCore.pyqtSignal) – Signal emitted to indicate that the currently selected sequence should be set as the reference sequence.
  • findHomologsClicked (QtCore.pyqtSignal) – Signal emitted to indicate that the selected sequence should be used for a BLAST query
  • mvSeqsClicked – Signal emitted to indicate that the selected sequences should be moved. Emits a list of the selected sequence.Sequence objects and the viewconstants.Direction. We use object as the param type because of a known issue with enum_speedup.
  • rmSeqsClicked (QtCore.pyqtSignal) – Signal emitted to indicate that the selected sequence(s) should be deleted
  • selectRowResidues (QtCore.pyqtSignal) – Signal emitted to indicate that all residues of all selected sequences should be selected in the alignment. Emits a list of the selected sequence.Sequence objects.
findHomologsClicked
mvSeqsClicked
onMoveSequenceRequested(direction)
rmSeqsClicked
selectRowResidues
setAsReferenceSeq
class schrodinger.application.msv.gui.view.AlignmentInfoView(alignment_view, parent=None)

Bases: schrodinger.application.msv.gui.view.BaseFixedColumnsView

View for the fixed columns to the left of the alignment that includes the structure title.

Variables:
  • sequencesSelected (QtCore.pyqtSignal) – Signal emitted when sequence selection changes. Emits a list of schrodinger.protein.sequence.Sequence objects that are currently selected.
  • setAsReferenceSeq (QtCore.pyqtSignal) – Signal emitted to indicate that the selected sequence should be set as the reference sequence
  • findHomologsClicked (QtCore.pyqtSignal) – Signal emitted to indicate that the selected sequence should be used for a BLAST query
  • mvSeqsClicked – Signal emitted to indicate that the selected sequences should be moved. Emits a list of the selected sequence.Sequence objects and the viewconstants.Direction. We use object as the param type because of a known issue with enum_speedup.
  • rmSeqsClicked (QtCore.pyqtSignal) – Signal emitted to indicate that the selected sequence(s) should be deleted
  • selectRowResidues (QtCore.pyqtSignal) – Signal emitted to indicate that all residues of all selected sequences should be selected in the alignment. Emits a list of the selected sequence.Sequence objects.
drawBranches(painter, rect, index)

Override the drawBranches function to fill the first row of the branch columns with the color of the ruler.

See Qt documentation for argument documentation.

findHomologsClicked
getSelectedSequences()

Return a list of the sequence objects currently selected.

Returns:List of selected sequences
Return type:list of schrodinger.protein.sequence.Sequence
mousePressEvent(event)

If the mouse press is within the drag handle of a sequence row, enable drag and drop before handling the click. Otherwise, disable drag and drop.

See Qt documentation for argument documentation.

mvSeqsClicked
rmSeqsClicked
selectRowResidues
selectionCommand(index, event)

Filter right button mouse events to prevent selection changes when showing context menu.

See Qt documentation for argument documentation.

sequencesSelected
setAsReferenceSeq
setModel(model)
setSelectedSequences(seqs)

Set the sequence selection to the specified sequences.

Parameters:seqs (list of schrodinger.protein.sequence.Sequence) – List of sequences to select
updateOrder(seq_indices)

Respond to a reordering of sequences. Reselects rows based on where selected sequences have moved. This currently won’t work with with wrapped rows (TODO: in MSV-1591).

Parameters:seq_idx – A list with the new indices for sequences
Type:list of int
class schrodinger.application.msv.gui.view.AlignmentMetricsView(*args, **kwargs)

Bases: schrodinger.application.msv.gui.view.BaseFixedColumnsView

View for the fixed columns to the right of the alignment that includes sequence identity and homology.

class schrodinger.application.msv.gui.view.BaseFixedColumnsView(alignment_view, parent=None)

Bases: schrodinger.application.msv.gui.view.GroupExpansionViewMixin, schrodinger.application.msv.gui.view.ColorFirstRowMixin, schrodinger.ui.qt.table_speed_up.SpeedUpDelegateViewMixin, PyQt5.QtWidgets.QTreeView

Class for fixed column views to be shown alongside an alignment view.

DATA_CACHE_SIZE = 5000
DELEGATE_CLASS

alias of AlignmentInfoDelegate

minimumSizeHint()
setModel(model)

Connects signals from model with the view.

See Qt documentation for argument documentation

sizeHint()
class schrodinger.application.msv.gui.view.ColorFirstRowMixin

Bases: object

Mixin to fill the first row with the color of the ruler

FIRST_ROW_COLOR = <PyQt5.QtGui.QColor object>
drawBranches(painter, rect, index)

Override the drawBranches function to fill the first row of the branch columns with the color of the ruler.

See Qt documentation for argument documentation.

drawRow(painter, option, index)

Override the drawRow function to fill the first row with the color of the ruler.

See Qt documentation for argument documentation.

class schrodinger.application.msv.gui.view.DefaultContextMenu(parent=None)

Bases: schrodinger.application.msv.gui.view.AbstractMsvContextMenu

class schrodinger.application.msv.gui.view.EmbeddedMSVContextMenu(parent=None)

Bases: schrodinger.application.msv.gui.view.AbstractMsvContextMenu

class schrodinger.application.msv.gui.view.GroupExpansionViewMixin(parent=None)

Bases: object

A mixin for views that synchronize group expansion via the model.

getExpandedIndices()

Get a list of indices that are expanded.

Return type:list of int
Returns:List of row indices that are expanded
getExpandedSequences()

Get a list of sequences that are expanded.

Return type:list of schrodinger.protein.sequence.Sequence
Returns:List of sequences that are expanded.
setExpandedFromIndices(expanded_list)

Expand rows whose indices are in expanded_list.

Parameters:expanded_list (list of int) – List of row indices to expand
setModel(model)
class schrodinger.application.msv.gui.view.NoScrollAlignmentView(parent=None)

Bases: schrodinger.application.msv.gui.view.AbstractAlignmentView

Alignment view without scroll bars, used in saving the entire alignment as an image.

saveImage(file_name, file_format)
class schrodinger.application.msv.gui.view.ProteinAlignmentView(parent=None)

Bases: schrodinger.application.msv.gui.view.AbstractAlignmentView

class schrodinger.application.msv.gui.view.ResidueSelectionModel

Bases: PyQt5.QtCore.QItemSelectionModel

A “hollowed out” selection model for residues that simply notifies the viewmodel about selection instead of keeping track of selection itself. We choose to store selection model in the domain rather than on the view because

  • Qt selection models are slow,
  • In the MSV, we select things on a per-residue basis, and
  • The structure model needs to know selection information to synchronize selection state with the maestro workspace.

If objects want to know residue selection information, they can directly ask selection model on the alignment or use the CustomRole.Selected role on the viewmodel. They should not ask this object for selection information. See undoable_alignment.AlignmentSelectionModel for the real selection model.

(Note that while residue selection is not managed by the domain, sequence selection is managed on the Qt selection model; see SequenceSelectionModel.)

select(selection, flags)
class schrodinger.application.msv.gui.view.SequenceSelectionModel(*args, **kwargs)

Bases: PyQt5.QtCore.QItemSelectionModel

Selection model for selecting entire sequences in an alignment. Intended to be used with AlignmentInfoView.

Variables:sequencesSelected (QtCore.pyqtSignal) – A signal emitted when sequence selection changes. Emits a list of schrodinger.protein.sequence.Sequence that are currently selected.
sequenceSelectionChanged()

Inspect selection changes and emit a list of currently selected sequences

sequencesSelected