schrodinger.application.msv.gui.gui_alignment module

exception schrodinger.application.msv.gui.gui_alignment.StandingSelectionError[source]

Bases: RuntimeError

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class schrodinger.application.msv.gui.gui_alignment.AbstractAlignmentSelectionModel(aln)[source]

Bases: PyQt5.QtCore.QObject

A class that manages selection of elements in an undoable alignment. An element can be either a residue or a sequence. Because of limitations with Qt’s selection models, we store selection status in our own domain objects instead.

This class has an undo stack because selection is undoable in the MSV.

Variables
  • _selection (set) – The current selection state

  • _old_selection (set) – The selection state from last time selectionChanged was emitted

  • selectionChanged (QtCore.pyqtSignal emitting set() and set()) – A signal emitted to notify listeners that selection has changed, with the set of elements that have been selected and the set of elements that have been deselected. Note that this is called on a single shot timer so that if selection is modified multiple times successively (eg by a “clear then select”), only one signal is emitted.

selectionChanged
__init__(aln)[source]
Parameters

aln (ProteinAlignment) – The alignment whose selection state we’re tracking

onSequencesAboutToBeRemoved(start, end)[source]

When sequences are about to be removed, deselect all the elements contained by those sequences.

Parameters
  • start (int) – Start index of sequences about to be removed.

  • end (int) – End index of sequences about to be removed.

getSelectionIndices()[source]

Return a list of selected element indices. Child classes should reimplement.

Returns

List of selection element indices

Return type

list

setUndoStack(undo_stack)[source]
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to push commands onto

setSelectionState(items, selected)[source]

Set the selection state of the provided items, ignoring `None`s

Parameters

selected (bool) – Whether to select or deselect the items

clearSelection()[source]

Unselect all elements.

forceSelectionUpdate()[source]

Force the selectionChanged signal to emit immediately rather than waiting for the timer to expire.

isSelected(ele)[source]
Parameters

ele – The alignment element to determine the selection state of

Returns

whether ele is selected

Return type

bool

getSelection()[source]
Returns

A set of currently selected elements

Return type

set

hasSelection()[source]

Whether any items are currently selected.

Return type

bool

suspendSelection()[source]

Inside the context, the selection model is deselected.

Parameters

sel_model (AbstractAlignmentSelectionModel) – The selection model to temporarily deselect

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

inherits(self, str) → bool
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.application.msv.gui.gui_alignment.ResidueSelectionModel(*args, **kwargs)[source]

Bases: schrodinger.application.msv.gui.gui_alignment.AbstractAlignmentSelectionModel

SELECTION_SANITY_CHECK = True
__init__(*args, **kwargs)[source]
Parameters

aln (ProteinAlignment) – The alignment whose selection state we’re tracking

selectAll(*, _undoable=True)[source]

Convenience method to select all residues. Skips sanity check for speed.

Parameters

_undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

setSelectionState(residues, selected, *, _undoable=True)[source]

See parent class for additional method documentation.

Parameters

_undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation or a non-undoable action that takes responsibility for restoring selection.

setCurrentSelectionState(residues, selected, *, _undoable=True)[source]

Set residues as selected or deselected in the “current” selection. Note that “current” here means “the portion of the selection that’s in the process of being updated,” i.e., the selection that’s from the mouse click (or click and drag) that we’re currently in the middle of. This is equivalent to passing the QItemSelectionModel::Current | QItemSelectionModel::Clear flags to QItemSelectionModel::select.

Note

setSelectionState must not be called until the current selection has finished. (See finishCurrentSelection.)

Parameters
  • residues (Iter(residue.Residue)) – The residues to set the current selection to. Any previous current selection will be completely replaced.

  • selected (bool) – Whether the specified residues should be selected or deselected.

  • _undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

finishCurrentSelection(*, _undoable=True)[source]

Finish the “current” selection and permanently merge it into the main selection. If there’s no “current” selection, then this method is a no-op, but is still safe to call.

See setCurrentSelectionState for additional information about the “current” selection.

Parameters

_undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

clearSelection(*, _undoable=True)[source]

Deselect all elements.

Parameters

_undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

onSequencesAboutToBeRemoved(start, end)[source]

When sequences are about to be removed, deselect all the residues in those sequences.

Parameters
  • start (int) – Start index of sequences about to be removed.

  • end (int) – End index of sequences about to be removed.

onResiduesAboutToBeRemoved(residues)[source]

When residues are about to be removed, deselect those residues.

Parameters

residues (list(residue.AbstractSequenceElement)) – A list of residues that were removed.

getSelectionIndices(sort=True)[source]

Return a list of selected residue indices within the alignment.

Returns

A list of (sequence index, residue index) tuples for all selected residues.

Return type

list(tuple(int, int))

isSingleBlockSingleSeqSelected()[source]

Determine whether exactly one single block of residues/gaps (i.e. contiguous residues/gaps) in a single sequence is selected. :rtype: bool

isSingleBlockSelected()[source]

Determine whether exactly one single block of residues/gaps (i.e. contiguous residues/gaps) is selected. :rtype: bool

numBlocksSelected()[source]

Return the number of blocks of residues/gaps (i.e. contiguous residues/gaps) that are selected

Returns

Number of selected blocks

Return type

int

anyStructuredResiduesSelected()[source]

Determine if any structured residues (i.e. residues in a structure- linked sequence that aren’t SEQRES only) are selected. :rtype: bool

suspendSelection()[source]

Suspend the selection in the context and restore it upon exit. Note that this is undoable, any selected elements that were removed from their sequence in the context when restored will be reselected.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

forceSelectionUpdate()

Force the selectionChanged signal to emit immediately rather than waiting for the timer to expire.

getSelection()
Returns

A set of currently selected elements

Return type

set

hasSelection()

Whether any items are currently selected.

Return type

bool

inherits(self, str) → bool
installEventFilter(self, QObject)
isSelected(ele)
Parameters

ele – The alignment element to determine the selection state of

Returns

whether ele is selected

Return type

bool

isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
selectionChanged
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setUndoStack(undo_stack)
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to push commands onto

signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.application.msv.gui.gui_alignment.SequenceSelectionModel(aln)[source]

Bases: schrodinger.application.msv.gui.gui_alignment.AbstractAlignmentSelectionModel

setSelectionState(sequences, selected)[source]

Set the selection state of the specified sequences. Hidden sequences will not be selected.

onSequencesAboutToBeRemoved(start, end)[source]

Respond to a sequencesAboutToBeRemoved signal by deselecting any sequences that are about to be removed.

Parameters
  • start (int) – Start index of sequences about to be removed.

  • end (int) – End index of sequences about to be removed.

getSelectionIndices()[source]

Return a list of the selected sequence indices within the alignment

Returns

Selected sequence indices

Return type

list(int)

suspendSelection()[source]

Suspend the selection in the context and restore it upon exit.

__init__(aln)
Parameters

aln (ProteinAlignment) – The alignment whose selection state we’re tracking

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
clearSelection()

Unselect all elements.

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

forceSelectionUpdate()

Force the selectionChanged signal to emit immediately rather than waiting for the timer to expire.

getSelection()
Returns

A set of currently selected elements

Return type

set

hasSelection()

Whether any items are currently selected.

Return type

bool

inherits(self, str) → bool
installEventFilter(self, QObject)
isSelected(ele)
Parameters

ele – The alignment element to determine the selection state of

Returns

whether ele is selected

Return type

bool

isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
selectionChanged
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setUndoStack(undo_stack)
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to push commands onto

signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.application.msv.gui.gui_alignment.AnnotationSelectionModel(aln)[source]

Bases: schrodinger.application.msv.gui.gui_alignment.AbstractAlignmentSelectionModel

Class that tracks the selection state of sequence annotation as AnnotationRowInfo namedtuples.

onSequencesAboutToBeRemoved(start, end)[source]

When sequences are about to be removed, deselect all the elements contained by those sequences.

Parameters
  • start (int) – Start index of sequences about to be removed.

  • end (int) – End index of sequences about to be removed.

__init__(aln)
Parameters

aln (ProteinAlignment) – The alignment whose selection state we’re tracking

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
clearSelection()

Unselect all elements.

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

forceSelectionUpdate()

Force the selectionChanged signal to emit immediately rather than waiting for the timer to expire.

getSelection()
Returns

A set of currently selected elements

Return type

set

getSelectionIndices()

Return a list of selected element indices. Child classes should reimplement.

Returns

List of selection element indices

Return type

list

hasSelection()

Whether any items are currently selected.

Return type

bool

inherits(self, str) → bool
installEventFilter(self, QObject)
isSelected(ele)
Parameters

ele – The alignment element to determine the selection state of

Returns

whether ele is selected

Return type

bool

isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
selectionChanged
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setSelectionState(items, selected)

Set the selection state of the provided items, ignoring `None`s

Parameters

selected (bool) – Whether to select or deselect the items

setUndoStack(undo_stack)
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to push commands onto

signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
suspendSelection()

Inside the context, the selection model is deselected.

Parameters

sel_model (AbstractAlignmentSelectionModel) – The selection model to temporarily deselect

thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.application.msv.gui.gui_alignment.AlignmentSignals[source]

Bases: schrodinger.protein.alignment.AlignmentSignals

Signals that can be emitted by the GUI alignments.

Variables
  • seqExpansionChanged

    Signal emitted when the expansion state (i.e. are the annotations expanded or collapsed) for a sequence changes. Emitted with:

    • The sequence that changed

    • Whether the sequence is now expanded

  • resHighlightStatusChanged – Signal emitted when residue highlighting changes. Emitted with whether any residues are highlighted.

  • resOutlineStatusChanged – Signal emitted when residue outline changes. Emitted with whether any residues are outlined.

  • homologyLigandConstraintsChanged – Signal emitted when homology modeling ligand constraints change.

  • homologyProximityConstraintsChanged – Signal emitted when homology modeling residue constraints change.

  • homologyCompositeResiduesChanged – Signal emitted when composite residues change.

  • homologyStatusChanged – Signal emitted when homology status changes. Emitted with the sequence that changed. Signal not emitted for sequences that are removed from the alignment.

  • resSelectionChanged

    Signal emitted when the residue selection in the alignment changes. Emitted with:

    • set of newly selected residues

    • set of newly deselected residues

  • seqSelectionChanged

    Signal emitted when the sequence selection in the alignment changes. Emitted with:

    • set of newly selected sequences

    • set of newly deselected sequences

  • syncWsResSelection – Signal emitted when a new sequence has been added to the alignment. In response to this signal, the MSV Widget is responsible for selecting all residues that correspond to selected workspace residues. Emitted with the iterable of sequences to select residues in.

seqExpansionChanged
resHighlightStatusChanged
resOutlineStatusChanged
homologyCompositeResiduesChanged
homologyLigandConstraintsChanged
homologyProximityConstraintsChanged
homologyStatusChanged
pairwiseConstraintsChanged
hiddenSeqsChanged
resSelectionChanged
seqSelectionChanged
syncWsResSelection
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

alignmentAboutToBeCleared
alignmentCleared
alignmentNumColumnsAboutToChange
alignmentNumColumnsChanged
allSignals()[source]

Iterate over all signals in this object in alphabetical order. :rtype: Iter(QtCore.pyqtBoundSignal)

allSignalsAndNames()[source]

Iterate over all signals in this object and their names in alphabetical order. :rtype: Iter(tuple(QtCore.pyqtBoundSignal, str))

property aln

Return the alignment that this signals object is reporting for. :rtype: BaseAlignment

alnSetChanged
anchoredResiduesChanged
annotationTitleChanged
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
descriptorsCleared
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
domainsChanged
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
emitAnnTitleChanged()[source]
emitSeqNameChanged()[source]
emitSeqResChanged()[source]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

inherits(self, str) → bool
installEventFilter(self, QObject)
invalidatedDomains
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
kinaseConservationChanged
kinaseFeaturesChanged
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
pfamChanged
predictionsChanged
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
residuesAboutToBeRemoved
residuesAdded
residuesRemoved
secondaryStructureChanged
sender(self) → QObject
senderSignalIndex(self) → int
sequenceNameChanged
sequenceResiduesChanged
sequenceStructureChanged
sequenceVisibilityChanged
sequencesAboutToBeInserted
sequencesAboutToBeRemoved
sequencesAboutToBeReordered
sequencesInserted
sequencesRemoved
sequencesReordered
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.application.msv.gui.gui_alignment.AlnSetInfo(set_id)[source]

Bases: object

Information needed to undo the removal of an alignment set.

Variables
  • id (set) – The set ID of the set

  • seqs (set(sequence.Sequence)) – The sequences that were removed from the set

__init__(set_id)[source]

Initialize self. See help(type(self)) for accurate signature.

class schrodinger.application.msv.gui.gui_alignment.AnnotationRowInfo(seq: Optional[schrodinger.protein.sequence.ProteinSequence], ann: Union[schrodinger.infra.util.ANNOTATION_TYPES, schrodinger.infra.util.ANNOTATION_TYPES], idx: int = 0)[source]

Bases: tuple

Tuple for information about an annotation row.

Variables
  • seq – The sequence associated with the annotation. Is None for alignment/global annotations.

  • ann – The annotation type

  • idx – For multi-row annotations, the index of the row.

seq: Optional[schrodinger.protein.sequence.ProteinSequence]

Alias for field number 0

ann: Union[schrodinger.infra.util.ANNOTATION_TYPES, schrodinger.infra.util.ANNOTATION_TYPES]

Alias for field number 1

idx: int

Alias for field number 2

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

class schrodinger.application.msv.gui.gui_alignment.SequenceAnnotationRowInfo(seq, ann, idx=0)[source]

Bases: schrodinger.application.msv.gui.gui_alignment.AnnotationRowInfo

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

ann: Union[schrodinger.infra.util.ANNOTATION_TYPES, schrodinger.infra.util.ANNOTATION_TYPES]

Alias for field number 1

count(value, /)

Return number of occurrences of value.

idx: int

Alias for field number 2

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

seq: Optional[schrodinger.protein.sequence.ProteinSequence]

Alias for field number 0

class schrodinger.application.msv.gui.gui_alignment.GlobalAnnotationRowInfo(ann)[source]

Bases: schrodinger.application.msv.gui.gui_alignment.AnnotationRowInfo

Annotation info for global annotations.

seq is always None because the annotation does not apply to a specific sequence.

idx is always None because there are no multi-row global annotations.

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

ann: Union[schrodinger.infra.util.ANNOTATION_TYPES, schrodinger.infra.util.ANNOTATION_TYPES]

Alias for field number 1

count(value, /)

Return number of occurrences of value.

idx: int

Alias for field number 2

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

seq: Optional[schrodinger.protein.sequence.ProteinSequence]

Alias for field number 0

class schrodinger.application.msv.gui.gui_alignment.GuiProteinAlignment(sequences=None, aln=None, is_workspace=False)[source]

Bases: schrodinger.models.json.JsonableClassMixin, schrodinger.application.msv.gui.gui_alignment._ProteinAlignment

toJsonImplementation()[source]

Abstract method that must be defined by all derived classes. Converts an instance of the derived class into a jsonifiable object.

Returns

A dict made up of JSON native datatypes or Jsonable objects. See the link below for a table of such types. https://docs.python.org/2/library/json.html#encoders-and-decoders

classmethod fromJsonImplementation(json_obj, is_workspace=False)[source]

Abstract method that must be defined by all derived classes. Takes in a dictionary and constructs an instance of the derived class.

Parameters

json_dict (dict) – A dictionary loaded from a JSON string or file.

Returns

An instance of the derived class.

Return type

cls

classmethod adapter49004(json_dict)[source]
classmethod adapter48008(json_dict)[source]
__contains__(seq)

Returns whether the sequence is present in the alignment

__init__(sequences=None, aln=None, is_workspace=False)
Parameters
  • sequences (list) – An optional iterable of sequences

  • aln (alignment.ProteinAlignment) – An alignment to wrap this instance around.

  • is_workspace (bool) – Whether this alignment will only include sequences that are currently included in the workspace. This should only be set to True for an alignment created by the structure model. Note that this argument has absolutely no effect on the behavior of this alignment object. Instead, it is the responsibility of the structure model to make sure that the alignment is kept up to date.

__len__()

Returns the number of sequences in the alignment

classmethod adapter48002()
addDisulfideBond(res1, res2)

Add a disulfide bond if both residues’ sequences are in the alignment

Parameters
Raises

ValueError – if either sequence is not in the alignment

addElements(seq, res_i, elements, *, select=False)

See alignment.ProteinAlignment.addElements for additional method documentation. Note that the select argument is specific to this class and isn’t present in the alignment.ProteinAlignment method.

Parameters

select (bool) – Whether to select the added residues. Note that this argument is keyword-only.

addGapsBeforeIndices(gap_indices)

Add one gap to the alignment before each of the specified residue positions.

Note

the length of the gap_indices list must match the number of sequences in the alignment.

Parameters

gap_indices – A list of lists of indices to insert gaps before, one for each sequence in the alignment. Note that these indices are based on residue/gap numbering before the insertion. To insert gaps using indices based on numbering after the insertion, see addGapsByIndices.

addGapsByIndices(gap_indices)

Adds gaps to the alignment

Note

the length of the gap_indices list must match the number of sequences in the alignment.

Parameters

gap_indices (list[list[int]]) – A list of lists of gap indices, one for each sequence in the alignment. Note that these indices are based on residue/gap numbering after the insertion. To insert gaps using indices based on numbering before the insertion, see addGapsBeforeIndices.

Raises
  • ValueError – if gap_indices is the wrong length

  • AnchoredResidueError – if any gap index is before an anchored col

addSeq(seq, index=None, replace_selection=False)

Add a single sequence to the alignment

Parameters
  • seq (sequence.ProteinSequence) – The sequence to add.

  • index (int) – The index at which to insert; if None, the sequence is appended.

  • replace_selection (bool) – Whether to select the newly added sequences and deselect all other sequences. If False, selection will not be changed.

addSeqs(seqs, index=None, replace_selection=False)

Add multiple sequences to the alignment

Parameters
  • seqs (list[sequence.ProteinSequence]) – Sequences to add.

  • index (int) – The index at which to insert; if None, seqs are appended.

  • replace_selection (bool) – Whether to select the newly added sequences and deselect all other sequences. If False, selection will not be changed.

addSeqsToAlnSet(seqs, set_name)

Add all given sequences to the specified alignment set (i.e. a named group of sequences that are always kept together in the alignment). Sequences already in the set will be ignored. All other sequences will be moved to the end of the set. (Except for the reference sequence: The specified set will be moved to the top of the alignment if the reference sequence is added.)

Parameters
  • seqs (Iterable[sequence.Sequence]) – The sequences to add to the set.

  • set_name (str) – The name of the set to add the sequences to. If no set of this name exists, one will be created.

property all_structures
alnSetForSeq(seq)

Return the alignment set that contains the given sequence.

Parameters

seq (sequence.Sequence) – The sequence to retrieve the alignment set for.

Returns

The requested set. The calling scope must not modify the returned value. Will return None if seq is not part of any set.

Return type

AlignmentSet or None

alnSetNames()

Return all alignment set names. :rtype: set(str)

alnSetResSelected()

Whether any selected residues are in sequences in an alignment set :rtype: bool

alnSets()

Iterate through all alignment sets.

Returns

An iterator through all alignment sets. The calling scope must not modify any of the sets.

Return type

dict_keys

anchorResidueValid(res)

Helper method returning whether anchoring the given residue is valid.

Anchoring is valid if the given residue isn’t a gap and isn’t aligned to a reference gap.

If the given residue is a reference residue, this method will return whether at least one residue aligned to it can be anchored.

Parameters

res (residue.Residue) – The given residue.

Returns

Whether the given residue can be anchored.

Return type

bool

anchorResidues(residues)

Anchor the specified residues. If passed reference residues, all residues aligned to the reference residues will be anchored.

Anchored residues are constrained to stay aligned to the reference residue with the same column index at the time of anchoring. If elements are removed from the alignment, gaps are added before anchors to maintain alignment. If any other modifications are made to the alignment that would break an anchor, an exception is raised. However, calling code can temporarily take responsibility for maintaining the anchors within the suspendAnchors context.

Parameters

residues (list(residue.Residue)) – Residues to anchor.

property annotations
anyHidden()
blockSignals(self, bool) → bool
changeSeqChain(seq, new_chain)

Changes the chain for a sequence

Parameters
childEvent(self, QChildEvent)
children(self) → List[QObject]
clear()

Clears the entire alignment of sequences

clearAllCaching()
clearAllHighlights()

Clear all residue highlights

clearAnchors()
clearHMLigandConstraints()
clearHMProximityConstraints()
columnHasAllSameResidues(index)

Return whether or not the column at a specified index has all the same residues (excluding gaps).

Note that if any unknown residues are present, the column will not be considered to be of all the same residue type.

Parameters

index (int) – Index to check for uniformity

Returns

True if the column is of uniform identity, False otherwise.

Return type

bool

columns(omit_gaps=False, *, match_type=False)

A generator over all columns.

Parameters
  • omit_gaps (bool) – Whether to omit gaps

  • match_type (bool) – Whether to match reference sequence type

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
deleteSelectedGaps()

Delete all selected gaps. Selected residues will remain unchanged.

deleteSelection()

Delete all selected residues and gaps.

deselectGaps()

Deselect currently selected gaps

destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
property disulfide_bonds
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
elementsToContiguousColumns(elements, invert=False, additional_breaks=None, last_col=None)

Get elements marking contiguous columns containing any of the passed elements

Parameters
  • elements (iterable(AbstractSequenceElement)) – Elements to convert to columns

  • invert (bool) – Whether to invert logic (i.e. return columns not containing the passed elements)

  • additional_breaks (list[int] or None) – If given, contiguous columns will be broken at the specified indices. I.e., no contiguous set of columns will contain both column i and column i-1.

  • last_col (int or None) – If given, the last column to consider when constructing contiguous columns. It not given, all columns will be considered.

Returns

[start, end] elements of contiguous columns. Will be from the ref sequence unless the ref sequence is shorter than num_columns

Return type

iterable(tuple(AbstractSequenceElement, AbstractSequenceElement))

event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
expandSelectionAlongColumns()

Expand selection along the columns of selected elements.

expandSelectionAlongSequences(between_gaps)

Expand selected gaps along sequences, either expanding selected residues to fill between gaps, or expanding selected gaps to fill along gaps.

Parameters

between_gaps (bool) – Whether to expand the selection between or along gaps. True for between gaps, False for along gaps.

expandSelectionFromReference()

Expand selection along columns of selected reference elements

expandSelectionToAnnotationValues(anno, ann_index=0, cdr_scheme=None)

Expand the selection to other residues with the same annotation values. See ProteinSequence.getAnnotationValueForComparison for details of what “the same value” means.

Parameters
  • anno (annotation.ProteinSequenceAnnotations.ANNOTATION_TYPES) – Protein sequence annotation enum member. If anno.can_expand is False, this method will be a no-op.

  • ann_index (int) – Annotation index for multi-value annotations

  • cdr_scheme (annotation.AntibodyCDRScheme) – CDR scheme for antibody annotation

expandSelectionToFullChain()

Select all the residues in any sequence in which there is an already selected residue

expandSelectionToRectangle()

When a single block of residues is selected, expand that selection to a rectangle. I.e., if any residue in a column is selected, then select that column in any sequence that has any residues selected.

findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

findPattern(pattern)

Finds a specified PROSITE pattern in all sequences.

Parameters

pattern (str) – PROSITE pattern to search in sequences. See protein.sequence.find_generalized_pattern for documentation.

Returns

List of matching residues

Return type

list of protein.residue.Residue

classmethod fromClustalFile()

Returns alignment read from file in Clustal .aln format preserving order of sequences.

Parameters

file_name (str) – Source file name.

Raises

IOError – If output file cannot be read.

Returns

An alignment

Note

The alignment can be empty if no sequence was present in the input file.

classmethod fromFastaFile()

Returns alignment read from file in Clustal .aln format preserving order of sequences.

Raises

IOError – If the input file cannot be read.

Parameters

file_name (str) – name of input FASTA file

Returns

Read alignment. The alignment can be empty if no sequence was present in the input file.

Return type

ProteinAlignment

classmethod fromFastaString()

Read sequences from FASTA-formatted text, creates sequences and appends them to alignment. Splits sequence name from the FASTA header.

Parameters

lines (list of str) – list of strings representing FASTA file

Returns

The alignment

Return type

ProteinAlignment

classmethod fromFastaStringList()

Return an alignment object created from an iterable of sequence strings

Parameters

strings (Iterable of strings) – Sequences as iterable of strings (1D codes)

Returns

The alignment

Return type

ProteinAlignment

classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters

json_obj (dict) – A json-loaded dictionary to create an object from.

Returns

An instance of this class.

Return type

cls

classmethod fromStructure(eid=None)
Parameters
  • ct (schrodinger.structure.Structure) – The structure to convert

  • eid (str) – The entry id to assign to the created sequences. If not given, the entry id from the structure, if any, will be used.

Return type

cls

Returns

An alignment containing the sequences in the structure

gatherAlnSets()
getAlignmentMinimizedWithSpaces()

This method returns a new alignment and removes gap only columns however it leaves one gap column between blocks

Returns

the new, minimized alignment

Return type

BaseAlignment

getAlnSet(set_name)

Return the requested set.

Parameters

set_name (str) – The name of the set to retrieve.

Returns

The requested set. The calling scope must not modify the returned value.

Return type

AlignmentSet

Raises

ValueError – If no set with the given name was found.

getAnchoredResidues()
Returns

A frozenset of residues that are currently anchored.

:rtype : frozenset(residue.Residue)

getAnchoredResiduesWithRef()
Returns

A frozenset of residues that are currently anchored with the corresponding reference sequence residues

:rtype : frozenset(residue.Residue)

getColumn(index, omit_gaps=False)

Returns single alignment column at index position. Optionally, filters out gaps if omit_gaps is True.

Parameters
  • index (int) – The index in the alignment

  • omit_gaps (bool) – Whether to omit the gaps

Returns

Single alignment column at index position. Returns None to represent terminal gaps.

Return type

tuple(residue.Residue or residue.Gap or None)

getDiscontinuousSubalignment(indices)

Given a list of indices, return a new alignment of sequences made up of the residues at those specified indices within this alignment.

Parameters

indices (list of (int, int)) – List of (seq index, residue index) tuples

Returns

A new subalignment

Return type

BaseAlignment

getFrequencies(normalize=True)

Returns the frequencies of each residue in each column. Residues are sorted by decreasing frequency. Gapped positions are not counted when calculating frequencies.

Parameters

normalize (bool) – Whether to normalize the values; i.e. divide by the number of non-gaps in the column

Returns

frequencies of each residue in each alignment column

Return type

tuple(tuple(residue.Residue, float or int)))

getGapOnlyColumns()

For each sequence, return a list of the indices in that sequence for which the entire alignment contains gaps. (Indices will be omitted for a sequence if the sequence is shorter than the index.)

Returns

List of list of indices

Return type

list[list[int]]

getGaps()

Returns a list of list of gaps.

Returns

list(list(residue.Gap))

Return type

list

getGlobalAnnotationData(index, annotation)

Returns column-level annotation data at an index in the alignment

Parameters
  • index (int) – The index in the alignment

  • annotation (enum.Enum) – An enum representing the requested annotation, if any

getHighlightColorMap()
Returns

Read-only mapping between residue object and RGB tuple

Return type

types.MappingProxy

getHomologyStatus(seq)

Return the homology modeling status for the given sequence.

Parameters

seq (sequence.ProteinSequence) – Sequence to check status

Returns

Homology modeling status

Return type

schrodinger.application.msv.gui.viewconstants.HomologyStatus or NoneType

getOutlineMap()

Get the read-only map of outlines

getReferenceSeq()

Returns the sequence that has been set as reference sequence or None if there is no reference sequence.

Returns

The reference sequence or None

Return type

Sequence or None

getResOutlinesForSeq(seq)

Get the residue outline blocks for the given sequence

getResidueIndices(residues, sort=True)

Returns the indices (in the alignment) of the specified residues

Parameters
  • residues (list[residue.AbstractSequenceElement]) – The list of residues and gaps to get indices for.

  • sort (bool) – Whether the returned list should be sorted.

Return type

A list of (sequence index, residue index) tuples

Returns

list[tuple(int, int)]

getResidueSeqProps()

Get a list of all sequence properties that any residue has. :return: All the sequence properties :rtype: list[properties.SequenceProperty]

getResidueSimilarity(res)

Return the similarity score of a residue to the current reference residue at the residues position in the alignment.

Parameters

res (residue.Residue) – Residue to get the similarity score for

Returns

Similarity score for this residue

Return type

float or None

getResiduesWithStructure()

Returns a list of all residues with structure

getSelectedSequences()

Return a list of the currently selected sequences in alignment order.

Returns

List of currently selected sequences

Return type

list[sequence.Sequence]

getSeqShownStates()

Return whether each sequence in the alignment is shown (not hidden or filtered out)

Return type

list[bool]

getSeqsMatchingRefType()
getShownSeqs()

Return the sequences that are shown (not hidden or filtered out)

Return type

set

getSubalignment(start, end)

Return another alignment containing the elements within the specified start and end indices

Parameters
  • start (int) – The index at which the subalignment should start

  • end (int) – The index at which the subalignment should end (exclusive)

Returns

An alignment corresponding to the start and end points specified

Return type

BaseAligment

getTerminalGaps()

Returns the terminal gaps in all the sequences

Return type

list

Returns

list(list(residue.Gap))

getWorkspaceCounts()

Summarize the visibility status of the alignment’s sequences

Returns

Counts of each type of visibility

Return type

collections.Counter

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

property global_annotations
hasAlnSets()

Does this alignment contain any alignment sets? :rtype: bool

hasHMLigandConstraints()
hideSelectedSeqs()

Hide the selected sequences. If the reference seq is selected, it will not be hidden.

property hm_ligand_constraints
property homology_composite_residues

Residues to use for composite homology modeling

Return type

frozenset(residue.Residue)

index(seq)

Returns the index of the specified sequence.

Parameters

seq (sequence.Sequence) – The requested sequence

Return type

int

Returns

The index of the requested sequence

inherits(self, str) → bool
insertGapsToLeftOfSelection()

Insert one gap to the left of every selected block of residues/gaps. (I.e., if three contiguous residues are selected, only one gap will be inserted, and it will be placed to the left of the first selected residue.)

Raises

AnchoredResidueError – if inserting gaps would break anchors

insertSubalignment(aln, start)

Insert an alignment into the current alignment at the specified index

Parameters
  • aln (BaseAlignment) – The alignment to insert

  • start (int) – The index at which to insert the alignment

Raises

ValueError – if either alignment is not rectangular

installEventFilter(self, QObject)
invertResSelection()

Invert the selection

isHMLigandConstraint(res, ligand)
isHomologyCompositeResidue(res)
isReferenceSeq(seq)

Return whether or not a sequence is the reference sequence.

Parameters

seq (Sequence) – Sequence to check

Returns

True if the sequence is the reference sequence, False otherwise.

Return type

bool

isSeqExpanded(seq)
isSeqHidden(seq)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
isWorkspace()
Returns

Whether this alignment is controlled by the structure model and only includes sequences that are currently included in the workspace.

Return type

bool

property is_rectangular
killTimer(self, int)
metaObject(self) → QMetaObject
minimizeAlignment()

Minimizes the alignment, i.e. removes all gaps from the gap-only columns.

modifyingStructure()
moveSelectedSequences(after_seq)

Move all selected sequences in the alignment.

Parameters

dest_seq (sequence.Sequence) – The sequence to place the selected sequences after.

moveSelectionToLeft(num_cols)

Move the selection to the left along existing gaps. Note that this method assumes that there is a single rectangular block of selected residues.

Parameters

num_cols (int) – How many columns should we try to move the selection.

Returns

How many columns was the selection moved. Will always be less than or equal to num_cols. If less than num_cols, it means that the selection couldn’t be moved num_cols columns because there weren’t enough existing gaps or because there were anchored residues.

Return type

int

moveSelectionToRight(num_cols)

Move the selection to the right along existing gaps or, if necessary, by inserting new gaps. Note that this method assumes that there is a single rectangular block of selected residues.

Parameters

num_cols (int) – How many columns should we try to move the selection.

Returns

How many columns was the selection moved. Will always be less than or equal to num_cols. If less than num_cols, it means that the selection couldn’t be moved num_cols columns due to anchored residues.

Return type

int

moveToThread(self, QThread)
mutateResidues(seq_i, start, end, elements, *, select=False)

See alignment.ProteinAlignment.mutateResidues for additional method documentation. Note that the select argument is specific to this class and isn’t present in the alignment.ProteinAlignment method.

Parameters

select (bool) – Whether to select the mutated residues. Note that this argument applies on undo as well, so it should only be True if the residues to be mutated are selected when this method is called. Also note that this argument is keyword-only.

property num_columns
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

padAlignment()

Insert gaps into an alignment so that it forms a rectangular block

property pairwise_constraints
parent(self) → QObject
property pred_disulfide_bonds
property(self, str) → Any
property proximity_constraints
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeAllGaps()

Removes all the gaps of the sequences in the alignment.

removeAnchors(residues)

Unanchor residues. If passed reference residues, all residues anchored to those reference residues will be unanchored. Any given unanchored residues will be ignored.

Parameters

residues (iterable(residue.Residue)) – The residues to unanchor.

removeDisulfideBond(bond)

Disconnect a disulfide bond.

Parameters

bond (residue.DisulfideBond) – The bond to disconnect

Raises

ValueError – if either sequence is not in the alignment

removeElements(elements)

Removes the specified elements from the alignment.

Parameters

elements (iterable(residue.AbstractSequenceElement)) – An iterable of elements.

Raises
removeEventFilter(self, QObject)
removeSeq(seq)

Remove a sequence from the alignment

Parameters

seq (sequence.Sequence) – The sequence to remove

removeSeqs(seqs)

Remove multiple sequences from the alignment

removeSeqsFromAlnSet(seqs)

Remove all given sequences from any alignment sets they’re part of. Sequences not in a set will be ignored. All other sequences will be moved to the end of the set that they were in.

Parameters

seqs (Iterable[sequence.Sequence]) – The sequences to remove from alignment sets.

removeSubalignment(start, end)

Remove a block of the subalignment from the start to end points.

Parameters
  • start (int) – The start index of the columns to remove

  • end (int) – The end index of the columns to remove (exclusive)

removeTerminalGaps()

Removes the gaps from the ends of every sequence in the alignment

renameAlnSet(old_name, new_name)

Rename the specified alignment set.

Parameters
  • old_name (str) – The old name of the alignment set.

  • new_name (str) – The new name of the alignment set.

renameSeq(seq, new_name)

Changes the name for a sequence

Parameters
reorderSequences(seq_indices)

Reorder the sequences in the alignment using the specified list of indices

Parameters

seq_indices – A list with the new indices for sequences

Type

list of int

Raises

ValueError – In the event that the list of indices does not match the length of the alignment

replaceResiduesWithGaps(residues)

Replaces the specified residues with gaps

Parameters

residues (list) – A list of residues to replace with gaps

replaceSubalignment(aln, start, end)

Replace a subsection of the alignment indicated by start and end indices with the specified alignment

Parameters
  • aln (BaseAlignment) – The alignment to insert

  • start (int) – The starting index of the subsection to replace.

  • end (int) – The ending index of the subsection to replace.

Raises

ValueError – if either alignment is not rectangular

resetHomologyCache()
resetHomologyCompositeResidues()

Reset the homology modeling composite residues, if any

resetPairwiseConstraints()
selectAlignedResidues()

Selects residues in columns containing no gaps.

selectAntibodyCDR(scheme)

Select residues with Antibody CDR.

Parameters

scheme (schrodinger.protein.annotation.AntibodyCDRScheme) – Antibody CDR scheme to use

selectBindingSites()

Select residues with binding site contacts.

selectColsWithStructure()

Select all columns that contain only structured residues

selectColumns(cols, clear=False)

Select residues in the specified columns of the alignment

Parameters

cols (list(int)) – Columns to be selected

selectIdentityColumns()

Select all identity columns in the alignment

selectResiduesWithStructure()

Selects all residues with structure

sender(self) → QObject
senderSignalIndex(self) → int
seqMatchesRefType(seq)
property seq_annotations
setHMLigandConstraint(res, ligand)
setHMProximityConstraint(res)
setHomologyStatus(seq, status)

Set the homology modeling status for the given sequence.

Parameters
  • seq (sequence.ProteinSequence) – Sequence to set status

  • status (schrodinger.application.msv.gui.viewconstants.HomologyStatus) – Homology modeling status

setObjectName(self, str)
setOtherConstraint(res)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setRefConstraint(res)
setReferenceSeq(seq)

Set the specified sequence as the reference sequence.

Parameters

seq (sequence) – Sequence to set as reference sequence

setResSelectionStateForSelectedSeqs(selected: bool)

Set the selection state for all residues in selected sequences

setResidueHighlight(residues, color)

Set the specified residues to the specified color

Parameters

color (tuple) – RGB tuple to color the residues or empty tuple to clear

setRunSelectionState(res, select, expand_cols=False)

Select or deselect a run of contiguous residues or gaps from a sequence

Parameters
  • res (residue.Residue) – Residue or gap element to select the contiguous run for.

  • select (bool) – Whether to select the run. If False, the run will be deselected.

  • expand_cols (bool) – Whether to expand the selection along columns of the alignment.

setSecondaryStructureSelectionState(res, select=True)

Set the selection state of residues in the same secondary structure as a specified residue.

Parameters
  • res (residue.Residue) – Residue to update the related secondary structure of

  • select (bool) – If True, select the related secondary structure. Otherwise deselect it.

setSelectedResColor(color)

Set the selected residues to the specified color

Parameters

color (tuple) – RGB tuple to color the residues or empty tuple to clear

setSelectedResOutlineColor(color)
setSeqExpanded(seq, expanded=True)
setSeqFilterEnabled(enabled)
setSeqFilterQuery(query)
setUndoStack(undo_stack)
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack Set the undo stack on the object) – The undo stack on which to push commands

showAllSeqs()

Show all currently hidden sequences.

showSeqs(sequences, hide_others=False)

Show the specified sequences, optionally hiding others.

Parameters
  • sequences (set) – Sequences to show

  • hide_others (bool) – Whether to hide the other sequences (will not hide reference seq). This option is ignored if sequences is empty.

signalsBlocked(self) → bool
sort(*, key, reverse=False)

Sort the alignment by the specified criteria.

NOTE: Query sequence is not included in the sort.

Parameters
  • key (function) – A function that takes a sequence and returns a value to sort by for each sequence. (required keyword-only argument)

  • reverse (bool) – Whether to sort in reverse (descending) order.

sortByProperty(seq_prop, reverse=False)

Sort the sequences by a sequence property. Sequences that do not have the sequence property defined will be grouped at the end of the alignment (regardless of reverse)

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
suspendAnchors()

“Undoable” suspendAnchors. This is necessary for when we use suspendAnchors in a macro in order to preserve inter-command state. For example, if we do:

with compress_command(undo_aln.undo_stack):
    with undo_aln.suspendAnchors():
        undo_aln.removeAllGaps()
        undo_aln.addGapsByIndices(idxs)

Without an undoable suspendAnchors the above code will error on undo since the anchors won’t be resuspended.

This is implemented by creating a command for both entering and exiting the context. If we’re not in a macro, this method just delegates to the wrapped alignment.

thread(self) → QThread
timerEvent(self, QTimerEvent)
toClustalFile(file_name, use_unique_names=True)

Writes aln to a Clustal alignment file.

Raises

IOError – If output file cannot be written.

Parameters
  • file_name (str) – Destination file name.

  • use_unique_names (bool) – If True, write unique name for each sequence.

toFastaFile(file_name, use_unique_names=True, maxl=50)

Write self to specified FASTA file

Raises

IOError – If output file cannot be written.

toFastaString(use_unique_names=True, maxl=50)

Convert ProteinAlignment object to list of sequence strings

Parameters

aln (ProteinAlignment) – Alignment data

toFastaStringList()

Convert self to list of fasta sequence strings

Return type

list

Returns

list of str

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type

An instance of one the classes from NATIVE_JSON_DATATYPES

tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateHomologyCompositeResidues(to_add, to_remove, *, signal=True)

Update the residues to use for composite homology modeling.

Parameters
  • to_add (collections.Iterable(residue.Residue)) – Residues to add

  • to_remove (collections.Iterable(residue.Residue)) – Residues to remove

  • signal (bool) – Whether to emit a signal due to the change

class schrodinger.application.msv.gui.gui_alignment.CombinedChainResidueSelectionModel(aln, split_res_selection_model)[source]

Bases: schrodinger.application.msv.gui.gui_alignment.ResidueSelectionModel

A residue selection model for CombinedChainProteinAlignment. This selection model stores the selected combined-chain sequences and also updates the split-chain selection model. That way, the selection changes won’t be lost when the user toggles back to split-chain view.

Note that the ResidueSelectionModel and CombinedChainResidueSelectionModel for the same alignment will differ in their return values for isSingleBlockSelected and numBlocksSelected because of differences in the underlying sequences (but not isSingleBlockSingleSeqSelected, since that method requires that all residues be in the same chain).

__init__(aln, split_res_selection_model)[source]
Parameters
setCurrentSelectionState(residues, selected)[source]

Set residues as selected or deselected in the “current” selection. Note that “current” here means “the portion of the selection that’s in the process of being updated,” i.e., the selection that’s from the mouse click (or click and drag) that we’re currently in the middle of. This is equivalent to passing the QItemSelectionModel::Current | QItemSelectionModel::Clear flags to QItemSelectionModel::select.

Note

setSelectionState must not be called until the current selection has finished. (See finishCurrentSelection.)

Parameters
  • residues (Iter(residue.Residue)) – The residues to set the current selection to. Any previous current selection will be completely replaced.

  • selected (bool) – Whether the specified residues should be selected or deselected.

  • _undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

finishCurrentSelection()[source]

Finish the “current” selection and permanently merge it into the main selection. If there’s no “current” selection, then this method is a no-op, but is still safe to call.

See setCurrentSelectionState for additional information about the “current” selection.

Parameters

_undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

setSelectionState(residues, selected, *, _undoable=True)[source]

Set the selection state of the given residues. Either combined-chain or split-chain residues may be given.

Parameters
  • residues – The residues to select or deselect.

  • selected (bool) – Whether to select or deselect the residues.

  • _undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

clearSelection(*, _undoable=True)[source]

Deselect all elements.

Parameters

_undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

isSingleBlockSingleSeqSelected()[source]

Determine whether exactly one single block of residues/gaps (i.e. contiguous residues/gaps) in a single sequence is selected. :rtype: bool

SELECTION_SANITY_CHECK = True
anyStructuredResiduesSelected()

Determine if any structured residues (i.e. residues in a structure- linked sequence that aren’t SEQRES only) are selected. :rtype: bool

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

forceSelectionUpdate()

Force the selectionChanged signal to emit immediately rather than waiting for the timer to expire.

getSelection()
Returns

A set of currently selected elements

Return type

set

getSelectionIndices(sort=True)

Return a list of selected residue indices within the alignment.

Returns

A list of (sequence index, residue index) tuples for all selected residues.

Return type

list(tuple(int, int))

hasSelection()

Whether any items are currently selected.

Return type

bool

inherits(self, str) → bool
installEventFilter(self, QObject)
isSelected(ele)
Parameters

ele – The alignment element to determine the selection state of

Returns

whether ele is selected

Return type

bool

isSignalConnected(self, QMetaMethod) → bool
isSingleBlockSelected()

Determine whether exactly one single block of residues/gaps (i.e. contiguous residues/gaps) is selected. :rtype: bool

isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
numBlocksSelected()

Return the number of blocks of residues/gaps (i.e. contiguous residues/gaps) that are selected

Returns

Number of selected blocks

Return type

int

objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

onResiduesAboutToBeRemoved(residues)

When residues are about to be removed, deselect those residues.

Parameters

residues (list(residue.AbstractSequenceElement)) – A list of residues that were removed.

onSequencesAboutToBeRemoved(start, end)

When sequences are about to be removed, deselect all the residues in those sequences.

Parameters
  • start (int) – Start index of sequences about to be removed.

  • end (int) – End index of sequences about to be removed.

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
selectAll(*, _undoable=True)

Convenience method to select all residues. Skips sanity check for speed.

Parameters

_undoable (bool) – Whether to create an undoable command. Should only be passed by a command implementation.

selectionChanged
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setUndoStack(undo_stack)
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to push commands onto

signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
suspendSelection()

Suspend the selection in the context and restore it upon exit. Note that this is undoable, any selected elements that were removed from their sequence in the context when restored will be reselected.

thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.application.msv.gui.gui_alignment.CombinedChainSequenceSelectionModel(aln, split_seq_selection_model)[source]

Bases: schrodinger.application.msv.gui.gui_alignment.SequenceSelectionModel

A sequence selection model for CombinedChainProteinAlignment. Note that this selection model stores the selected combined-chain sequences and also updates the split-chain selection model.

__init__(aln, split_seq_selection_model)[source]
Parameters
setSelectionState(sequences, selected, *, update_split_aln=True)[source]

See parent class for method and positional argument documentation.

Parameters

update_split_aln (bool) – Whether to update sequence selection in the split-chain alignment. This class is responsible for keeping split- chain and combined-chain sequence selection in sync, so this should only be False if sequence selection in the split-chain alignment will be updated separately.

clearSelection()[source]

Unselect all elements.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

forceSelectionUpdate()

Force the selectionChanged signal to emit immediately rather than waiting for the timer to expire.

getSelection()
Returns

A set of currently selected elements

Return type

set

getSelectionIndices()

Return a list of the selected sequence indices within the alignment

Returns

Selected sequence indices

Return type

list(int)

hasSelection()

Whether any items are currently selected.

Return type

bool

inherits(self, str) → bool
installEventFilter(self, QObject)
isSelected(ele)
Parameters

ele – The alignment element to determine the selection state of

Returns

whether ele is selected

Return type

bool

isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

onSequencesAboutToBeRemoved(start, end)

Respond to a sequencesAboutToBeRemoved signal by deselecting any sequences that are about to be removed.

Parameters
  • start (int) – Start index of sequences about to be removed.

  • end (int) – End index of sequences about to be removed.

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
selectionChanged
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setUndoStack(undo_stack)
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to push commands onto

signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
suspendSelection()

Suspend the selection in the context and restore it upon exit.

thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.application.msv.gui.gui_alignment.CombinedChainAnnotationSelectionModel(aln, split_ann_selection_model)[source]

Bases: schrodinger.application.msv.gui.gui_alignment.AnnotationSelectionModel

Class that tracks the selection state of sequence annotation as (sequence, annotation enum, annotation index) tuples

__init__(aln, split_ann_selection_model)[source]
Parameters
setSelectionState(items, selected)[source]

Set the selection state of the provided items, ignoring `None`s

Parameters

selected (bool) – Whether to select or deselect the items

clearSelection()[source]

Unselect all elements.

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → List[QObject]
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

forceSelectionUpdate()

Force the selectionChanged signal to emit immediately rather than waiting for the timer to expire.

getSelection()
Returns

A set of currently selected elements

Return type

set

getSelectionIndices()

Return a list of selected element indices. Child classes should reimplement.

Returns

List of selection element indices

Return type

list

hasSelection()

Whether any items are currently selected.

Return type

bool

inherits(self, str) → bool
installEventFilter(self, QObject)
isSelected(ele)
Parameters

ele – The alignment element to determine the selection state of

Returns

whether ele is selected

Return type

bool

isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

onSequencesAboutToBeRemoved(start, end)

When sequences are about to be removed, deselect all the elements contained by those sequences.

Parameters
  • start (int) – Start index of sequences about to be removed.

  • end (int) – End index of sequences about to be removed.

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
selectionChanged
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setUndoStack(undo_stack)
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to push commands onto

signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
suspendSelection()

Inside the context, the selection model is deselected.

Parameters

sel_model (AbstractAlignmentSelectionModel) – The selection model to temporarily deselect

thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
class schrodinger.application.msv.gui.gui_alignment.GuiCombinedChainProteinAlignment(split_undoable_aln, *, chains_to_combine=None)[source]

Bases: schrodinger.application.msv.gui.gui_alignment._ProteinAlignment

An undoable alignment containing combined-chain sequences (sequence.CombinedChainProteinSequence objects).

__init__(split_undoable_aln, *, chains_to_combine=None)[source]
Parameters
  • split_undoable_aln (ProteinAlignment) – An undoable alignment containing split chain sequences. Note that, unlike alignment.CombinedChainProteinAlignment, changes made to the combined-chain alignment will automatically be reflected in the split-chain alignment. Also note that the reverse is not necessarily true; changes made to the split-chain alignment may not update the combined-chain alignment. If you modify the split-chain alignment and want a corresponding combined-chain alignment, you should create a new GuiCombinedChainProteinAlignment instance.

  • chains_to_combine (list[list[int]]) – Information about which split-chain sequences in split_undoable_aln should be included in which combined-chain sequence. Should be a list of lists of indices. Each index refers to the split-chain sequence at that position of split_undoable_aln, and split-chain sequences that are listed together will be combined into the same combined-chain sequence. Each split-chain sequence from split_undoable_aln must be referenced exactly once.

setSeqExpanded(seq, expanded=True)[source]
isSeqExpanded(seq)[source]
jsonDataWithoutSplitAln()[source]

Return a JSON-able dictionary that can be used to recreate this object using fromJsonAndSplitAln. :rtype: dict

classmethod fromJsonAndSplitAln(split_aln, json_dict)[source]

Restore a serialized object.

Parameters
Returns

The restored alignment

Return type

GuiCombinedChainProteinAlignment

setUndoStack(undo_stack)[source]
Parameters

undo_stack (schrodinger.application.msv.command.UndoStack Set the undo stack on the object) – The undo stack on which to push commands

setReferenceSeq(seq)[source]

Set the specified sequence as the reference sequence.

Parameters

seq (sequence) – Sequence to set as reference sequence

addSeqs(seqs, index=None, replace_selection=False)[source]

Add multiple sequences to the alignment. Note that either split-chain sequences or combined-chain sequences may be added (but not both at the same time). This method accepts split-chain sequences so that a caller can add sequences generated by seqio.py (or structure_model.py) without needing to first excplicitly combine chains.

Parameters
  • seqs (list[sequence.ProteinSequence] or list[sequence.CombinedChainProteinSequence]) – Sequences to add.

  • index (int) – The index at which to insert; if None, seqs are appended. Must be None if adding single-chain sequences.

  • replace_selection (bool) – Whether to select the newly added sequences and deselect all other sequences. If False, selection will not be changed.

removeSeqs(seqs)[source]

Remove multiple combined-chain sequences from the alignment.

Parameters

seqs (list[sequence.CombinedChainProteinSequence]) – Sequences to remove. Note that these must be combined- chain sequences (sequence.CombinedChainProteinSequence), not split-chain sequences (sequence.ProteinSequence)

renameSeq(seq, new_name)[source]

Changes the name for a sequence

Parameters
clear()[source]

Clears the entire alignment of sequences

moveSelectedSequences(after_seq)[source]

Move all selected sequences in the alignment.

Parameters

dest_seq (sequence.Sequence) – The sequence to place the selected sequences after.

findPattern(pattern)[source]

Finds a specified PROSITE pattern in all sequences.

Parameters

pattern (str) – PROSITE pattern to search in sequences. See protein.sequence.find_generalized_pattern for documentation.

Returns

List of matching residues

Return type

list[protein.residue.CombinedChainResidueWrapper]

alignChainStarts()[source]

Align chain starting positions (e.g. make sure that the start of the N-th chain occurs in the same column for all sequences). This method will add gaps at the starts and/or ends of chains to preserve anchoring.

Returns

A tuple of - A list of chain starting indices. This will not include the

starting index of the first chain, which is always 0.

  • The starting index of the first chain for which there’s no corresponding reference chain (e.g. the starting index for the third chain if there are only two chains in the reference sequence). This will be None if there are no chains without a corresponding reference chain.

Return type

tuple(list[int], int or None)

adjustChainStarts(num_gaps)[source]

Move each chain break position to the right by the specified number of gaps. Note that chain breaks can only be moved along gaps, not residues.

Parameters

num_gaps (list[list[int]]) – The number of gaps to move each chain break by, given as adjust_by[sequence_index][chain_break_index] = adjustment. Note that no adjustment is given for the start of the first chain or the end of the last chain.

Raises

AssertionError – If some of the sequence elements to be removed aren’t actually gaps.

expandSelectionToFullChain()[source]

Select all the residues in any sequence in which there is an already selected residue

__contains__(seq)

Returns whether the sequence is present in the alignment

__len__()

Returns the number of sequences in the alignment

addDisulfideBond(res1, res2)

Add a disulfide bond if both residues’ sequences are in the alignment

Parameters
Raises

ValueError – if either sequence is not in the alignment

addElements(seq, res_i, elements, *, select=False)

See alignment.ProteinAlignment.addElements for additional method documentation. Note that the select argument is specific to this class and isn’t present in the alignment.ProteinAlignment method.

Parameters

select (bool) – Whether to select the added residues. Note that this argument is keyword-only.

addGapsBeforeIndices(gap_indices)

Add one gap to the alignment before each of the specified residue positions.

Note

the length of the gap_indices list must match the number of sequences in the alignment.

Parameters

gap_indices – A list of lists of indices to insert gaps before, one for each sequence in the alignment. Note that these indices are based on residue/gap numbering before the insertion. To insert gaps using indices based on numbering after the insertion, see addGapsByIndices.

addGapsByIndices(gap_indices)

Adds gaps to the alignment

Note

the length of the gap_indices list must match the number of sequences in the alignment.

Parameters

gap_indices (list[list[int]]) – A list of lists of gap indices, one for each sequence in the alignment. Note that these indices are based on residue/gap numbering after the insertion. To insert gaps using indices based on numbering before the insertion, see addGapsBeforeIndices.

Raises
  • ValueError – if gap_indices is the wrong length

  • AnchoredResidueError – if any gap index is before an anchored col

addSeq(seq, index=None, replace_selection=False)

Add a single sequence to the alignment

Parameters
  • seq (sequence.ProteinSequence) – The sequence to add.

  • index (int) – The index at which to insert; if None, the sequence is appended.

  • replace_selection (bool) – Whether to select the newly added sequences and deselect all other sequences. If False, selection will not be changed.

addSeqsToAlnSet(seqs, set_name)

Add all given sequences to the specified alignment set (i.e. a named group of sequences that are always kept together in the alignment). Sequences already in the set will be ignored. All other sequences will be moved to the end of the set. (Except for the reference sequence: The specified set will be moved to the top of the alignment if the reference sequence is added.)

Parameters
  • seqs (Iterable[sequence.Sequence]) – The sequences to add to the set.

  • set_name (str) – The name of the set to add the sequences to. If no set of this name exists, one will be created.

property all_structures
alnSetForSeq(seq)

Return the alignment set that contains the given sequence.

Parameters

seq (sequence.Sequence) – The sequence to retrieve the alignment set for.

Returns

The requested set. The calling scope must not modify the returned value. Will return None if seq is not part of any set.

Return type

AlignmentSet or None

alnSetNames()

Return all alignment set names. :rtype: set(str)

alnSetResSelected()

Whether any selected residues are in sequences in an alignment set :rtype: bool

alnSets()

Iterate through all alignment sets.

Returns

An iterator through all alignment sets. The calling scope must not modify any of the sets.

Return type

dict_keys

anchorResidueValid(res)

Helper method returning whether anchoring the given residue is valid.

Anchoring is valid if the given residue isn’t a gap and isn’t aligned to a reference gap.

If the given residue is a reference residue, this method will return whether at least one residue aligned to it can be anchored.

Parameters

res (residue.Residue) – The given residue.

Returns

Whether the given residue can be anchored.

Return type

bool

anchorResidues(residues)

Anchor the specified residues. If passed reference residues, all residues aligned to the reference residues will be anchored.

Anchored residues are constrained to stay aligned to the reference residue with the same column index at the time of anchoring. If elements are removed from the alignment, gaps are added before anchors to maintain alignment. If any other modifications are made to the alignment that would break an anchor, an exception is raised. However, calling code can temporarily take responsibility for maintaining the anchors within the suspendAnchors context.

Parameters

residues (list(residue.Residue)) – Residues to anchor.

property annotations
anyHidden()
blockSignals(self, bool) → bool
changeSeqChain(seq, new_chain)

Changes the chain for a sequence

Parameters
childEvent(self, QChildEvent)
children(self) → List[QObject]
clearAllCaching()
clearAllHighlights()

Clear all residue highlights

clearAnchors()
clearHMLigandConstraints()
clearHMProximityConstraints()
columnHasAllSameResidues(index)

Return whether or not the column at a specified index has all the same residues (excluding gaps).

Note that if any unknown residues are present, the column will not be considered to be of all the same residue type.

Parameters

index (int) – Index to check for uniformity

Returns

True if the column is of uniform identity, False otherwise.

Return type

bool

columns(omit_gaps=False, *, match_type=False)

A generator over all columns.

Parameters
  • omit_gaps (bool) – Whether to omit gaps

  • match_type (bool) – Whether to match reference sequence type

combinedResForSplitRes(split_res)

Get the combined-chain residue for the given split-chain residue.

Parameters

res (residue.AbstractSequenceElement) – The split-chain residue

Returns

The combined-chain residue

Return type

residue.CombinedChainResidueWrapper

combinedSeqForSplitSeq(split_seq)

Get the combined-chain sequence that contains the given split-chain sequence.

Parameters

split_seq (sequence.Sequence) – The split-chain sequence

Returns

The combined-chain sequence

Return type

sequence.CombinedChainProteinSequence

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
deleteSelectedGaps()

Delete all selected gaps. Selected residues will remain unchanged.

deleteSelection()

Delete all selected residues and gaps.

deselectGaps()

Deselect currently selected gaps

destroyed

destroyed(self, object: QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
property disulfide_bonds
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → List[QByteArray]
elementsToContiguousColumns(elements, invert=False, additional_breaks=None, last_col=None)

Get elements marking contiguous columns containing any of the passed elements

Parameters
  • elements (iterable(AbstractSequenceElement)) – Elements to convert to columns

  • invert (bool) – Whether to invert logic (i.e. return columns not containing the passed elements)

  • additional_breaks (list[int] or None) – If given, contiguous columns will be broken at the specified indices. I.e., no contiguous set of columns will contain both column i and column i-1.

  • last_col (int or None) – If given, the last column to consider when constructing contiguous columns. It not given, all columns will be considered.

Returns

[start, end] elements of contiguous columns. Will be from the ref sequence unless the ref sequence is shorter than num_columns

Return type

iterable(tuple(AbstractSequenceElement, AbstractSequenceElement))

event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
expandSelectionAlongColumns()

Expand selection along the columns of selected elements.

expandSelectionAlongSequences(between_gaps)

Expand selected gaps along sequences, either expanding selected residues to fill between gaps, or expanding selected gaps to fill along gaps.

Parameters

between_gaps (bool) – Whether to expand the selection between or along gaps. True for between gaps, False for along gaps.

expandSelectionFromReference()

Expand selection along columns of selected reference elements

expandSelectionToAnnotationValues(anno, ann_index=0, cdr_scheme=None)

Expand the selection to other residues with the same annotation values. See ProteinSequence.getAnnotationValueForComparison for details of what “the same value” means.

Parameters
  • anno (annotation.ProteinSequenceAnnotations.ANNOTATION_TYPES) – Protein sequence annotation enum member. If anno.can_expand is False, this method will be a no-op.

  • ann_index (int) – Annotation index for multi-value annotations

  • cdr_scheme (annotation.AntibodyCDRScheme) – CDR scheme for antibody annotation

expandSelectionToRectangle()

When a single block of residues is selected, expand that selection to a rectangle. I.e., if any residue in a column is selected, then select that column in any sequence that has any residues selected.

findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

gatherAlnSets()
getAlignmentMinimizedWithSpaces()

This method returns a new alignment and removes gap only columns however it leaves one gap column between blocks

Returns

the new, minimized alignment

Return type

BaseAlignment

getAlnSet(set_name)

Return the requested set.

Parameters

set_name (str) – The name of the set to retrieve.

Returns

The requested set. The calling scope must not modify the returned value.

Return type

AlignmentSet

Raises

ValueError – If no set with the given name was found.

getAnchoredResidues()
Returns

A frozenset of residues that are currently anchored.

:rtype : frozenset(residue.Residue)

getAnchoredResiduesWithRef()
Returns

A frozenset of residues that are currently anchored with the corresponding reference sequence residues

:rtype : frozenset(residue.Residue)

getColumn(index, omit_gaps=False)

Returns single alignment column at index position. Optionally, filters out gaps if omit_gaps is True.

Parameters
  • index (int) – The index in the alignment

  • omit_gaps (bool) – Whether to omit the gaps

Returns

Single alignment column at index position. Returns None to represent terminal gaps.

Return type

tuple(residue.Residue or residue.Gap or None)

getDiscontinuousSubalignment(indices)

Given a list of indices, return a new alignment of sequences made up of the residues at those specified indices within this alignment.

Parameters

indices (list of (int, int)) – List of (seq index, residue index) tuples

Returns

A new subalignment

Return type

BaseAlignment

getFrequencies(normalize=True)

Returns the frequencies of each residue in each column. Residues are sorted by decreasing frequency. Gapped positions are not counted when calculating frequencies.

Parameters

normalize (bool) – Whether to normalize the values; i.e. divide by the number of non-gaps in the column

Returns

frequencies of each residue in each alignment column

Return type

tuple(tuple(residue.Residue, float or int)))

getGapOnlyColumns()

For each sequence, return a list of the indices in that sequence for which the entire alignment contains gaps. (Indices will be omitted for a sequence if the sequence is shorter than the index.)

Returns

List of list of indices

Return type

list[list[int]]

getGaps()

Returns a list of list of gaps.

Returns

list(list(residue.Gap))

Return type

list

getGlobalAnnotationData(index, annotation)

Returns column-level annotation data at an index in the alignment

Parameters
  • index (int) – The index in the alignment

  • annotation (enum.Enum) – An enum representing the requested annotation, if any

getHighlightColorMap()
Returns

Read-only mapping between residue object and RGB tuple

Return type

types.MappingProxy

getHomologyStatus(seq)

Return the homology modeling status for the given sequence.

Parameters

seq (sequence.ProteinSequence) – Sequence to check status

Returns

Homology modeling status

Return type

schrodinger.application.msv.gui.viewconstants.HomologyStatus or NoneType

getInterChainAnchors()

Return all residues that are anchored to a different chain of the reference sequence (e.g. a residue in the second chain anchored to a reference residue from the first chain).

Returns

The anchored residues.

Return type

set[residue.Residue]

getOutlineMap()

Get the read-only map of outlines

getReferenceSeq()

Returns the sequence that has been set as reference sequence or None if there is no reference sequence.

Returns

The reference sequence or None

Return type

Sequence or None

getResOutlinesForSeq(seq)

Get the residue outline blocks for the given sequence

getResidueIndices(residues, sort=True)

Returns the indices (in the alignment) of the specified residues

Parameters
  • residues (list[residue.AbstractSequenceElement]) – The list of residues and gaps to get indices for.

  • sort (bool) – Whether the returned list should be sorted.

Return type

A list of (sequence index, residue index) tuples

Returns

list[tuple(int, int)]

getResidueSeqProps()

Get a list of all sequence properties that any residue has. :return: All the sequence properties :rtype: list[properties.SequenceProperty]

getResidueSimilarity(res)

Return the similarity score of a residue to the current reference residue at the residues position in the alignment.

Parameters

res (residue.Residue) – Residue to get the similarity score for

Returns

Similarity score for this residue

Return type

float or None

getResiduesWithStructure()

Returns a list of all residues with structure

getSelectedSequences()

Return a list of the currently selected sequences in alignment order.

Returns

List of currently selected sequences

Return type

list[sequence.Sequence]

getSeqShownStates()

Return whether each sequence in the alignment is shown (not hidden or filtered out)

Return type

list[bool]

getSeqsMatchingRefType()
getShownSeqs()

Return the sequences that are shown (not hidden or filtered out)

Return type

set

getSubalignment(start, end)

Return another alignment containing the elements within the specified start and end indices

Parameters
  • start (int) – The index at which the subalignment should start

  • end (int) – The index at which the subalignment should end (exclusive)

Returns

An alignment corresponding to the start and end points specified

Return type

BaseAligment

getTerminalGaps()

Returns the terminal gaps in all the sequences

Return type

list

Returns

list(list(residue.Gap))

getWorkspaceCounts()

Summarize the visibility status of the alignment’s sequences

Returns

Counts of each type of visibility

Return type

collections.Counter

property global_annotations
hasAlnSets()

Does this alignment contain any alignment sets? :rtype: bool

hasHMLigandConstraints()
hideSelectedSeqs()

Hide the selected sequences. If the reference seq is selected, it will not be hidden.

property hm_ligand_constraints
property homology_composite_residues

Residues to use for composite homology modeling

Return type

frozenset(residue.Residue)

index(seq)

Returns the index of the specified sequence.

Parameters

seq (sequence.Sequence) – The requested sequence

Return type

int

Returns

The index of the requested sequence

inherits(self, str) → bool
insertGapsToLeftOfSelection()

Insert one gap to the left of every selected block of residues/gaps. (I.e., if three contiguous residues are selected, only one gap will be inserted, and it will be placed to the left of the first selected residue.)

Raises

AnchoredResidueError – if inserting gaps would break anchors

insertSubalignment(aln, start)

Insert an alignment into the current alignment at the specified index

Parameters
  • aln (BaseAlignment) – The alignment to insert

  • start (int) – The index at which to insert the alignment

Raises

ValueError – if either alignment is not rectangular

installEventFilter(self, QObject)
invertResSelection()

Invert the selection

isHMLigandConstraint(res, ligand)
isHomologyCompositeResidue(res)
isReferenceSeq(seq)

Return whether or not a sequence is the reference sequence.

Parameters

seq (Sequence) – Sequence to check

Returns

True if the sequence is the reference sequence, False otherwise.

Return type

bool

isSeqHidden(seq)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
isWorkspace()
Returns

Whether this alignment is controlled by the structure model and only includes sequences that are currently included in the workspace.

Return type

bool

property is_rectangular
killTimer(self, int)
metaObject(self) → QMetaObject
minimizeAlignment()

Minimizes the alignment, i.e. removes all gaps from the gap-only columns.

modifyingStructure()
moveSelectionToLeft(num_cols)

Move the selection to the left along existing gaps. Note that this method assumes that there is a single rectangular block of selected residues.

Parameters

num_cols (int) – How many columns should we try to move the selection.

Returns

How many columns was the selection moved. Will always be less than or equal to num_cols. If less than num_cols, it means that the selection couldn’t be moved num_cols columns because there weren’t enough existing gaps or because there were anchored residues.

Return type

int

moveSelectionToRight(num_cols)

Move the selection to the right along existing gaps or, if necessary, by inserting new gaps. Note that this method assumes that there is a single rectangular block of selected residues.

Parameters

num_cols (int) – How many columns should we try to move the selection.

Returns

How many columns was the selection moved. Will always be less than or equal to num_cols. If less than num_cols, it means that the selection couldn’t be moved num_cols columns due to anchored residues.

Return type

int

moveToThread(self, QThread)
mutateResidues(seq_i, start, end, elements, *, select=False)

See alignment.ProteinAlignment.mutateResidues for additional method documentation. Note that the select argument is specific to this class and isn’t present in the alignment.ProteinAlignment method.

Parameters

select (bool) – Whether to select the mutated residues. Note that this argument applies on undo as well, so it should only be True if the residues to be mutated are selected when this method is called. Also note that this argument is keyword-only.

property num_columns
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

padAlignment()

Insert gaps into an alignment so that it forms a rectangular block

property pairwise_constraints
parent(self) → QObject
property pred_disulfide_bonds
property(self, str) → Any
property proximity_constraints
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeAllGaps()

Removes all the gaps of the sequences in the alignment.

removeAnchors(residues)

Unanchor residues. If passed reference residues, all residues anchored to those reference residues will be unanchored. Any given unanchored residues will be ignored.

Parameters

residues (iterable(residue.Residue)) – The residues to unanchor.

removeDisulfideBond(bond)

Disconnect a disulfide bond.

Parameters

bond (residue.DisulfideBond) – The bond to disconnect

Raises

ValueError – if either sequence is not in the alignment

removeElements(elements)

Removes the specified elements from the alignment.

Parameters

elements (iterable(residue.AbstractSequenceElement)) – An iterable of elements.

Raises
removeEventFilter(self, QObject)
removeSeq(seq)

Remove a sequence from the alignment

Parameters

seq (sequence.Sequence) – The sequence to remove

removeSeqsFromAlnSet(seqs)

Remove all given sequences from any alignment sets they’re part of. Sequences not in a set will be ignored. All other sequences will be moved to the end of the set that they were in.

Parameters

seqs (Iterable[sequence.Sequence]) – The sequences to remove from alignment sets.

removeSubalignment(start, end)

Remove a block of the subalignment from the start to end points.

Parameters
  • start (int) – The start index of the columns to remove

  • end (int) – The end index of the columns to remove (exclusive)

removeTerminalGaps()

Removes the gaps from the ends of every sequence in the alignment

renameAlnSet(old_name, new_name)

Rename the specified alignment set.

Parameters
  • old_name (str) – The old name of the alignment set.

  • new_name (str) – The new name of the alignment set.

reorderSequences(seq_indices)

Reorder the sequences in the alignment using the specified list of indices

Parameters

seq_indices – A list with the new indices for sequences

Type

list of int

Raises

ValueError – In the event that the list of indices does not match the length of the alignment

replaceResiduesWithGaps(residues)

Replaces the specified residues with gaps

Parameters

residues (list) – A list of residues to replace with gaps

replaceSubalignment(aln, start, end)

Replace a subsection of the alignment indicated by start and end indices with the specified alignment

Parameters
  • aln (BaseAlignment) – The alignment to insert

  • start (int) – The starting index of the subsection to replace.

  • end (int) – The ending index of the subsection to replace.

Raises

ValueError – if either alignment is not rectangular

resetHomologyCache()
resetHomologyCompositeResidues()

Reset the homology modeling composite residues, if any

resetPairwiseConstraints()
selectAlignedResidues()

Selects residues in columns containing no gaps.

selectAntibodyCDR(scheme)

Select residues with Antibody CDR.

Parameters

scheme (schrodinger.protein.annotation.AntibodyCDRScheme) – Antibody CDR scheme to use

selectBindingSites()

Select residues with binding site contacts.

selectColsWithStructure()

Select all columns that contain only structured residues

selectColumns(cols, clear=False)

Select residues in the specified columns of the alignment

Parameters

cols (list(int)) – Columns to be selected

selectIdentityColumns()

Select all identity columns in the alignment

selectResiduesWithStructure()

Selects all residues with structure

sender(self) → QObject
senderSignalIndex(self) → int
seqMatchesRefType(seq)
property seq_annotations
setHMLigandConstraint(res, ligand)
setHMProximityConstraint(res)
setHomologyStatus(seq, status)

Set the homology modeling status for the given sequence.

Parameters
  • seq (sequence.ProteinSequence) – Sequence to set status

  • status (schrodinger.application.msv.gui.viewconstants.HomologyStatus) – Homology modeling status

setObjectName(self, str)
setOtherConstraint(res)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setRefConstraint(res)
setResSelectionStateForSelectedSeqs(selected: bool)

Set the selection state for all residues in selected sequences

setResidueHighlight(residues, color)

Set the specified residues to the specified color

Parameters

color (tuple) – RGB tuple to color the residues or empty tuple to clear

setRunSelectionState(res, select, expand_cols=False)

Select or deselect a run of contiguous residues or gaps from a sequence

Parameters
  • res (residue.Residue) – Residue or gap element to select the contiguous run for.

  • select (bool) – Whether to select the run. If False, the run will be deselected.

  • expand_cols (bool) – Whether to expand the selection along columns of the alignment.

setSecondaryStructureSelectionState(res, select=True)

Set the selection state of residues in the same secondary structure as a specified residue.

Parameters
  • res (residue.Residue) – Residue to update the related secondary structure of

  • select (bool) – If True, select the related secondary structure. Otherwise deselect it.

setSelectedResColor(color)

Set the selected residues to the specified color

Parameters

color (tuple) – RGB tuple to color the residues or empty tuple to clear

setSelectedResOutlineColor(color)
setSeqFilterEnabled(enabled)
setSeqFilterQuery(query)
showAllSeqs()

Show all currently hidden sequences.

showSeqs(sequences, hide_others=False)

Show the specified sequences, optionally hiding others.

Parameters
  • sequences (set) – Sequences to show

  • hide_others (bool) – Whether to hide the other sequences (will not hide reference seq). This option is ignored if sequences is empty.

signalsBlocked(self) → bool
sort(*, key, reverse=False)

Sort the alignment by the specified criteria.

NOTE: Query sequence is not included in the sort.

Parameters
  • key (function) – A function that takes a sequence and returns a value to sort by for each sequence. (required keyword-only argument)

  • reverse (bool) – Whether to sort in reverse (descending) order.

sortByProperty(seq_prop, reverse=False)

Sort the sequences by a sequence property. Sequences that do not have the sequence property defined will be grouped at the end of the alignment (regardless of reverse)

startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
suspendAnchors()

“Undoable” suspendAnchors. This is necessary for when we use suspendAnchors in a macro in order to preserve inter-command state. For example, if we do:

with compress_command(undo_aln.undo_stack):
    with undo_aln.suspendAnchors():
        undo_aln.removeAllGaps()
        undo_aln.addGapsByIndices(idxs)

Without an undoable suspendAnchors the above code will error on undo since the anchors won’t be resuspended.

This is implemented by creating a command for both entering and exiting the context. If we’re not in a macro, this method just delegates to the wrapped alignment.

thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = - 1) → str
updateHomologyCompositeResidues(to_add, to_remove, *, signal=True)

Update the residues to use for composite homology modeling.

Parameters
  • to_add (collections.Iterable(residue.Residue)) – Residues to add

  • to_remove (collections.Iterable(residue.Residue)) – Residues to remove

  • signal (bool) – Whether to emit a signal due to the change