schrodinger.application.msv.gui.msv_widget module¶
- schrodinger.application.msv.gui.msv_widget.format_seq_name_with_chain(seq, include_chain)[source]¶
Return a name identifying the sequence, with the chain name optionally in parentheses
- Parameters
seq (
sequence.Sequence
) – The sequence to formatinclude_chain (bool) – Whether to include the chain in the name
- Returns
A formatted name to identify the sequence
- Return type
str
Decorator that shows a dialog and skips the function if the widget has hidden seqs
- class schrodinger.application.msv.gui.msv_widget.MsvTaskQueue(*args, _param_type=<object object>, **kwargs)[source]¶
Bases:
schrodinger.tasks.queue.TaskQueue
- description: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- addTask(task)¶
- blockSignals(self, bool) bool ¶
- block_signal_propagation()¶
- calling_context¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- childEvent(self, QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- classmethod defaultValue(*args, **kwargs)¶
- deleteLater(self)¶
- descriptionChanged¶
- descriptionReplaced¶
- destroyed¶
destroyed(self, object: QObject = None) [signal]
- disconnect(QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, QEvent) bool ¶
- eventFilter(self, QObject, QEvent) bool ¶
- failure_info¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- 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]
- 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 fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam(*args, **kwargs)¶
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(*args, **kwargs)¶
- classmethod getParamValue(*args, **kwargs)¶
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTasks()¶
Return all tasks in the queue.
- Return type
tuple[tasks.AbstractTask]
- getTypeHint()¶
- 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.
- guard()¶
Context manager that saves any Exception raised inside
- static guard_method(func)¶
- inherits(self, str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- input: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- inputChanged¶
- inputReplaced¶
- installEventFilter(self, QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault(*args, **kwargs)¶
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
Implementations are responsible for immediately stopping the task. No threads or processes should be running after this method is complete.
This method should be called sparingly since in many contexts the task will be forced to terminate without a chance to clean up or free resources.
- killTimer(self, int)¶
- mainDone¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- max_running_tasks: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_running_tasksChanged¶
- max_running_tasksReplaced¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- 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.
- queueDone¶
- queuedTaskFinished¶
- receivers(self, PYQT_SIGNAL) int ¶
- removeEventFilter(self, QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
- run()¶
- classmethod runFromCmdLine()¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, str)¶
- classmethod setParamValue(*args, **kwargs)¶
- setParent(self, QObject)¶
- setProperty(self, str, Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setUpMain()¶
- setValue(*args, **kwargs)¶
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(skip_preprocessing=False)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, QTimerEvent)¶
- toDict(*args, **kwargs)¶
- 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
- toJsonImplementation(*args, **kwargs)¶
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
- tr(self, str, disambiguation: str = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.application.msv.gui.msv_widget.AbstractMsvWidget(parent=None, struc_model=None, *, undo_stack)[source]¶
Bases:
schrodinger.models.mappers.MapperMixin
,schrodinger.ui.qt.basewidgets.BaseWidget
Acts as a controller/container for a ProteinAlignment, the viewmodel proxy stacks that wrap it, and the views required to present these proxy stacks.
Each tab in the MSV contains a different instance of an MSV Widget.
- Variables
residueHovered – Signal emitted when a residue cell is hovered
residueUnhovered – Signal emitted when a residue cell is unhovered
resHighlightStatusChanged – Signal emitted when residue highlighting changes. Emitted with whether any residues are highlighted.
renameSequenceRequested – A signal emitted to notify listeners to open the rename sequence dialog
taskStarted – Signal emitted when a task is started. Task types should have a description defined in
toolbar.TaskStatusBar.PRETTY_TASK_NAMES
.
- model_class¶
alias of
schrodinger.application.msv.gui.gui_models.PageModel
- duplicateIntoNewTabRequested¶
- translateIntoNewTabRequested¶
- residueHovered¶
- residueUnhovered¶
- openColorPanelRequested¶
- resHighlightStatusChanged¶
- editToolbarUpdateRequested¶
- renameSequenceRequested¶
- taskStarted¶
- __init__(parent=None, struc_model=None, *, undo_stack)[source]¶
- Parameters
parent (QtWidgets.QWidget) – The Qt parent
struc_model (structure_model.StructureModel) – The structure model to use when interacting with sequences associated with three-dimensional structures. If None, a new structure model will be created.
undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to use.
- initSetOptions()[source]¶
Suggested subclass use: set instance variables, excluding layouts and subwidgets. Also use here to (optionally) apply the legacy stylesheet spacing settings (PANEL-19101).
- initSetUp()[source]¶
Creates widget from
ui
and stores itui_widget
.Suggested subclass use: create and initialize subwidgets, and connect signals.
- onVScrollBarRangeChanged(_, max_)[source]¶
When the vertical scrollbar is disabled, (i.e. the min and max are 0) style it to be mostly invisible.
- setModel(model)[source]¶
Sets the model object for the mapper. Disconnects the old model, if one is set, and connects the new model. Pass in None to have no model set.
- Parameters
model – the model instance or None
- getSignalsAndSlots(model)[source]¶
Override this method to specify signal and slot pairs that need to be connected/disconnected whenever the model instance is switched using setModel. The model instance is provided as an argument so that instance-specific signals can be used, but any pairs of signals and slots may be returned from this method.
- Returns
a list of 2-tuples where each tuple is a signal, slot pair
- getValidIdMap()[source]¶
Get the valid id map for the currently selected sequences.
- Returns
Map of valid PDB IDs to their source sequence
- Return type
dict(str: sequence.Sequence)
- updateGetStructureLinkSeq()[source]¶
Update if getting the structure from PDB action is enabled in the view.
- property options_model¶
- property image_export_dialog¶
Delay instantiation of the image export dialog until it is needed to prevent unnecessary file handles from being opened
- Returns
the image export dialog
- Return type
dialogs.MSVImageExportDialog
- property seq_export_dialog¶
Delay instantiation of the image export dialog until it is needed to prevent unnecessary file handles from being opened
- Returns
the image export dialog
- Return type
dialogs.MSVSequenceExportDialog
- openPropertyDialog()[source]¶
Show the dialog that controls which properties are shown in the alignment metrics view
- getShownSplitSequences()[source]¶
Return the currently shown single-chain sequences in the order they appear in the alignment
- Return type
tuple
- getSelectedSequences()[source]¶
Return a list of the currently selected sequences in the order they appear in the alignment
- Returns
list of selected sequences
- Return type
list of
sequence.Sequence
- setSelectedSequences(seqs)[source]¶
Set sequence selection to the specified sequences.
- Parameters
seqs (list of
schrodinger.protein.sequence.Sequence
) – List of sequences to select
- generatePredictionAnnotation(anno)[source]¶
Generate predictions for the given prediction annotation.
anno
should be a key inPRED_ANNO_TO_PRED_FUNC
.
- resetUndoStack()[source]¶
Reset the undo stack
This needs to be called when we perform an operation that gets tangled up with Maestro’s single step undo, so that permitting an undo from msv would result in data corruption.
- getAlignment()[source]¶
Returns the widget’s alignment instance
- Return type
- Returns
The widget’s alignment
- importSeq(seq, index=None)[source]¶
Adds a given sequence to the widget’s alignment and align if the widget already had one or more sequences
- Parameters
seq (schrodinger.protein.sequence.ProteinSequence) – The sequence to add
index (int or None) – Index to import the seq at
- importSeqs(seqs, index=None, replace_selection=True)[source]¶
Add sequences to the widget’s alignment and align if the widget already had one or more sequences.
Warning
Avoid calling this method from unittests as it adds a maestro test-time dependency
- Parameters
seqs (iterable(schrodinger.protein.sequence.ProteinSequence)) – Sequences to add
index (int or None) – Index to import the seqs at (must be 1 or greater)
- removeSequences(seqs)[source]¶
Remove the specified sequences. Displays the new reference sequence in case it is hidden.
- Parameters
seqs (list(sequence.Sequence)) – List of sequences to be removed
- setSelectedSeqAsReference()[source]¶
Set the selected sequence as the reference sequence. If more than one sequence is selected, no reference sequence will be set. Restore the expanded state of each sequence afterwards, because it will be reset after the reordering of the rows.
- blastSelectedSeq()[source]¶
Set selected sequence as reference sequence and open BLAST search dialog.
- expandSelectionAlongCols()[source]¶
Expand selection based on current residue selection to include all residues in their columns.
- expandSelectionReferenceOnly()[source]¶
Select column residues for all columns that have a non-gap reference
- moveSelectedSequences(direction)[source]¶
Move the currently selected sequences in the specified direction.
Will prompt the user if there are hidden seqs and the direction is Up or Down.
- Parameters
direction (viewconstants.Direction) – Direction to move items.
- Raises
ValueError – Invalid value of
direction
.IndexError –
seq_list
is not a subset of self.
- classmethod moveItems(all_items, sel_items, direction)[source]¶
Move the specified items in the specified direction.
- Parameters
all_items (list) – List of unique items.
sel_items (list) – Items to move; must be a subset of
all_items
.direction (viewconstants.Direction) – Direction to move items.
- Returns
Reordered items
- Return type
list
- Raises
ValueError – Invalid value of
direction
orsel_items
is not a subset ofall_items
.
- getShownRowTypes()[source]¶
Returns a list of enums representing the shown row types
- Return type
list
- Returns
A list of enums
- rowWrap()[source]¶
Indicates whether rows are currently wrapped
- Return type
bool
- Returns
Whether the rows are currently wrapped
- groupedByType()[source]¶
Indicates whether rows are grouped by type
- Return type
bool
- Returns
Whether the rows are currently grouped by type
- setSequenceExpansionState(sequences=None, expand=True)[source]¶
Set the expansion state for the given (or all shown) sequences.
- Parameters
sequences (list(Sequence)) – Sequences to expand or collapse. If None, use all shown sequences.
expand (bool) – Whether to expand the sequences
- translateSeqsInPlace(seqs)[source]¶
Translate the given sequences in place.
- Parameters
seqs (iterable[sequence.NucleicAcidSequence]) – The sequencs to translate
- applyColorScheme(scheme)[source]¶
Set the sequence row color scheme.
- Parameters
scheme – The color scheme to be applied.
- Type
- setSelectedResColor(color)[source]¶
Set the highlight color of the selected residues and enable colors
- sortBy(sort_by, reverse=False)[source]¶
Sort the alignment by the specified criteria.
- Parameters
sort_by (viewconstants.SortTypes) – The criterion to sort on
reverse – Whether to sort in reverse (descending) order.
- saveImage()[source]¶
Saves multiple sequence alignment as an image file, by default, exports image of the entire alignment.
- getLogoView()[source]¶
Return an alignment view which contains the rulers and sequence logo.
- Returns
the logo view
- Return type
- timeScrolling(only_horizontal=False, print_to_stdout=True)[source]¶
Scroll the alignment and print how long it takes to the terminal.
- Parameters
only_horizontal (bool) – If True, the alignment will only be scrolled horizontally. If False, the alignment will be scrolled both vertically and horizontally.
print_to_stdout (bool) – Whether to print a message when scrolling is starting and ending.
- Returns
The time (in seconds) to scroll the alignment.
- Return type
float
- timeScrollingByPage()[source]¶
Scroll the alignment and print how long it takes to the terminal. Scrolling is only done downwards and rightwards so that no cached data is used.
- profileScrolling()[source]¶
Scroll the alignment while recording profiling data. Returns immediately.
- profileScrollingBlocking(only_horizontal=False, print_to_stdout=True, filename=None)[source]¶
Scroll the alignment while recording profiling data. Returns when scrolling is complete.
- Parameters
only_horizontal (bool) – If True, the alignment will only be scrolled horizontally. If False, the alignment will be scrolled both vertically and horizontally.
print_to_stdout (bool) – Whether to print the filename, the measured time, and a message when scrolling is starting and ending.
filename (str or None) – The file to save profiling data to. If not given, a filename will be generated using the current date and time.
- Returns
The time (in seconds) to scroll the alignment.
- Return type
float
- profileScrollingByPage()[source]¶
Scroll the alignment while recording profiling data. Scrolling is only done downwards and rightwards so that no cached data is used.
- pullWorkspaceColors()[source]¶
Update the current color scheme with colors from the workspace. This does not modify the options model.
- applyColorsToWorkspace(all_atoms=False)[source]¶
Update the colors in the workspace with colors from the MSV.
- Parameters
all_atoms (bool) – Whether to color all atoms or just carbons
- loadPdbs(pdb_paths, index=None)[source]¶
Loads a pdb file into the widget. This will load the PDB into the workspace for all widgets. (See comments on MSV-1326.) If an index is specified, sequences will be loaded at that index. Index cannot be specified for Workspace tab.
- Parameters
pdb_path (str) – Path to the pdb file
index (int or None) – Index to insert the sequences at. Cannot be specified for Workspace widget.
- Raise
ValueError if index is specified for Workspace widget.
- importIncluded(replace_selection=True)[source]¶
Import all sequences that are included in the Maestro workspace.
- getReferenceSeq()[source]¶
Helper function that returns the reference sequence.
- Returns
reference sequence of the underlying alignment
- Return type
Sequence
- isWorkspace()[source]¶
- Returns
Whether this widget contains an alignment that is always kept in sync with the Maestro workspace.
- Return type
bool
- setEditMode(enable)[source]¶
Enable or disable edit mode.
- Parameters
enable (bool) – Whether to enable edit mode.
- copySelectedSeqs()[source]¶
Returns a dictionary of new copies of each selected sequence mapped to the sequence it was copied from.
- Returns
Dictionary of new sequence copies mapped to their source sequence
- Return type
dict
- APPLY_LEGACY_STYLESHEET = True¶
- APPLY_PANELX_STYLESHEET = False¶
- DrawChildren = 2¶
- DrawWindowBackground = 1¶
- IgnoreMask = 4¶
- class PaintDeviceMetric¶
Bases:
int
- PdmDepth = 6¶
- PdmDevicePixelRatio = 11¶
- PdmDevicePixelRatioScaled = 12¶
- PdmDpiX = 7¶
- PdmDpiY = 8¶
- PdmHeight = 2¶
- PdmHeightMM = 4¶
- PdmNumColors = 5¶
- PdmPhysicalDpiX = 9¶
- PdmPhysicalDpiY = 10¶
- PdmWidth = 1¶
- PdmWidthMM = 3¶
- class RenderFlag¶
Bases:
int
- class RenderFlags¶
- class RenderFlags(Union[QWidget.RenderFlags, QWidget.RenderFlag]) None
- class RenderFlags(QWidget.RenderFlags) None
Bases:
sip.simplewrapper
- __init__(*args, **kwargs)¶
- SHOW_AS_WINDOW = False¶
- acceptDrops(self) bool ¶
- property accepted¶
- accessibleDescription(self) str ¶
- accessibleName(self) str ¶
- actionEvent(self, QActionEvent)¶
- actions(self) List[QAction] ¶
- activateWindow(self)¶
- addAction(self, QAction)¶
- addActions(self, Iterable[QAction])¶
- adjustSize(self)¶
- autoFillBackground(self) bool ¶
- backgroundRole(self) QPalette.ColorRole ¶
- baseSize(self) QSize ¶
- blockSignals(self, bool) bool ¶
- changeEvent(self, QEvent)¶
- childAt(self, QPoint) QWidget ¶
- AbstractMsvWidget.childAt(self, int, int) -> QWidget
- childEvent(self, QChildEvent)¶
- children(self) List[QObject] ¶
- childrenRect(self) QRect ¶
- childrenRegion(self) QRegion ¶
- clearFocus(self)¶
- clearMask(self)¶
- close(self) bool ¶
- closeEvent(event)¶
Ensures proper handling of OK, Cancel, and [X] button clicks
- colorCount(self) int ¶
- connectNotify(self, QMetaMethod)¶
- contentsMargins(self) QMargins ¶
- contentsRect(self) QRect ¶
- contextMenuEvent(self, QContextMenuEvent)¶
- contextMenuPolicy(self) Qt.ContextMenuPolicy ¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- createWindowContainer(QWindow, parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = 0) QWidget ¶
- cursor(self) QCursor ¶
- customContextMenuRequested¶
customContextMenuRequested(self, QPoint) [signal]
- customEvent(self, QEvent)¶
- debug()¶
- defineMappings()¶
Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:
a basic widget, like
QLineEdit
orQComboBox
a custom object that inherits
MapperMixin
orTargetMixin
a
TargetSpec
instancea slot
For common widgets, standard signals and getter/setter methods will be used, as defined in
mappers._get_default_access_names()
.For more fine-grained custom control, instantiate a
TargetSpec
object, which allows custom setters, getters, and signals to be specified.Supplying a slot as the first element of the tuple is equivalent to providing
TargetSpec(slot=my_slot)
.Note that all target slots are triggered on
setModel()
as well as in response to the specified signal.The param is an abstract param reference, e.g. MyModel.my_param.
Example:
def defineMappings(self): combo = self.style_combo return [(self.name_le, MyModel.name), (TargetSpec(combo, getter=combo.currentText, setter=combo.setCurrentText), MyModel.style), (self.coord_widget, MyModel.coord), (self._onASLTextChanged, MyModel.asl_text)]
- deleteLater(self)¶
- depth(self) int ¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- destroyed¶
destroyed(self, object: QObject = None) [signal]
- devType(self) int ¶
- devicePixelRatio(self) int ¶
- devicePixelRatioF(self) float ¶
- devicePixelRatioFScale() float ¶
- disconnect(QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- effectiveWinId(self) PyQt5.sip.voidptr ¶
- ensurePolished(self)¶
- enterEvent(self, QEvent)¶
- error(*args, **kwargs)¶
Shows a popup error message box. For parameter documentation see
messagebox.MessageBox
.
- event(self, QEvent) bool ¶
- eventFilter(self, QObject, QEvent) bool ¶
- find(PyQt5.sip.voidptr) QWidget ¶
- 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]
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPolicy(self) Qt.FocusPolicy ¶
- focusPreviousChild(self) bool ¶
- focusProxy(self) QWidget ¶
- focusWidget(self) QWidget ¶
- font(self) QFont ¶
- fontInfo(self) QFontInfo ¶
- fontMetrics(self) QFontMetrics ¶
- foregroundRole(self) QPalette.ColorRole ¶
- forgetMessageBoxResponse(key)¶
Forgets any previously saved response that was stored via a save_response_key.
- Parameters
key – the key for the response to forget
- frameGeometry(self) QRect ¶
- frameSize(self) QSize ¶
- geometry(self) QRect ¶
- getContentsMargins(self) Tuple[int, int, int, int] ¶
- getModel()¶
- grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) QPixmap ¶
- grabGesture(self, Qt.GestureType, flags: Union[Qt.GestureFlags, Qt.GestureFlag] = Qt.GestureFlags())¶
- grabKeyboard(self)¶
- grabMouse(self)¶
- grabMouse(self, Union[QCursor, Qt.CursorShape]) None
- grabShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) int ¶
- graphicsEffect(self) QGraphicsEffect ¶
- graphicsProxyWidget(self) QGraphicsProxyWidget ¶
- hasFocus(self) bool ¶
- hasHeightForWidth(self) bool ¶
- hasMouseTracking(self) bool ¶
- hasTabletTracking(self) bool ¶
- height(self) int ¶
- heightForWidth(self, int) int ¶
- heightMM(self) int ¶
- hide(self)¶
- hideEvent(self, QHideEvent)¶
- info(*args, **kwargs)¶
Shows a popup information message box. For parameter documentation see
messagebox.MessageBox
.
- inherits(self, str) bool ¶
- initFinalize()¶
Suggested subclass use: perform any remaining initialization.
- initPainter(self, QPainter)¶
- initSetDefaults()¶
@overrides: widgetmixins.InitMixin
- inputMethodEvent(self, QInputMethodEvent)¶
- inputMethodHints(self) Qt.InputMethodHints ¶
- inputMethodQuery(self, Qt.InputMethodQuery) Any ¶
- AbstractMsvWidget.insertAction(self, QAction, QAction)
- insertActions(self, QAction, Iterable[QAction])¶
- installEventFilter(self, QObject)¶
- isActiveWindow(self) bool ¶
- isAncestorOf(self, QWidget) bool ¶
- isEnabled(self) bool ¶
- isEnabledTo(self, QWidget) bool ¶
- isFullScreen(self) bool ¶
- isHidden(self) bool ¶
- isLeftToRight(self) bool ¶
- isMaximized(self) bool ¶
- isMinimized(self) bool ¶
- isModal(self) bool ¶
- isRightToLeft(self) bool ¶
- isSignalConnected(self, QMetaMethod) bool ¶
- isVisible(self) bool ¶
- isVisibleTo(self, QWidget) bool ¶
- isWidgetType(self) bool ¶
- isWindow(self) bool ¶
- isWindowModified(self) bool ¶
- isWindowType(self) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- keyboardGrabber() QWidget ¶
- killTimer(self, int)¶
- layout(self) QLayout ¶
- layoutDirection(self) Qt.LayoutDirection ¶
- leaveEvent(self, QEvent)¶
- locale(self) QLocale ¶
- logicalDpiX(self) int ¶
- logicalDpiY(self) int ¶
- lower(self)¶
- makeInitialModel()¶
- mapFrom(self, QWidget, QPoint) QPoint ¶
- mapFromGlobal(self, QPoint) QPoint ¶
- mapFromParent(self, QPoint) QPoint ¶
- mapTo(self, QWidget, QPoint) QPoint ¶
- mapToGlobal(self, QPoint) QPoint ¶
- mapToParent(self, QPoint) QPoint ¶
- mappedParams()¶
Return a list of the abstract params that are mapped to.
- mask(self) QRegion ¶
- maximumHeight(self) int ¶
- maximumSize(self) QSize ¶
- maximumWidth(self) int ¶
- metaObject(self) QMetaObject ¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- minimumHeight(self) int ¶
- minimumSize(self) QSize ¶
- minimumSizeHint(self) QSize ¶
- minimumWidth(self) int ¶
- property model¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseGrabber() QWidget ¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- move(self, QPoint)¶
- AbstractMsvWidget.move(self, int, int) -> None
- moveEvent(self, QMoveEvent)¶
- moveToThread(self, QThread)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int] ¶
- nativeParentWidget(self) QWidget ¶
- nextInFocusChain(self) QWidget ¶
- normalGeometry(self) QRect ¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, str) [signal]
- overrideWindowFlags(self, Union[Qt.WindowFlags, Qt.WindowType])¶
- overrideWindowState(self, Union[Qt.WindowStates, Qt.WindowState])¶
- paintEngine(self) QPaintEngine ¶
- paintEvent(self, QPaintEvent)¶
- paintingActive(self) bool ¶
- palette(self) QPalette ¶
- parent(self) QObject ¶
- parentWidget(self) QWidget ¶
- physicalDpiX(self) int ¶
- physicalDpiY(self) int ¶
- pos(self) QPoint ¶
- previousInFocusChain(self) QWidget ¶
- 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.
- question(*args, **kwargs)¶
Shows a popup question message box. For parameter documentation see
messagebox.QuestionMessageBox
.
- raise_(self)¶
- receivers(self, PYQT_SIGNAL) int ¶
- rect(self) QRect ¶
- releaseKeyboard(self)¶
- releaseMouse(self)¶
- releaseShortcut(self, int)¶
- removeAction(self, QAction)¶
- removeEventFilter(self, QObject)¶
- render(self, QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren))¶
- render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren)) None
- repaint(self)¶
- AbstractMsvWidget.repaint(self, int, int, int, int) -> None
- repaint(self, QRect) None
- repaint(self, QRegion) None
- reportValidation(results)¶
Present validation messages to the user. This is an implmentation of the
ValidationMixin
interface and does not need to be called directly.This method assumes that
error
andquestion
methods have been defined in the subclass, as in e.g.widget_mixins.MessageBoxMixin
.- Parameters
results (
validation.ValidationResults
) – Set of validation results generated byvalidate
- Returns
if True, there were no validation errors and the user decided to continue despite any warnings. If False, there was at least one validation error or the user decided to abort when faced with a warning.
- resetMappedParams()¶
- resize(self, QSize)¶
- AbstractMsvWidget.resize(self, int, int) -> None
- resizeEvent(self, QResizeEvent)¶
- restoreGeometry(self, Union[QByteArray, bytes, bytearray]) bool ¶
- run(blocking=False, modal=False, finished_callback=None)¶
Show this widget, while optionally blocking, making the widget window modal, and registering a callback for when the widget is closed again.
- Parameters
blocking (bool) – if True, block progress in the calling method until the widget is closed again.
modal (bool) – if True, open this widget as window modal. Otherwise, open this widget as nonmodal.
finished_callback (a callable object) – an object that will be called with no arguments when this widget is closed.
- runAllSlots()¶
- runValidation(silent=False, validate_children=True, stop_on_fail=True)¶
Runs validation and reports the results (unless run silently).
- Parameters
silent (bool) – run without any reporting (i.e. error messages to the user). This is useful if we want to programmatically test validity. Changes return value of this method from
ValidationResults
to a boolean.validate_children (bool) – run validation on all child objects. See
_validateChildren
for documentation on what this entails.stop_on_fail (bool) – stop validation when first failure is encountered
- Returns
if silent is False, returns the validation results. If silent is True, returns a boolean generated by
reportValidation
.- Return type
ValidationResults
or bool
- saveGeometry(self) QByteArray ¶
- AbstractMsvWidget.scroll(self, int, int)
- AbstractMsvWidget.scroll(self, int, int, QRect) -> None
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setAcceptDrops(self, bool)¶
- setAccessibleDescription(self, str)¶
- setAccessibleName(self, str)¶
- setAttribute(self, Qt.WidgetAttribute, on: bool = True)¶
- setAutoFillBackground(self, bool)¶
- setBackgroundRole(self, QPalette.ColorRole)¶
- AbstractMsvWidget.setBaseSize(self, int, int)
- setBaseSize(self, QSize) None ¶
- AbstractMsvWidget.setContentsMargins(self, int, int, int, int)
- setContentsMargins(self, QMargins) None ¶
- setContextMenuPolicy(self, Qt.ContextMenuPolicy)¶
- setCursor(self, Union[QCursor, Qt.CursorShape])¶
- setDefaults()¶
@overrides: af2.App
- setDisabled(self, bool)¶
- setEnabled(self, bool)¶
- setFixedHeight(self, int)¶
- setFixedSize(self, QSize)¶
- AbstractMsvWidget.setFixedSize(self, int, int) -> None
- setFixedWidth(self, int)¶
- setFocus(self)¶
- setFocus(self, Qt.FocusReason) None
- setFocusPolicy(self, Qt.FocusPolicy)¶
- setFocusProxy(self, QWidget)¶
- setFont(self, QFont)¶
- setForegroundRole(self, QPalette.ColorRole)¶
- setGeometry(self, QRect)¶
- AbstractMsvWidget.setGeometry(self, int, int, int, int) -> None
- setGraphicsEffect(self, QGraphicsEffect)¶
- setHidden(self, bool)¶
- setInputMethodHints(self, Union[Qt.InputMethodHints, Qt.InputMethodHint])¶
- setLayout(self, QLayout)¶
- setLayoutDirection(self, Qt.LayoutDirection)¶
- setLocale(self, QLocale)¶
- setMask(self, QBitmap)¶
- setMask(self, QRegion) None
- setMaximumHeight(self, int)¶
- AbstractMsvWidget.setMaximumSize(self, int, int)
- setMaximumSize(self, QSize) None ¶
- setMaximumWidth(self, int)¶
- setMinimumHeight(self, int)¶
- AbstractMsvWidget.setMinimumSize(self, int, int)
- setMinimumSize(self, QSize) None ¶
- setMinimumWidth(self, int)¶
- setModelWithoutSlots(model)¶
This is called when this MapperMixin is a sub-widget of a parent MapperMixin. Since the slots will all be called at the end of the parent setModel, they shouldn’t be called during the sub-widget’s setModel.
- setMouseTracking(self, bool)¶
- setObjectName(self, str)¶
- setPalette(self, QPalette)¶
- setParent(self, QWidget)¶
- setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]) None
- setProperty(self, str, Any) bool ¶
- setShortcutAutoRepeat(self, int, enabled: bool = True)¶
- setShortcutEnabled(self, int, enabled: bool = True)¶
- AbstractMsvWidget.setSizeIncrement(self, int, int)
- setSizeIncrement(self, QSize) None ¶
- setSizePolicy(self, QSizePolicy)¶
- setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) None
- setStatusTip(self, str)¶
- setStyle(self, QStyle)¶
- setStyleSheet(self, str)¶
- AbstractMsvWidget.setTabOrder(QWidget, QWidget)
- setTabletTracking(self, bool)¶
- setToolTip(self, str)¶
- setToolTipDuration(self, int)¶
- setUpdatesEnabled(self, bool)¶
- setVisible(self, bool)¶
- setWhatsThis(self, str)¶
- setWidgetLayout()¶
Set the widget layout
- setWindowFilePath(self, str)¶
- setWindowFlag(self, Qt.WindowType, on: bool = True)¶
- setWindowFlags(self, Union[Qt.WindowFlags, Qt.WindowType])¶
- setWindowFlagsForRun()¶
- setWindowIcon(self, QIcon)¶
- setWindowIconText(self, str)¶
- setWindowModality(self, Qt.WindowModality)¶
- setWindowModified(self, bool)¶
- setWindowOpacity(self, float)¶
- setWindowRole(self, str)¶
- setWindowState(self, Union[Qt.WindowStates, Qt.WindowState])¶
- setWindowTitle(self, str)¶
- setting_model()¶
- show()¶
Override the show method to clear and previous value of self.accepted
- showEvent(self, QShowEvent)¶
- showFullScreen(self)¶
- showMaximized(self)¶
- showMessageBox(*args, **kwargs)¶
Shows a popup message box. For parameter documentation see
messagebox.MessageBox
.
- showMinimized(self)¶
- showNormal(self)¶
- signalsBlocked(self) bool ¶
- size(self) QSize ¶
- sizeHint(self) QSize ¶
- sizeIncrement(self) QSize ¶
- sizePolicy(self) QSizePolicy ¶
- stackUnder(self, QWidget)¶
- startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶
- statusTip(self) str ¶
- style(self) QStyle ¶
- styleSheet(self) str ¶
- tabletEvent(self, QTabletEvent)¶
- testAttribute(self, Qt.WidgetAttribute) bool ¶
- thread(self) QThread ¶
- timerEvent(self, QTimerEvent)¶
- toolTip(self) str ¶
- toolTipDuration(self) int ¶
- tr(self, str, disambiguation: str = None, n: int = - 1) str ¶
- ui_module = None¶
- underMouse(self) bool ¶
- ungrabGesture(self, Qt.GestureType)¶
- unsetCursor(self)¶
- unsetLayoutDirection(self)¶
- unsetLocale(self)¶
- update(self)¶
- update(self, QRect) None
- update(self, QRegion) None
- AbstractMsvWidget.update(self, int, int, int, int) -> None
- updateGeometry(self)¶
- updateMicroFocus(self)¶
- updatesEnabled(self) bool ¶
- visibleRegion(self) QRegion ¶
- warning(*args, **kwargs)¶
Shows a popup warning message box. For parameter documentation see
messagebox.MessageBox
.
- whatsThis(self) str ¶
- wheelEvent(self, QWheelEvent)¶
- width(self) int ¶
- widthMM(self) int ¶
- winId(self) PyQt5.sip.voidptr ¶
- window(self) QWidget ¶
- windowFilePath(self) str ¶
- windowFlags(self) Qt.WindowFlags ¶
- windowHandle(self) QWindow ¶
- windowIcon(self) QIcon ¶
- windowIconChanged¶
windowIconChanged(self, QIcon) [signal]
- windowIconText(self) str ¶
- windowIconTextChanged¶
windowIconTextChanged(self, str) [signal]
- windowModality(self) Qt.WindowModality ¶
- windowOpacity(self) float ¶
- windowRole(self) str ¶
- windowState(self) Qt.WindowStates ¶
- windowTitle(self) str ¶
- windowTitleChanged¶
windowTitleChanged(self, str) [signal]
- windowType(self) Qt.WindowType ¶
- x(self) int ¶
- y(self) int ¶
- class schrodinger.application.msv.gui.msv_widget.ProteinAlignmentMsvWidget(parent=None, struc_model=None, *, undo_stack)[source]¶
Bases:
schrodinger.application.msv.gui.msv_widget.AbstractMsvWidget
- Variables
startBlastTaskRequested – Signal emitted to request running a blast task. The widget doesn’t start the task itself to avoid problems if the widget is deleted while the task is running.
startPredictorBlastTaskRequested – Signal emitted to request running a blast task for predictors.
proteinStructAlignResultsReady – Signal emitted when protein structure alignment results are ready. Emitted with a list of
align.AbstractStructureAligner.Result
namedtuples.
- alignmentFinished¶
- startBlastTaskRequested¶
- startPredictorBlastTaskRequested¶
- proteinStructAlignResultsReady¶
- initSetUp()[source]¶
Creates widget from
ui
and stores itui_widget
.Suggested subclass use: create and initialize subwidgets, and connect signals.
- initSetOptions()[source]¶
Suggested subclass use: set instance variables, excluding layouts and subwidgets. Also use here to (optionally) apply the legacy stylesheet spacing settings (PANEL-19101).
- defineMappings()[source]¶
Override this in the subclass to define mappings. Should return a list of tuples [(<target>, <param>)]. Targets can be:
a basic widget, like
QLineEdit
orQComboBox
a custom object that inherits
MapperMixin
orTargetMixin
a
TargetSpec
instancea slot
For common widgets, standard signals and getter/setter methods will be used, as defined in
mappers._get_default_access_names()
.For more fine-grained custom control, instantiate a
TargetSpec
object, which allows custom setters, getters, and signals to be specified.Supplying a slot as the first element of the tuple is equivalent to providing
TargetSpec(slot=my_slot)
.Note that all target slots are triggered on
setModel()
as well as in response to the specified signal.The param is an abstract param reference, e.g. MyModel.my_param.
Example:
def defineMappings(self): combo = self.style_combo return [(self.name_le, MyModel.name), (TargetSpec(combo, getter=combo.currentText, setter=combo.setCurrentText), MyModel.style), (self.coord_widget, MyModel.coord), (self._onASLTextChanged, MyModel.asl_text)]
- getSignalsAndSlots(model)[source]¶
Override this method to specify signal and slot pairs that need to be connected/disconnected whenever the model instance is switched using setModel. The model instance is provided as an argument so that instance-specific signals can be used, but any pairs of signals and slots may be returned from this method.
- Returns
a list of 2-tuples where each tuple is a signal, slot pair
- callAlignMethod(align_mode: schrodinger.infra.util.StructAlnMode)[source]¶
Call appropriate Align method based the alignment mode.
- multipleAlignment(*, _start=None, _end=None)[source]¶
Run multiple sequence alignment.
_start
and_end
are private implementation params and not part of the public API (will be ignored if passed)
- optimizeAlignment(target_seq, template_seq, ligand_asl=None, residue_asl=None, radius=None)[source]¶
- updateWorkspaceSelection()[source]¶
Apply residue selection from this widget to the Maestro workspace. This will remove residue selection for any workspace entries without a linked sequence and will update residue selection for any entries awaiting delayed sync. (Residue selection is not automatically synchronized for newly included entries until selection is changed in either the workspace or the MSV. This method will force that synchronization.)
- pairwiseAlignment(*, _start=None, _end=None)[source]¶
Run pairwise sequence alignment using modified Needleman-Wunsch algorithm.
If residues are anchored, pairwise alignment with locked reference gaps will be performed instead. If no sequences are selected, the first non-reference sequence will be aligned to the reference sequence. If one or more sequences are selected, each selected non-reference sequence will be aligned to the reference sequence.
_start
and_end
are private implementation params and not part of the public API (will be ignored if passed)
- mergedPairwiseAlignment(*, _start=None, _end=None)[source]¶
Runs a pairwise alignment while preserving reference gaps.
_start
and_end
are private implementation params and not part of the public API (will be ignored if passed)
- alignBySuperposition()[source]¶
Align sequences by structure superposition.
The pairwise residue C-alpha distances are converted to a scoring matrix where a short distance is a high score and vice versa.
- alignByResidueNumbers(*, _start=None, _end=None)[source]¶
Align by residue numbers.
_start
and_end
are private implementation params and not part of the public API (will be ignored if passed)
- superimposeStructures(show_panel=True)[source]¶
Superimposes the workspace structures according to their sequence alignment in the MSV.
- Parameters
show_panel (bool) – Whether to show the superimpose ASL panel
- hasBlastResults(for_ref_seq=False)[source]¶
Return whether the blast task is done.
- Parameters
for_ref_seq – Whether to require that the results are for the current reference seq
- movePattern(forward=True)[source]¶
Scroll view to next or previous pattern instance.
- Parameters
forward (bool) – whether to move pattern view forward
- APPLY_LEGACY_STYLESHEET = True¶
- APPLY_PANELX_STYLESHEET = False¶
- DrawChildren = 2¶
- DrawWindowBackground = 1¶
- IgnoreMask = 4¶
- class PaintDeviceMetric¶
Bases:
int
- PdmDepth = 6¶
- PdmDevicePixelRatio = 11¶
- PdmDevicePixelRatioScaled = 12¶
- PdmDpiX = 7¶
- PdmDpiY = 8¶
- PdmHeight = 2¶
- PdmHeightMM = 4¶
- PdmNumColors = 5¶
- PdmPhysicalDpiX = 9¶
- PdmPhysicalDpiY = 10¶
- PdmWidth = 1¶
- PdmWidthMM = 3¶
- class RenderFlag¶
Bases:
int
- class RenderFlags¶
- class RenderFlags(Union[QWidget.RenderFlags, QWidget.RenderFlag]) None
- class RenderFlags(QWidget.RenderFlags) None
Bases:
sip.simplewrapper
- __init__(*args, **kwargs)¶
- SHOW_AS_WINDOW = False¶
- __init__(parent=None, struc_model=None, *, undo_stack)¶
- Parameters
parent (QtWidgets.QWidget) – The Qt parent
struc_model (structure_model.StructureModel) – The structure model to use when interacting with sequences associated with three-dimensional structures. If None, a new structure model will be created.
undo_stack (schrodinger.application.msv.command.UndoStack) – The undo stack to use.
- acceptDrops(self) bool ¶
- property accepted¶
- accessibleDescription(self) str ¶
- accessibleName(self) str ¶
- actionEvent(self, QActionEvent)¶
- actions(self) List[QAction] ¶
- activateWindow(self)¶
- addAction(self, QAction)¶
- addActions(self, Iterable[QAction])¶
- adjustSize(self)¶
- anchorSelection()¶
Anchors all unanchored residues in the selection
- applyColorScheme(scheme)¶
Set the sequence row color scheme.
- Parameters
scheme – The color scheme to be applied.
- Type
- applyColorsToWorkspace(all_atoms=False)¶
Update the colors in the workspace with colors from the MSV.
- Parameters
all_atoms (bool) – Whether to color all atoms or just carbons
- autoFillBackground(self) bool ¶
- backgroundRole(self) QPalette.ColorRole ¶
- baseSize(self) QSize ¶
- blastSelectedSeq()¶
Set selected sequence as reference sequence and open BLAST search dialog.
- blockSignals(self, bool) bool ¶
- changeEvent(self, QEvent)¶
- changeResidues()¶
- childAt(self, QPoint) QWidget ¶
- ProteinAlignmentMsvWidget.childAt(self, int, int) -> QWidget
- childEvent(self, QChildEvent)¶
- children(self) List[QObject] ¶
- childrenRect(self) QRect ¶
- childrenRegion(self) QRegion ¶
- clearAllHighlights()¶
- clearAnchored()¶
Removes anchors from all anchored residues in the selection
- clearAnnotations()¶
Hide all selected annotations. Does not affect predicted annotations.
- clearConstraints()¶
- clearFocus(self)¶
- clearMask(self)¶
- close(self) bool ¶
- closeEvent(event)¶
Ensures proper handling of OK, Cancel, and [X] button clicks
- colorCount(self) int ¶
- connectNotify(self, QMetaMethod)¶
- contentsMargins(self) QMargins ¶
- contentsRect(self) QRect ¶
- contextMenuEvent(self, QContextMenuEvent)¶
- contextMenuPolicy(self) Qt.ContextMenuPolicy ¶
- copySelectedSeqs()¶
Returns a dictionary of new copies of each selected sequence mapped to the sequence it was copied from.
- Returns
Dictionary of new sequence copies mapped to their source sequence
- Return type
dict
- copySelection()¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- createWindowContainer(QWindow, parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = 0) QWidget ¶
- cursor(self) QCursor ¶
- customContextMenuRequested¶
customContextMenuRequested(self, QPoint) [signal]
- customEvent(self, QEvent)¶
- debug()¶
- deleteAllPredictions()¶
- deleteAnnsFromAll()¶
Delete selected annotations from all sequences.
- deleteGapOnlyColumns()¶
Delete all columns in the alignment comprised of only gaps
- deleteLater(self)¶
- deleteRedundantSeqs()¶
Show the dialog for defining and removing redundant sequences
- deleteSelectedGaps()¶
- deleteSelection()¶
- depth(self) int ¶
- deselectAllResidues()¶
Deselects all residues
- deselectAllSequences()¶
Deselect all sequences
- deselectGaps()¶
- deselectResForSeqs()¶
Clears the selection of residues for the selected sequences.
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- destroyed¶
destroyed(self, object: QObject = None) [signal]
- devType(self) int ¶
- devicePixelRatio(self) int ¶
- devicePixelRatioF(self) float ¶
- devicePixelRatioFScale() float ¶
- disconnect(QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- duplicateAsRef()¶
Duplicate selected sequence and make reference seq
- duplicateAtBottom()¶
Duplicate selected sequences and add at bottom
- duplicateAtTop()¶
Duplicate selected sequences and add at top
- duplicateInPlace()¶
Duplicate selected sequences and add in place
- duplicateIntoNewTabRequested¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- editToolbarUpdateRequested¶
- effectiveWinId(self) PyQt5.sip.voidptr ¶
- enableFindSequence()¶
Enable sequence filtering on the model
- ensurePolished(self)¶
- enterEvent(self, QEvent)¶
- error(*args, **kwargs)¶
Shows a popup error message box. For parameter documentation see
messagebox.MessageBox
.
- event(self, QEvent) bool ¶
- eventFilter(self, QObject, QEvent) bool ¶
- expandSelectionAlongCols()¶
Expand selection based on current residue selection to include all residues in their columns.
- expandSelectionReferenceOnly()¶
Select column residues for all columns that have a non-gap reference
- find(PyQt5.sip.voidptr) QWidget ¶
- 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]
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPolicy(self) Qt.FocusPolicy ¶
- focusPreviousChild(self) bool ¶
- focusProxy(self) QWidget ¶
- focusWidget(self) QWidget ¶
- font(self) QFont ¶
- fontInfo(self) QFontInfo ¶
- fontMetrics(self) QFontMetrics ¶
- foregroundRole(self) QPalette.ColorRole ¶
- forgetMessageBoxResponse(key)¶
Forgets any previously saved response that was stored via a save_response_key.
- Parameters
key – the key for the response to forget
- frameGeometry(self) QRect ¶
- frameSize(self) QSize ¶
- generateAllPredictions()¶
- generatePfam()¶
- generatePredictionAnnotation(anno)¶
Generate predictions for the given prediction annotation.
anno
should be a key inPRED_ANNO_TO_PRED_FUNC
.
- geometry(self) QRect ¶
- getAlignment()¶
Returns the widget’s alignment instance
- Return type
- Returns
The widget’s alignment
- getColorScheme()¶
- getContentsMargins(self) Tuple[int, int, int, int] ¶
- getLogoView()¶
Return an alignment view which contains the rulers and sequence logo.
- Returns
the logo view
- Return type
- getModel()¶
- getReferenceSeq()¶
Helper function that returns the reference sequence.
- Returns
reference sequence of the underlying alignment
- Return type
Sequence
- getSelectedSequences()¶
Return a list of the currently selected sequences in the order they appear in the alignment
- Returns
list of selected sequences
- Return type
list of
sequence.Sequence
- getShownRowTypes()¶
Returns a list of enums representing the shown row types
- Return type
list
- Returns
A list of enums
- getShownSplitSequences()¶
Return the currently shown single-chain sequences in the order they appear in the alignment
- Return type
tuple
- getValidIdMap()¶
Get the valid id map for the currently selected sequences.
- Returns
Map of valid PDB IDs to their source sequence
- Return type
dict(str: sequence.Sequence)
- grab(self, rectangle: QRect = QRect(QPoint(0, 0), QSize(- 1, - 1))) QPixmap ¶
- grabGesture(self, Qt.GestureType, flags: Union[Qt.GestureFlags, Qt.GestureFlag] = Qt.GestureFlags())¶
- grabKeyboard(self)¶
- grabMouse(self)¶
- grabMouse(self, Union[QCursor, Qt.CursorShape]) None
- grabShortcut(self, Union[QKeySequence, QKeySequence.StandardKey, str, int], context: Qt.ShortcutContext = Qt.WindowShortcut) int ¶
- graphicsEffect(self) QGraphicsEffect ¶
- graphicsProxyWidget(self) QGraphicsProxyWidget ¶
- groupedByType()¶
Indicates whether rows are grouped by type
- Return type
bool
- Returns
Whether the rows are currently grouped by type
- hasFocus(self) bool ¶
- hasHeightForWidth(self) bool ¶
- hasMouseTracking(self) bool ¶
- hasTabletTracking(self) bool ¶
- height(self) int ¶
- heightForWidth(self, int) int ¶
- heightMM(self) int ¶
- hide(self)¶
- hideEvent(self, QHideEvent)¶
- hideSelectedSeqs()¶
- property image_export_dialog¶
Delay instantiation of the image export dialog until it is needed to prevent unnecessary file handles from being opened
- Returns
the image export dialog
- Return type
dialogs.MSVImageExportDialog
- importIncluded(replace_selection=True)¶
Import all sequences that are included in the Maestro workspace.
- importSelected()¶
Import all sequences that are selected in the Maestro project table.
- importSeq(seq, index=None)¶
Adds a given sequence to the widget’s alignment and align if the widget already had one or more sequences
- Parameters
seq (schrodinger.protein.sequence.ProteinSequence) – The sequence to add
index (int or None) – Index to import the seq at
- importSeqs(seqs, index=None, replace_selection=True)¶
Add sequences to the widget’s alignment and align if the widget already had one or more sequences.
Warning
Avoid calling this method from unittests as it adds a maestro test-time dependency
- Parameters
seqs (iterable(schrodinger.protein.sequence.ProteinSequence)) – Sequences to add
index (int or None) – Index to import the seqs at (must be 1 or greater)
- info(*args, **kwargs)¶
Shows a popup information message box. For parameter documentation see
messagebox.MessageBox
.
- inherits(self, str) bool ¶
- initFinalize()¶
Suggested subclass use: perform any remaining initialization.
- initLayOut()¶
@overrides: widgetmixins.InitMixin
- initPainter(self, QPainter)¶
- initSetDefaults()¶
@overrides: widgetmixins.InitMixin
- inputMethodEvent(self, QInputMethodEvent)¶
- inputMethodHints(self) Qt.InputMethodHints ¶
- inputMethodQuery(self, Qt.InputMethodQuery) Any ¶
- ProteinAlignmentMsvWidget.insertAction(self, QAction, QAction)
- insertActions(self, QAction, Iterable[QAction])¶
- insertGapsToLeftOfSelection()¶
- insertResidues()¶
- installEventFilter(self, QObject)¶
- invertResSelection()¶
Invert the selection
- invertSequenceSelection()¶
Invert sequence selection.
- isActiveWindow(self) bool ¶
- isAncestorOf(self, QWidget) bool ¶
- isEnabled(self) bool ¶
- isEnabledTo(self, QWidget) bool ¶
- isFullScreen(self) bool ¶
- isHidden(self) bool ¶
- isLeftToRight(self) bool ¶
- isMaximized(self) bool ¶
- isMinimized(self) bool ¶
- isModal(self) bool ¶
- isRightToLeft(self) bool ¶
- isSignalConnected(self, QMetaMethod) bool ¶
- isVisible(self) bool ¶
- isVisibleTo(self, QWidget) bool ¶
- isWidgetType(self) bool ¶
- isWindow(self) bool ¶
- isWindowModified(self) bool ¶
- isWindowType(self) bool ¶
- isWorkspace()¶
- Returns
Whether this widget contains an alignment that is always kept in sync with the Maestro workspace.
- Return type
bool
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- keyboardGrabber() QWidget ¶
- killTimer(self, int)¶
- layout(self) QLayout ¶
- layoutDirection(self) Qt.LayoutDirection ¶
- leaveEvent(self, QEvent)¶
- loadPdbs(pdb_paths, index=None)¶
Loads a pdb file into the widget. This will load the PDB into the workspace for all widgets. (See comments on MSV-1326.) If an index is specified, sequences will be loaded at that index. Index cannot be specified for Workspace tab.
- Parameters
pdb_path (str) – Path to the pdb file
index (int or None) – Index to insert the sequences at. Cannot be specified for Workspace widget.
- Raise
ValueError if index is specified for Workspace widget.
- locale(self) QLocale ¶
- logicalDpiX(self) int ¶
- logicalDpiY(self) int ¶
- lower(self)¶
- makeInitialModel()¶
- mapFrom(self, QWidget, QPoint) QPoint ¶
- mapFromGlobal(self, QPoint) QPoint ¶
- mapFromParent(self, QPoint) QPoint ¶
- mapTo(self, QWidget, QPoint) QPoint ¶
- mapToGlobal(self, QPoint) QPoint ¶
- mapToParent(self, QPoint) QPoint ¶
- mappedParams()¶
Return a list of the abstract params that are mapped to.
- mask(self) QRegion ¶
- maximumHeight(self) int ¶
- maximumSize(self) QSize ¶
- maximumWidth(self) int ¶
- metaObject(self) QMetaObject ¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- minimumHeight(self) int ¶
- minimumSize(self) QSize ¶
- minimumSizeHint(self) QSize ¶
- minimumWidth(self) int ¶
- property model¶
- model_class¶
alias of
schrodinger.application.msv.gui.gui_models.PageModel
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseGrabber() QWidget ¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- move(self, QPoint)¶
- ProteinAlignmentMsvWidget.move(self, int, int) -> None
- moveEvent(self, QMoveEvent)¶
- classmethod moveItems(all_items, sel_items, direction)¶
Move the specified items in the specified direction.
- Parameters
all_items (list) – List of unique items.
sel_items (list) – Items to move; must be a subset of
all_items
.direction (viewconstants.Direction) – Direction to move items.
- Returns
Reordered items
- Return type
list
- Raises
ValueError – Invalid value of
direction
orsel_items
is not a subset ofall_items
.
- moveSelectedSequences(direction)¶
Move the currently selected sequences in the specified direction.
Will prompt the user if there are hidden seqs and the direction is Up or Down.
- Parameters
direction (viewconstants.Direction) – Direction to move items.
- Raises
ValueError – Invalid value of
direction
.IndexError –
seq_list
is not a subset of self.
- moveToThread(self, QThread)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int] ¶
- nativeParentWidget(self) QWidget ¶
- nextInFocusChain(self) QWidget ¶
- normalGeometry(self) QRect ¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, str) [signal]
- onVScrollBarRangeChanged(_, max_)¶
When the vertical scrollbar is disabled, (i.e. the min and max are 0) style it to be mostly invisible.
- onWorkspaceColorsChanged()¶
- openColorPanelRequested¶
- openPropertyDialog()¶
Show the dialog that controls which properties are shown in the alignment metrics view
- property options_model¶
- overrideWindowFlags(self, Union[Qt.WindowFlags, Qt.WindowType])¶
- overrideWindowState(self, Union[Qt.WindowStates, Qt.WindowState])¶
- paintEngine(self) QPaintEngine ¶
- paintEvent(self, QPaintEvent)¶
- paintingActive(self) bool ¶
- palette(self) QPalette ¶
- parent(self) QObject ¶
- parentWidget(self) QWidget ¶
- physicalDpiX(self) int ¶
- physicalDpiY(self) int ¶
- pos(self) QPoint ¶
- previousInFocusChain(self) QWidget ¶
- profileScrolling()¶
Scroll the alignment while recording profiling data. Returns immediately.
- profileScrollingBlocking(only_horizontal=False, print_to_stdout=True, filename=None)¶
Scroll the alignment while recording profiling data. Returns when scrolling is complete.
- Parameters
only_horizontal (bool) – If True, the alignment will only be scrolled horizontally. If False, the alignment will be scrolled both vertically and horizontally.
print_to_stdout (bool) – Whether to print the filename, the measured time, and a message when scrolling is starting and ending.
filename (str or None) – The file to save profiling data to. If not given, a filename will be generated using the current date and time.
- Returns
The time (in seconds) to scroll the alignment.
- Return type
float
- profileScrollingByPage()¶
Scroll the alignment while recording profiling data. Scrolling is only done downwards and rightwards so that no cached data is used.
- property(self, str) Any ¶
- pullWorkspaceColors()¶
Update the current color scheme with colors from the workspace. This does not modify the options model.
- 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.
- question(*args, **kwargs)¶
Shows a popup question message box. For parameter documentation see
messagebox.QuestionMessageBox
.
- raise_(self)¶
- receivers(self, PYQT_SIGNAL) int ¶
- rect(self) QRect ¶
- redo()¶
Call redo on the undo stack
- releaseKeyboard(self)¶
- releaseMouse(self)¶
- releaseShortcut(self, int)¶
- removeAction(self, QAction)¶
- removeEventFilter(self, QObject)¶
- removeSelectedSeqs()¶
Remove the currently selected sequences from the alignment.
- removeSequences(seqs)¶
Remove the specified sequences. Displays the new reference sequence in case it is hidden.
- Parameters
seqs (list(sequence.Sequence)) – List of sequences to be removed
- renameSequenceRequested¶
- render(self, QPaintDevice, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren))¶
- render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren)) None
- repaint(self)¶
- ProteinAlignmentMsvWidget.repaint(self, int, int, int, int) -> None
- repaint(self, QRect) None
- repaint(self, QRegion) None
- replaceSelection()¶
- replaceSelectionWithGaps()¶
- reportValidation(results)¶
Present validation messages to the user. This is an implmentation of the
ValidationMixin
interface and does not need to be called directly.This method assumes that
error
andquestion
methods have been defined in the subclass, as in e.g.widget_mixins.MessageBoxMixin
.- Parameters
results (
validation.ValidationResults
) – Set of validation results generated byvalidate
- Returns
if True, there were no validation errors and the user decided to continue despite any warnings. If False, there was at least one validation error or the user decided to abort when faced with a warning.
- resHighlightStatusChanged¶
- resetMappedParams()¶
- resetPick(pick_mode)¶
Set the default pick for the specified pick mode
- resetUndoStack()¶
Reset the undo stack
This needs to be called when we perform an operation that gets tangled up with Maestro’s single step undo, so that permitting an undo from msv would result in data corruption.
- residueHovered¶
- residueUnhovered¶
- resize(self, QSize)¶
- ProteinAlignmentMsvWidget.resize(self, int, int) -> None
- resizeEvent(self, QResizeEvent)¶
- restoreGeometry(self, Union[QByteArray, bytes, bytearray]) bool ¶
- rowWrap()¶
Indicates whether rows are currently wrapped
- Return type
bool
- Returns
Whether the rows are currently wrapped
- run(blocking=False, modal=False, finished_callback=None)¶
Show this widget, while optionally blocking, making the widget window modal, and registering a callback for when the widget is closed again.
- Parameters
blocking (bool) – if True, block progress in the calling method until the widget is closed again.
modal (bool) – if True, open this widget as window modal. Otherwise, open this widget as nonmodal.
finished_callback (a callable object) – an object that will be called with no arguments when this widget is closed.
- runAllSlots()¶
- runValidation(silent=False, validate_children=True, stop_on_fail=True)¶
Runs validation and reports the results (unless run silently).
- Parameters
silent (bool) – run without any reporting (i.e. error messages to the user). This is useful if we want to programmatically test validity. Changes return value of this method from
ValidationResults
to a boolean.validate_children (bool) – run validation on all child objects. See
_validateChildren
for documentation on what this entails.stop_on_fail (bool) – stop validation when first failure is encountered
- Returns
if silent is False, returns the validation results. If silent is True, returns a boolean generated by
reportValidation
.- Return type
ValidationResults
or bool
- saveGeometry(self) QByteArray ¶
- saveImage()¶
Saves multiple sequence alignment as an image file, by default, exports image of the entire alignment.
- ProteinAlignmentMsvWidget.scroll(self, int, int)
- ProteinAlignmentMsvWidget.scroll(self, int, int, QRect) -> None
- selectAlignedResidues()¶
Selects residues in columns containing no gaps.
- selectAllResidues()¶
Selects all residues
- selectAllSequences()¶
Select all sequences
- selectAntibodyCDR()¶
Select residues with Antibody CDR.
- selectAntibodyHeavyChain()¶
- selectAntibodyLightChain()¶
- selectBindingSites()¶
Select residues with binding site contacts.
- selectColsWithStructure()¶
Select all columns that contain only structured residues.
- selectIdentityColumns()¶
Select the residues in the identity columns of the alignment
- selectProteinInterface()¶
Select the protein interface.
- selectResForSeqs()¶
Select all residues in the alignment for the selected sequences
- selectResiduesWithStructure()¶
Selects all residues with structure
- selectSequenceByIdentity()¶
Open a dialog to select sequences by identity.
- selectSequencesWithStructure()¶
Select all sequences with structures.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- property seq_export_dialog¶
Delay instantiation of the image export dialog until it is needed to prevent unnecessary file handles from being opened
- Returns
the image export dialog
- Return type
dialogs.MSVSequenceExportDialog
- setAcceptDrops(self, bool)¶
- setAccessibleDescription(self, str)¶
- setAccessibleName(self, str)¶
- setAttribute(self, Qt.WidgetAttribute, on: bool = True)¶
- setAutoFillBackground(self, bool)¶
- setBackgroundRole(self, QPalette.ColorRole)¶
- ProteinAlignmentMsvWidget.setBaseSize(self, int, int)
- setBaseSize(self, QSize) None ¶
- ProteinAlignmentMsvWidget.setContentsMargins(self, int, int, int, int)
- setContentsMargins(self, QMargins) None ¶
- setContextMenuPolicy(self, Qt.ContextMenuPolicy)¶
- setCursor(self, Union[QCursor, Qt.CursorShape])¶
- setDefaults()¶
@overrides: af2.App
- setDisabled(self, bool)¶
- setEditMode(enable)¶
Enable or disable edit mode.
- Parameters
enable (bool) – Whether to enable edit mode.
- setEnabled(self, bool)¶
- setFixedHeight(self, int)¶
- setFixedSize(self, QSize)¶
- ProteinAlignmentMsvWidget.setFixedSize(self, int, int) -> None
- setFixedWidth(self, int)¶
- setFocus(self)¶
- setFocus(self, Qt.FocusReason) None
- setFocusPolicy(self, Qt.FocusPolicy)¶
- setFocusProxy(self, QWidget)¶
- setFont(self, QFont)¶
- setForegroundRole(self, QPalette.ColorRole)¶
- setGeometry(self, QRect)¶
- ProteinAlignmentMsvWidget.setGeometry(self, int, int, int, int) -> None
- setGraphicsEffect(self, QGraphicsEffect)¶
- setHidden(self, bool)¶
- setInputMethodHints(self, Union[Qt.InputMethodHints, Qt.InputMethodHint])¶
- setLayout(self, QLayout)¶
- setLayoutDirection(self, Qt.LayoutDirection)¶
- setLightMode(enable)¶
Enable or disable lightmode on the widget’s views and model
- setLocale(self, QLocale)¶
- setMask(self, QBitmap)¶
- setMask(self, QRegion) None
- setMaximumHeight(self, int)¶
- ProteinAlignmentMsvWidget.setMaximumSize(self, int, int)
- setMaximumSize(self, QSize) None ¶
- setMaximumWidth(self, int)¶
- setMinimumHeight(self, int)¶
- ProteinAlignmentMsvWidget.setMinimumSize(self, int, int)
- setMinimumSize(self, QSize) None ¶
- setMinimumWidth(self, int)¶
- setModel(model)¶
Sets the model object for the mapper. Disconnects the old model, if one is set, and connects the new model. Pass in None to have no model set.
- Parameters
model – the model instance or None
- setModelWithoutSlots(model)¶
This is called when this MapperMixin is a sub-widget of a parent MapperMixin. Since the slots will all be called at the end of the parent setModel, they shouldn’t be called during the sub-widget’s setModel.
- setMouseTracking(self, bool)¶
- setObjectName(self, str)¶
- setPalette(self, QPalette)¶
- setParent(self, QWidget)¶
- setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]) None
- setProperty(self, str, Any) bool ¶
- setSelectedResColor(color)¶
Set the highlight color of the selected residues and enable colors
- setSelectedSeqAsReference()¶
Set the selected sequence as the reference sequence. If more than one sequence is selected, no reference sequence will be set. Restore the expanded state of each sequence afterwards, because it will be reset after the reordering of the rows.
- setSelectedSequences(seqs)¶
Set sequence selection to the specified sequences.
- Parameters
seqs (list of
schrodinger.protein.sequence.Sequence
) – List of sequences to select
- setSequenceExpansionState(sequences=None, expand=True)¶
Set the expansion state for the given (or all shown) sequences.
- Parameters
sequences (list(Sequence)) – Sequences to expand or collapse. If None, use all shown sequences.
expand (bool) – Whether to expand the sequences
- setShortcutAutoRepeat(self, int, enabled: bool = True)¶
- setShortcutEnabled(self, int, enabled: bool = True)¶
- ProteinAlignmentMsvWidget.setSizeIncrement(self, int, int)
- setSizeIncrement(self, QSize) None ¶
- setSizePolicy(self, QSizePolicy)¶
- setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) None
- setStatusTip(self, str)¶
- setStructureModel(model=None)¶
- setStyle(self, QStyle)¶
- setStyleSheet(self, str)¶
- ProteinAlignmentMsvWidget.setTabOrder(QWidget, QWidget)
- setTabletTracking(self, bool)¶
- setToolTip(self, str)¶
- setToolTipDuration(self, int)¶
- setUpdatesEnabled(self, bool)¶
- setVisible(self, bool)¶
- setWhatsThis(self, str)¶
- setWidgetLayout()¶
Set the widget layout
- setWindowFilePath(self, str)¶
- setWindowFlag(self, Qt.WindowType, on: bool = True)¶
- setWindowFlags(self, Union[Qt.WindowFlags, Qt.WindowType])¶
- setWindowFlagsForRun()¶
- setWindowIcon(self, QIcon)¶
- setWindowIconText(self, str)¶
- setWindowModality(self, Qt.WindowModality)¶
- setWindowModified(self, bool)¶
- setWindowOpacity(self, float)¶
- setWindowRole(self, str)¶
- setWindowState(self, Union[Qt.WindowStates, Qt.WindowState])¶
- setWindowTitle(self, str)¶
- setting_model()¶
- show()¶
Override the show method to clear and previous value of self.accepted
- showAllSeqs()¶
- showColorSchemeEditor()¶
- showEvent(self, QShowEvent)¶
- showFullScreen(self)¶
- showMaximized(self)¶
- showMessageBox(*args, **kwargs)¶
Shows a popup message box. For parameter documentation see
messagebox.MessageBox
.
- showMinimized(self)¶
- showNormal(self)¶
- showWorkspaceSequences()¶
- signalsBlocked(self) bool ¶
- size(self) QSize ¶
- sizeHint(self) QSize ¶
- sizeIncrement(self) QSize ¶
- sizePolicy(self) QSizePolicy ¶
- sortBy(sort_by, reverse=False)¶
Sort the alignment by the specified criteria.
- Parameters
sort_by (viewconstants.SortTypes) – The criterion to sort on
reverse – Whether to sort in reverse (descending) order.
- stackUnder(self, QWidget)¶
- startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt5.QtCore.QMetaObject object>¶
- statusTip(self) str ¶
- style(self) QStyle ¶
- styleSheet(self) str ¶
- tabletEvent(self, QTabletEvent)¶
- taskStarted¶
- testAttribute(self, Qt.WidgetAttribute) bool ¶
- thread(self) QThread ¶
- timeScrolling(only_horizontal=False, print_to_stdout=True)¶
Scroll the alignment and print how long it takes to the terminal.
- Parameters
only_horizontal (bool) – If True, the alignment will only be scrolled horizontally. If False, the alignment will be scrolled both vertically and horizontally.
print_to_stdout (bool) – Whether to print a message when scrolling is starting and ending.
- Returns
The time (in seconds) to scroll the alignment.
- Return type
float
- timeScrollingByPage()¶
Scroll the alignment and print how long it takes to the terminal. Scrolling is only done downwards and rightwards so that no cached data is used.
- timerEvent(self, QTimerEvent)¶
- toolTip(self) str ¶
- toolTipDuration(self) int ¶
- tr(self, str, disambiguation: str = None, n: int = - 1) str ¶
- translateIntoNewTabRequested¶
- translateSelectedSequences()¶
Translate the selected nucleic acid sequences
- translateSeqsInPlace(seqs)¶
Translate the given sequences in place.
- Parameters
seqs (iterable[sequence.NucleicAcidSequence]) – The sequencs to translate
- ui_module = None¶
- underMouse(self) bool ¶
- undo()¶
Call undo on the undo stack
- ungrabGesture(self, Qt.GestureType)¶
- unsetCursor(self)¶
- unsetLayoutDirection(self)¶
- unsetLocale(self)¶
- update(self)¶
- update(self, QRect) None
- update(self, QRegion) None
- ProteinAlignmentMsvWidget.update(self, int, int, int, int) -> None
- updateAlignSelectedSeqsEnabled()¶
- updateAnchorSelectionEnabled()¶
- updateCanUnlinkSequences()¶
- updateColorsEnabled()¶
Set whether to color all sequences from the options model
- updateDeleteSequencesEnabled()¶
- updateDuplicateSeqOptionsEnabled()¶
- updateExpandEnabled()¶
- updateGeometry(self)¶
- updateGetStructureLinkSeq()¶
Update if getting the structure from PDB action is enabled in the view.
- updateHideColumnsEnabled()¶
- updateMicroFocus(self)¶
- updateMoveSequencesEnabled()¶
- updateRemoveHighlightsEnabled()¶
- updateRenameSeqEnabled()¶
- updateRowWrap()¶
Set the row wrapping on the widget
- updateSelectMenuEnabled()¶
- updateSelectProteinInterfaceMenuEnabled()¶
- updateSeqColorScheme()¶
Set the sequence color scheme from the options model.
- updateSetAsRefEnabled()¶
Enable/disable the menu model for Set As Reference Sequence
- updatesEnabled(self) bool ¶
- visibleRegion(self) QRegion ¶
- warning(*args, **kwargs)¶
Shows a popup warning message box. For parameter documentation see
messagebox.MessageBox
.
- whatsThis(self) str ¶
- wheelEvent(self, QWheelEvent)¶
- width(self) int ¶
- widthMM(self) int ¶
- winId(self) PyQt5.sip.voidptr ¶
- window(self) QWidget ¶
- windowFilePath(self) str ¶
- windowFlags(self) Qt.WindowFlags ¶
- windowHandle(self) QWindow ¶
- windowIcon(self) QIcon ¶
- windowIconChanged¶
windowIconChanged(self, QIcon) [signal]
- windowIconText(self) str ¶
- windowIconTextChanged¶
windowIconTextChanged(self, str) [signal]
- windowModality(self) Qt.WindowModality ¶
- windowOpacity(self) float ¶
- windowRole(self) str ¶
- windowState(self) Qt.WindowStates ¶
- windowTitle(self) str ¶
- windowTitleChanged¶
windowTitleChanged(self, str) [signal]
- windowType(self) Qt.WindowType ¶
- x(self) int ¶
- y(self) int ¶
- schrodinger.application.msv.gui.msv_widget.check_if_can_retry_blast(dialog_parent, task, blast_local_only)[source]¶
For a failed BLAST task, show the appropriate dialog.
If the task was run remote, show “Remote BLAST failed” error
If tasks can only run locally, show “Local BLAST failed error”
If the task was run locally, ask whether to try Remote BLAST
- Returns
Whether the task should be retried remote
- Return type
bool
- schrodinger.application.msv.gui.msv_widget.get_svg_renderer(widget)[source]¶
Get a renderer that can paint a widget by means of svg onto a paint devices. This effectively vectorizes the image, allowing for very high resolutions to be used when drawing on the paint device.
- Parameters
widget (QtWidgets.QWidget) – a widget that can be converted into an svg. This needs a render method
- Returns
the svg renderer
- Return type
QtSvg.QSvgRenderer
- schrodinger.application.msv.gui.msv_widget.save_pdf(renderer, file_name)[source]¶
Draw an image from the renderer to the given file name as a pdf
- Parameters
renderer (QtSvg.QSvgRenderer) – the renderer that will draw the image
file_name (str) – the name of the file to write to
- schrodinger.application.msv.gui.msv_widget.save_png(renderer, file_name, dpi)[source]¶
Draw an image from the renderer to the given file name as a png
- Parameters
renderer (QtSvg.QSvgRenderer) – the renderer that will draw the image
file_name (str) – the name of the file to write to
dpi (int) – how many dpi to export to PNG