Package schrodinger :: Package application :: Package msv :: Package gui :: Module undoable_alignment :: Class ProteinAlignment
[hide private]
[frames] | no frames]

Class ProteinAlignment

object --+
         |
        ProteinAlignment

A ProteinAlignment class that presents the same interface as a regular ProteinAlignment but optionally accomplishes mutating operations via a command stack.

If no command stack is set on the object, commands are executed but cannot be undone.

Nested Classes [hide private]
  __metaclass__
This metaclass makes it easy to create a class that wraps another one.
Instance Methods [hide private]
 
__init__(self, sequences=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
connectSignals(self)
Connect the signals in self.signals to the signals emitted by self._aln
 
__deepcopy__(self, memo)
Copy the alignment
 
setUndoStack(self, undo_stack)
 
reorderSequences(self, seq_indices)
Reorder the sequences in the alignment using the specified list of indices
 
setQuerySeq(self, seq)
Set the specified sequence as the query sequence.
 
addSeq(self, seq, index=None)
 
addSeqs(self, seqs, index=None)
Add multiple sequences to the alignment
 
addSeqsByIndices(self, seq_map)
Insert a sequences at the specified indices in the alignment.
 
removeSeq(self, seq)
Remove a sequence from the alignment
 
removeSeqByIndex(self, index)
Remove a Sequence from the alignment
 
removeSeqs(self, seqs)
Remove multiple sequences from the alignment
 
replaceSeq(self, seq, index)
Replace the sequence at the specified index with the elements in the specified sequence
 
addOrReplaceSeqs(self, seqs, identifier_func)
Given seqs and an identifier_func, replaces seqs in the alignment matching the identifier_func and appends any additional seqs to the alignment
 
removeAllSeqs(self)
Clears the entire alignment of sequences
 
removeResidues(self, residues)
Removes the specified residues from the alignment and emits the signals.residuesRemoved signal with the selection
 
mutateResidues(self, mutations)
Mutate the residues at the specified locations in the alignment
 
replaceResiduesWithGaps(self, residues)
Replaces the specified residues with gaps
 
addResidues(self, selection)
Adds the specified residues to the alignment
 
addGaps(self, gap_indices)
Adds gaps to the alignment
 
setGaps(self, gap_indices)
Sets gaps on the alignment
 
removeGaps(self, gap_indices)
 
removeTerminalGaps(self)
Removes the gaps from the ends of every sequence in the alignment
 
removeAllGaps(self)
Removes all the gaps of the sequences in the alignment.
 
_getInsertCommand(self, aln, start)
 
insertSubalignment(self, aln, start)
Insert an alignment into the current alignment at the specified index
 
removeSubalignment(self, start, end)
Remove a block of the subalignment from the start to end points, including column locks in that region
 
appendSubalignment(self, aln)
Append an alignment to this one
 
replaceSubalignment(self, aln, start, end)
Replace a subsection of the alignment indicated by start and end indices with the specified alignment
 
setLockedColumns(self, columns, lock=True)
Sets the columns to the specified lock state
 
setAllLocks(self, lock=True)
Convenience method to set all the locks to the specified lock state at once
 
minimizeAlignment(self)
Minimizes the alignment, i.e.
 
__add__(self, *args, **kwargs)
Adds another alignment to this one
 
__contains__(self, *args, **kwargs)
Returns whether the sequence is present in the alignment
 
__getitem__(self, *args, **kwargs)
Returns the sequence at the index in the alignment
 
__iter__(self, *args, **kwargs)
Returns an iterable of the sequences held in the alignment
 
__len__(self, *args, **kwargs)
Returns the number of sequences in the alignment
str
__repr__(self, *args, **kwargs)
Returns: A str representation of the alignment
 
__str__(self, *args, **kwargs)
Returns a str representation of the alignment
tuple of dict and list
_getAddOrReplaceSeqs(self, *args, **kwargs)
Inspect an iterable of seqs and use an identifier_func to return a two member tuple consisting of (to_replace, to_add).
 
_getAlignmentDescription(self, *args, **kwargs)
Returns a formatted description of the alignment
list
_getGapOnlyColumns(self, *args, **kwargs)
Returns a list of lists of indices for unlocked columns that contain only gaps
list
_getRegions(self, *args, **kwargs)
Returns a list of _Region objects containing information of locked and unlocked stretches of the alignment
 
_getTextFormattedAlignment(self, *args, **kwargs)
Returns a formatted list of strings with detailed alignment information
 
_insertGaps(self, *args, **kwargs)
Inserts gaps represented as "gap boundaries" (indices of residues that immediately follow the gaps) to a list of sequences.
int or NoneType
_recalculateLength(self, *args, **kwargs)
Determine what the length of the alignment would be if we removed one sequence.
 
_validateGapIndices(self, *args, **kwargs)
Check for gaps in locked columns
bool
alignmentLocked(self, *args, **kwargs)
Whether every column in the alignment is locked
 
calculateMatrix(self, *args, **kwargs)
Calculates a substitution matrix based on the current alignment.
bool
columnHasAllSameResidues(self, *args, **kwargs)
Return whether or not the column at a specified index has all the same residues (excluding gaps).
 
columns(self, *args, **kwargs)
Returns a range of alignment columns or all columns if indices are not specified.
list
findPattern(self, *args, **kwargs)
Finds a specified PROSITE pattern in all sequences.
 
getAlignedBlocks(self, *args, **kwargs)
Returns the indices of aligned blocks (regions without gaps).
list
getColumn(self, *args, **kwargs)
Returns single alignment column at index position.
 
getEntropy(self, *args, **kwargs)
Returns an alignment length array of residue entropy scores
 
getFrequencies(self, *args, **kwargs)
Returns a dict mapping residues types to the frequency in the alignment
list of lists of int
getGapIndicesByKeyFunc(self, *args, **kwargs)
Converts a gap_info list and key func into a list of gap indices
list
getGaps(self, *args, **kwargs)
Returns a list of gap indices lists
list
getGapsByKeyFunc(self, *args, **kwargs)
Given a key function to uniquely identify residues, build a list of lists with gap information for each sequence in the alignment
 
getGlobalAnnotationData(self, *args, **kwargs)
Returns column-level annotation data at an index in the alignment
list of int
getHiddenSeqIndices(self, *args, **kwargs)
Return a list of the indices of all sequences in the alignment that have an associated PT entry ID but are not currently visible in the Workspace.
 
getIdentities(self, *args, **kwargs)
Returns an alignment-length list of bools indicating which columns have identical residues
Sequence or None
getQuerySeq(self, *args, **kwargs)
Returns the sequence that has been set as query sequence or None if there is no query sequence.
list of int
getRedundantSequences(self, *args, **kwargs)
Returns the indices of sequences below a specified identity threshold value.
 
getResidueData(self, *args, **kwargs)
Returns residue-level data for the specified sequence at the specified index in the alignment, or None if no data is available.
list of (sequence index, residue index) tuples
getResidueIndices(self, *args, **kwargs)
Returns the indices (in the alignment) of the specified residues
int
getSeqIndex(self, *args, **kwargs)
Returns: The index of the requested sequence
 
getSimilarityScore(self, *args, **kwargs)
Returns a sequence length array of similarity scores against the query sequence
BaseAligment
getSubalignment(self, *args, **kwargs)
Return another alignment containing the elements within the specified start and end indices
list
getTerminalGaps(self, *args, **kwargs)
Returns the indices of terminal gaps in all the sequences
list of int
getVisibleSeqIndices(self, *args, **kwargs)
Return a list of the indices of all visible sequences in the alignment.
bool
isQuerySeq(self, *args, **kwargs)
Return whether or not a sequence is set as a query sequence.
 
iterResidues(self, *args, **kwargs)
Yields a sequence of schrodinger.application.msv.domain.residue.Residue objects in the alignment, omitting gaps.
set
lockedColumns(self, *args, **kwargs)
Returns a set with indices of locked columns.
ResidueSelection
makeResidueSelection(self, *args, **kwargs)
Returns a residue selection object matching the specified residues
 
mergePairwiseAlignments(self, *args, **kwargs)
Merges several pairwise alignments into one flat alignment while preserving relative residue positions.
 
notifyResDisplayChanged(self, *args, **kwargs)
Notify any listeners of a residue display change by emitting a signal.
 
notifyResidueSelection(self, *args, **kwargs)
Notify any listeners of a residue selection by emitting a ResidueSelection.
 
notifySequenceVisibilityChanged(self, *args, **kwargs)
Notify any listeners that a request to change visibility of an entire sequence has been made.
bool
resMatchesQueryRes(self, *args, **kwargs)
Return True if the residue of a sequence at a column in the alignment matches the query residue.
 
toClustalFile(self, *args, **kwargs)
Writes aln to a Clustal alignment file.
 
toFastaFile(self, *args, **kwargs)
Write self to specified FASTA file
 
toFastaString(self, *args, **kwargs)
Convert ProteinAlignment object to list of sequence strings
list
toFastaStringList(self, *args, **kwargs)
Convert self to list of fasta sequence strings

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Static Methods [hide private]
ProteinAlignment
fromClustalFile(file_name)
Returns alignment read from file in Clustal *.aln format preserving order of sequences.
ProteinAlignment
fromFastaFile(file_name)
Returns alignment read from file in Clustal *.aln format preserving order of sequences.
ProteinAlignment
fromFastaString(lines)
Read sequences from FASTA-formatted text, creates sequences and appends them to alignment.
 
fromFastaStringList(strings)
Return an alignment object created from an iterable of sequence strings
list of int
getReversedSequenceOrdering(seq_indices)
Given a new ordering for sequences in an alignment, return an ordering that will restore the original order of sequences.
 
padAlignment(aln)
Insert gaps into an alignment so that it forms a rectangular block
Properties [hide private]
  all_annotations
  annotations
  global_annotations
  max_length
  seq_annotations

Inherited from object: __class__

Method Details [hide private]

__init__(self, sequences=None)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setUndoStack(self, undo_stack)

 
Parameters:
  • undo_stack (QtWidgets.QUndoStack Set the undo stack on the object) - The undo stack on which to push commands

reorderSequences(self, seq_indices)

 

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

Parameters:
  • seq_indices - A list with the new indices for sequences
Decorators:
  • @command.do_command
Raises:
  • ValueError - In the event that the list of indices does not match the length of the alignment

setQuerySeq(self, seq)

 

Set the specified sequence as the query sequence.

Parameters:
  • seq (sequence) - Sequence to set as query sequence
Decorators:
  • @command.do_command

addSeq(self, seq, index=None)

 
Parameters:
  • seq (sequence.Sequence) - The sequence to add
  • start (int) - The index at which to insert; if None, seq is appended

addSeqs(self, seqs, index=None)

 

Add multiple sequences to the alignment

Parameters:
  • sequences (list of sequence.Sequence) - Sequences to add
  • start (int) - The index at which to insert; if None, seq is appended
Decorators:
  • @command.do_command

addSeqsByIndices(self, seq_map)

 

Insert a sequences at the specified indices in the alignment. The sequences will be added from lowest to highest to allow for specification of indexes that may be out of range of the current alignment until lower-indexed sequences have been added. Note that indexes that remain out of range will result in their corresponding sequence simply being appended to the end of the alignment.

Parameters:
  • seq_index_map - Map of insertion indices to sequences to be added. @type seq_index_map dict of {int: sequence.Sequence}
Decorators:
  • @command.do_command

removeSeq(self, seq)

 

Remove a sequence from the alignment

Parameters:
  • seq (sequence.Sequence) - The sequence to remove
Decorators:
  • @command.do_command

removeSeqByIndex(self, index)

 

Remove a Sequence from the alignment

Parameters:
  • index (int) - The index of the sequence to remove
Decorators:
  • @command.do_command

removeSeqs(self, seqs)

 

Remove multiple sequences from the alignment

Decorators:
  • @command.do_command

replaceSeq(self, seq, index)

 

Replace the sequence at the specified index with the elements in the specified sequence

Note that this leaves the original sequence itself intact so that it continues to be monitored

Parameters:
Decorators:
  • @command.do_command

addOrReplaceSeqs(self, seqs, identifier_func)

 

Given seqs and an identifier_func, replaces seqs in the alignment matching the identifier_func and appends any additional seqs to the alignment

Parameters:
Decorators:
  • @command.do_command

removeAllSeqs(self)

 

Clears the entire alignment of sequences

Decorators:
  • @command.do_command

removeResidues(self, residues)

 

Removes the specified residues from the alignment and emits the signals.residuesRemoved signal with the selection

Parameters:
  • residues (list) - The residues to remove
Decorators:
  • @command.do_command

mutateResidues(self, mutations)

 

Mutate the residues at the specified locations in the alignment

Note that the individual sequences will emit a signal announcing the mutation

Parameters:
  • mutations (list of tuples (seq_i, res_i, replacement))
Decorators:
  • @command.do_command

replaceResiduesWithGaps(self, residues)

 

Replaces the specified residues with gaps

Parameters:
  • residues (list) - A list of residues to replace with gaps
Decorators:
  • @command.do_command

addResidues(self, selection)

 

Adds the specified residues to the alignment

Parameters:
Decorators:
  • @command.do_command

addGaps(self, gap_indices)

 

Adds gaps to the alignment

Parameters:
  • gap_indices - A list of lists of gap indices, one for each sequence in the alignment.
Decorators:
  • @command.do_command

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

setGaps(self, gap_indices)

 

Sets gaps on the alignment

Parameters:
  • gap_indices - A list of lists of gap indices, one for each sequence in the alignment.
Decorators:
  • @command.do_command

removeGaps(self, gap_indices)

 
Parameters:
  • gap_indices (list of list of ints) - Indices of gaps to remove
Decorators:
  • @command.do_command

removeTerminalGaps(self)

 

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

Decorators:
  • @command.do_command

removeAllGaps(self)

 

Removes all the gaps of the sequences in the alignment. This also unlocks all columns

Decorators:
  • @command.do_command

insertSubalignment(self, aln, start)

 

Insert an alignment into the current alignment at the specified index

Parameters:
  • aln (BaseAlignment) - The alignment to insert
  • start (int) - The index at which to insert the alignment
Decorators:
  • @command.do_command

removeSubalignment(self, start, end)

 

Remove a block of the subalignment from the start to end points, including column locks in that region

Parameters:
  • start (int) - The start index of the columns to remove
  • end (int) - The end index of the columns to remove
Decorators:
  • @command.do_command

appendSubalignment(self, aln)

 

Append an alignment to this one

Parameters:
  • aln (BaseAlignment or list of Sequence) - The alignment to append
Decorators:
  • @command.do_command

replaceSubalignment(self, aln, start, end)

 

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

Parameters:
  • aln (BaseAlignment) - The alignment to insert
  • start (int) - The index at which to insert the alignment
Decorators:
  • @command.do_command

setLockedColumns(self, columns, lock=True)

 

Sets the columns to the specified lock state

Parameters:
  • columns (iterable) - an iterable of columns to set, specified by index
  • lock (bool) - Whether to lock or unlock columns
  • reset (bool) - Whether to reset the locks or add to existing ones
Decorators:
  • @command.do_command

setAllLocks(self, lock=True)

 

Convenience method to set all the locks to the specified lock state at once

Parameters:
  • lock (bool) - Whether to lock or unlock the specified columns
Decorators:
  • @command.do_command

minimizeAlignment(self)

 

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

Decorators:
  • @command.do_command

__add__(self, *args, **kwargs)
(Addition operator)

 

Adds another alignment to this one

Parameters:
  • other (schrodinger.application.msv.domain.alignment.Alignment

    NOTE: Undo is currently not supported for this operation

    ) - Another alignment with the same number of sequences

__repr__(self, *args, **kwargs)
(Representation operator)

 

repr(x)

Returns: str
A str representation of the alignment
Overrides: object.__repr__

__str__(self, *args, **kwargs)
(Informal representation operator)

 

Returns a str representation of the alignment

This is fairly detailed since it is very useful for debugging

Overrides: object.__str__

_getAddOrReplaceSeqs(self, *args, **kwargs)

 

Inspect an iterable of seqs and use an identifier_func to return a two member tuple consisting of (to_replace, to_add).

to_replace is a dictionary mapping sequence indices with new sequences to_add is a list of sequences to append to the alignment

Parameters:
Returns: tuple of dict and list
A tuple of to_replace dict and to_add list

_getGapOnlyColumns(self, *args, **kwargs)

 

Returns a list of lists of indices for unlocked columns that contain only gaps

Returns: list
List of list of indices

_getRegions(self, *args, **kwargs)

 

Returns a list of _Region objects containing information of locked and unlocked stretches of the alignment

Returns: list
A list of _Region objects

_insertGaps(self, *args, **kwargs)

 

Inserts gaps represented as "gap boundaries" (indices of residues that immediately follow the gaps) to a list of sequences. The gap indices correspond to first sequence in the list, but they come from a different alignment.

Parameters:
  • sequences (List of sequences to add gaps to.) - list of Sequence
  • gaps (list of int) - List of gaps.

_recalculateLength(self, *args, **kwargs)

 

Determine what the length of the alignment would be if we removed one sequence.

Parameters:
  • omit (sequence.Sequence) - The sequence to omit
  • extra_length (int) - An additional sequence length to include in the calculation
Returns: int or NoneType
The calculated alignment length if the length is going to change. None otherwise.

_validateGapIndices(self, *args, **kwargs)

 

Check for gaps in locked columns

Parameters:
  • gap_indices (list of lists) - A list of lists of gap indices

alignmentLocked(self, *args, **kwargs)

 

Whether every column in the alignment is locked

Returns: bool
Whether the alignment is locked

columnHasAllSameResidues(self, *args, **kwargs)

 

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

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

Parameters:
  • index (int) - Index to check for uniformity
Returns: bool
True if the column is of uniform identity, False otherwise.

columns(self, *args, **kwargs)

 

Returns a range of alignment columns or all columns if indices are not specified.

Parameters:
  • omit_gaps (bool) - Whether to omit gaps

findPattern(self, *args, **kwargs)

 

Finds a specified PROSITE pattern in all sequences.

Parameters:
  • pattern (basestring) - The pattern to find
Returns: list
A list of pattern matches

fromClustalFile(file_name)
Static Method

 

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

Parameters:
  • file_name (str) - Source file name.
Returns: ProteinAlignment
An alignment
Raises:
  • IOError - If output file cannot be read.

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

fromFastaFile(file_name)
Static Method

 

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

Returns: ProteinAlignment
Read alignment. The alignment can be empty if no sequence was present in the input file.
Raises:
  • IOError - If the input file cannot be read.

fromFastaString(lines)
Static Method

 

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

Parameters:
  • lines (list of str) - list of strings representing FASTA file
Returns: ProteinAlignment
The alignment

fromFastaStringList(strings)
Static Method

 

Return an alignment object created from an iterable of sequence strings

Parameters:
  • strings (Iterable of strings) - Sequences as iterable of strings (1D codes)

getColumn(self, *args, **kwargs)

 

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

Parameters:
  • index (int) - The index in the alignment
  • omit_gaps (bool) - Whether to omit the gaps
Returns: list
Single alignment column at index position.

getFrequencies(self, *args, **kwargs)

 

Returns a dict mapping residues types to the frequency in the alignment

Parameters:
  • exclude (list) - A list of sequences to exclude
  • consider_gaps (bool) - Whether to consider gaps in calculating frequences

getGapIndicesByKeyFunc(self, *args, **kwargs)

 

Converts a gap_info list and key func into a list of gap indices

Gap information consists of (key for residue, number of gaps preceding it)

Parameters:
  • gap_info (list) - list of list of tuples
  • key_func (function) - callable that takes a residue and returns a key
Returns: list of lists of int
A list of gaps for each sequence in the alignment

getGaps(self, *args, **kwargs)

 

Returns a list of gap indices lists

Returns: list
A list of lists of ints

getGapsByKeyFunc(self, *args, **kwargs)

 

Given a key function to uniquely identify residues, build a list of lists with gap information for each sequence in the alignment

Gap information consists of (key for residue, number of gaps preceding it)

Parameters:
  • key_func (function) - callable that takes a residue and returns a key
Returns: list
A list of lists with gaps information for each sequence in the alignment

getGlobalAnnotationData(self, *args, **kwargs)

 

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

Parameters:
  • index (int) - The index in the alignment
  • annotation (enum.Enum) - An enum representing the requested annotation, if any

getHiddenSeqIndices(self, *args, **kwargs)

 

Return a list of the indices of all sequences in the alignment that have an associated PT entry ID but are not currently visible in the Workspace.

Returns: list of int
List of hidden sequence indices

getIdentities(self, *args, **kwargs)

 

Returns an alignment-length list of bools indicating which columns have identical residues

Parameters:
  • omit_gaps (bool) - Whether gaps should be excluded from a column.

getQuerySeq(self, *args, **kwargs)

 

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

Returns: Sequence or None
The query sequence or None

getRedundantSequences(self, *args, **kwargs)

 

Returns the indices of sequences below a specified identity threshold value.

Returns: list of int
The indices of sequences in the alignment below specified identity threshold

getResidueData(self, *args, **kwargs)

 

Returns residue-level data for the specified sequence at the specified index in the alignment, or None if no data is available.

If annotation is specified, the residue-level information for the residue is returned. If not, the residue object itself is returned.

Parameters:
  • seqnum (int) - The index of the sequence in the alignment
  • index (int) - The index of the residue in the sequence
  • annotation (enum.Enum) - An enum representing the requested annotation, if any

getResidueIndices(self, *args, **kwargs)

 

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

Parameters:
  • residues ()
Returns: list of (sequence index, residue index) tuples
A list of (int, int)

getReversedSequenceOrdering(seq_indices)
Static Method

 

Given a new ordering for sequences in an alignment, return an ordering that will restore the original order of sequences.

Given a an alignment [a, b, c, d, e] an ordering of [3, 1, 4, 2, 0] will rearrange the sequences into [d, b, e, c, a]. We need an ordering of [4, 1, 3, 0, 2] to restore the original arrangement of [a, b, c, d, e]. This method is used in undo operations.

Parameters:
  • seq_indices - A list with the new indices for sequences
Returns: list of int
An ordering list that will restore the original arrangement of sequences in the alignment

getSeqIndex(self, *args, **kwargs)

 
Parameters:
  • seq (sequence.Sequence) - The requested sequence
Returns: int
The index of the requested sequence

getSimilarityScore(self, *args, **kwargs)

 

Returns a sequence length array of similarity scores against the query sequence

Gaps in the sequences are coded as None values.

getSubalignment(self, *args, **kwargs)

 

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

Parameters:
  • start (int) - The index at which the subalignment should start
  • end (int) - The index at which the subalignment should end
Returns: BaseAligment
An alignment corresponding to the start and end point specified

getTerminalGaps(self, *args, **kwargs)

 

Returns the indices of terminal gaps in all the sequences

Returns: list
A list of lists of ints

getVisibleSeqIndices(self, *args, **kwargs)

 

Return a list of the indices of all visible sequences in the alignment.

Returns: list of int
List of visible sequence indices

isQuerySeq(self, *args, **kwargs)

 

Return whether or not a sequence is set as a query sequence.

Parameters:
  • seq (Sequence) - Sequence to check
Returns: bool
True if a query sequence has been set, False otherwise.

lockedColumns(self, *args, **kwargs)

 

Returns a set with indices of locked columns.

Returns: set
A set of indices

The set is a copy of our internal set, so modifying it has no effect on our private attribute

makeResidueSelection(self, *args, **kwargs)

 

Returns a residue selection object matching the specified residues

Parameters:
  • residues (list) - A list of residues
Returns: ResidueSelection
An object containing selection information

mergePairwiseAlignments(self, *args, **kwargs)

 

Merges several pairwise alignments into one flat alignment while preserving relative residue positions. The original sequences are modified. After executing this function, all query sequences (first pair members) will be identical.

Example. Let's assume we have three pairwise query/template alignments:

Q1: ACDEFGHI T1: ~~DEF~~~

Q2: ~~~ACDEFGHI T2: TTT~~DE~~H~

Q3: ACDEF~~GHI~ T3: ACD~~PPGH~Y

Note the query sequence is identical in all cases, but it has gaps in different positions. After running mergePairwiseAlignments, the result is:

Q1: ~~~ACDEF~~GHI T1: ~~~~~DEF~~~~~

Q2: ~~~ACDEF~~GHI T2: TTT~~DE~~~~H~

Q3: ~~~ACDEF~~GHI~ T3: ~~~ACD~~PPGH~Y

Now the queries have gaps in identical positions, and aligned residues are in positions equivalent to these in original alignments.

Parameters:
  • sequence_pairs (list of list of sequences) - List of [query, template] pairs.

notifyResDisplayChanged(self, *args, **kwargs)

 

Notify any listeners of a residue display change by emitting a signal.

Parameters:

notifyResidueSelection(self, *args, **kwargs)

 

Notify any listeners of a residue selection by emitting a ResidueSelection.

Parameters:

notifySequenceVisibilityChanged(self, *args, **kwargs)

 

Notify any listeners that a request to change visibility of an entire sequence has been made.

Parameters:
  • seq (sequence.Sequence) - Sequence whose visibility is changing
  • display (bool) - Whether the sequence is being displayed.

padAlignment(aln)
Static Method

 

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

Parameters:
  • aln (schrodinger.application.msv.domain.Alignment) - An alignment to pad

resMatchesQueryRes(self, *args, **kwargs)

 

Return True if the residue of a sequence at a column in the alignment matches the query residue.

Parameters:
  • row_index (int) - Index of the sequence containing the residue to check
  • col_index (int) - Column of the residue to check
Returns: bool
True if the residue at the specified index matches the reference, False otherwise.

toClustalFile(self, *args, **kwargs)

 

Writes aln to a Clustal alignment file.

Parameters:
  • file_name (str) - Destination file name.
  • use_unique_names (bool) - If True, write unique name for each sequence.
Raises:
  • IOError - If output file cannot be written.

toFastaFile(self, *args, **kwargs)

 

Write self to specified FASTA file

Raises:
  • IOError - If output file cannot be written.

toFastaString(self, *args, **kwargs)

 

Convert ProteinAlignment object to list of sequence strings

Parameters:

toFastaStringList(self, *args, **kwargs)

 

Convert self to list of fasta sequence strings

Returns: list
list of str

Property Details [hide private]

all_annotations

Get Method:
unreachable.fget(self)

annotations

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)

global_annotations

Get Method:
unreachable.fget(self)

max_length

Get Method:
unreachable.fget(self)

seq_annotations

Get Method:
unreachable.fget(self)