schrodinger.application.msv.gui.validate_align module¶
Helper methods for running align commands from the GUI
- schrodinger.application.msv.gui.validate_align.alignment_precheck(aln)[source]¶
Returns whether we have at least one sequence with at least one residue
- Return type
bool
- Returns
Whether we can align
- exception schrodinger.application.msv.gui.validate_align.UserCanceledException[source]¶
Bases:
Exception
An exception raised when the user cancels the alignment in response to a message box.
- __init__(*args, **kwargs)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- schrodinger.application.msv.gui.validate_align.partial_seq_selection(aln, *, ref_seq=None)[source]¶
Return whether some but not all non-reference seqs are selected :type aln: gui_alignment.GuiProteinAlignment :type ref_seq: sequence.ProteinSequence :rtype: bool
- schrodinger.application.msv.gui.validate_align.get_contiguous_columns(aln)[source]¶
Get reference residues marking contiguous columns with any residue selected :type aln: gui_alignment.GuiProteinAlignment
- schrodinger.application.msv.gui.validate_align.get_contiguous_multi_columns(aln)[source]¶
Get reference residues marking blocks of at least 2 contiguous columns with any res selected :type aln: gui_alignment.GuiProteinAlignment
- schrodinger.application.msv.gui.validate_align.all_sel_multi_cols_anchored(aln)[source]¶
Return whether all blocks of multiple columns with any res selected are anchored :type aln: gui_alignment.GuiProteinAlignment :rtype: bool
- schrodinger.application.msv.gui.validate_align.sel_multi_cols_left_of_anchors(aln)[source]¶
Return whether any blocks of multiple selected columns are anchored or left of anchors :type aln: gui_alignment.GuiProteinAlignment :rtype: bool
- schrodinger.application.msv.gui.validate_align.validate_aln_sets(aln, *, aln_sets=None, loose_seqs=None)[source]¶
- Returns
Whether aln sets prevent aligning and an error message
- Return type
tuple(bool, str)
- schrodinger.application.msv.gui.validate_align.get_aln_set_align_mode(aln, *, aln_sets=None, loose_seqs=None)[source]¶
- Returns
The SeqAlnMode to align the Aln Sets or whether aligning can proceed if the Aln Sets are invalid
- Return type
SeqAlnMode or bool
- schrodinger.application.msv.gui.validate_align.get_aln_sets_and_seqs_to_align(aln)[source]¶
Find the Alignment Sets that will be aligned and any loose sequences that need to be aligned to the Alignment Sets.
- Returns
A list of Alignment Sets and a list of loose sequences to align to the Alignment Sets
- Return type
tuple(list, list)
- schrodinger.application.msv.gui.validate_align.get_residue_map_to_superimpose(aln, seqs_to_align, selected_only=False)[source]¶
Create a map of aligned residues to superimpose.
Residues are considered aligned if they are structured and in a gapless column.
- Parameters
selected_only – Whether to only use aligned residues that are in columns with at least one residue selected.
- Returns
Map of residues keyed by entry ID
- Return type
dict(int, list[protein.residue.Residue])
- schrodinger.application.msv.gui.validate_align.align_command(undo_desc, pairwise=False, structure=False, split_by_anchors=False, split_res_blocks=True, can_align_sets=False, superimpose_param=None)[source]¶
Decorator for methods that align the alignment.
Within the decorated function, non-selected sequences will be removed from the alignment.
The method’s class must define
getAlignment()
,undo_stack
, andwarning()
.If the decorated method raises
CantAlignException
, this will show a warning and roll back the undo stack.Example usage:
@align_method(undo_desc="Pairwise alignment", pairwise=True) def runPairwiseAlignment(self):
- Parameters
undo_desc (str) – Name for the compressed undo command
pairwise (bool) – Whether the method is a pairwise aligner
structure (bool) – Whether the aligner requires structures
split_by_anchors (bool) – Whether the aligner needs to split the alignment by anchored columns and align blocks between anchors
split_res_blocks (bool) – Whether the aligner needs to split the alignment into selected residue blocks and align only them
can_align_sets (bool) – Whether the aligner can align Alignment Sets
superimpose_param (parameters.Param or NoneType) – Abstract param for the setting of whether the structures should be superimposed after alignment. Must start with gui_models.AlignSettingsModel.