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

Class ProteinAlignment

       object --+                        
                |                        
sip.simplewrapper --+                    
                    |                    
          sip.wrapper --+                
                        |                
     PyQt4.QtCore.QObject --+            
                            |            
            Qt.QtCore.QObject --+        
                                |        
   domain.alignment.BaseAlignment --+    
                                    |    
    domain.alignment.ProteinAlignment --+
                                        |
                                       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.

Instance Methods [hide private]
 
setUndoStack(self, undo_stack)
 
setQuerySeq(self, seq=None)
Set the specified sequence as the query sequence.
 
addSeqs(self, seqs, index=None)
Add multiple sequences to the alignment
 
removeSeq(self, seq)
Remove a sequence from the alignment
 
removeSeqByIndex(self, index)
Remove a Sequence 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 residuesRemoved signal with the selection
 
mutateResidues(self, mutations)
Mutate the residues at the specified locations in the alignment
 
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 specified 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.

Inherited from domain.alignment.ProteinAlignment: __init__

Inherited from domain.alignment.BaseAlignment: __add__, __contains__, __deepcopy__, __getitem__, __iter__, __len__, __repr__, __str__, addSeq, alignmentLengthAboutToChange, alignmentLengthChanged, alignmentLocked, calculateMatrix, columnHasAllSameResidues, columns, createConsensusSequence, findPattern, getAlignedBlocks, getColumn, getEntropy, getFrequencies, getGapIndicesByKeyFunc, getGaps, getGapsByKeyFunc, getGlobalAnnotationData, getHiddenSeqIndices, getIdentities, getQuerySeq, getRedundantSequences, getResidueData, getResidueIndices, getSeqIndex, getSimilarityScore, getSubalignment, getTerminalGaps, getVisibleSeqIndices, isQuerySeq, iterResidues, lockedColumns, makeResidueSelection, notifyResDisplayChanged, notifyResidueSelection, notifySequenceVisibilityChanged, querySequenceUpdated, removeSeqs, replaceResiduesWithGaps, residueVisibilityChanged, residuesAdded, residuesRemoved, residuesSelected, sequenceNameChanged, sequenceResiduesChanged, sequenceVisibilityChanged, sequencesAboutToBeInserted, sequencesAboutToBeRemoved, sequencesInserted, sequencesRemoved

Inherited from Qt.QtCore.QObject: connect, emit

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from sip.simplewrapper: __new__

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

Class Methods [hide private]

Inherited from domain.alignment.BaseAlignment: mergePairwiseAlignments, padAlignment

Inherited from domain.alignment.BaseAlignment (private): _insertGaps

Class Variables [hide private]

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Properties [hide private]

Inherited from domain.alignment.ProteinAlignment: global_annotations, seq_annotations

Inherited from domain.alignment.BaseAlignment: all_annotations

Inherited from object: __class__

Method Details [hide private]

setUndoStack(self, undo_stack)

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

setQuerySeq(self, seq=None)

 

Set the specified sequence as the query sequence. If None is passed, the query sequence will be unset.

Parameters:
  • seq - Sequence to set as query sequence or None
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.setQuerySeq
(inherited documentation)

addSeqs(self, seqs, index=None)

 

Add multiple sequences to the alignment

Parameters:
  • sequences - Sequences to add
  • start - The index at which to insert; if None, seq is appended
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.addSeqs
(inherited documentation)

removeSeq(self, seq)

 

Remove a sequence from the alignment

Parameters:
  • seq - The sequence to remove
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.removeSeq
(inherited documentation)

removeSeqByIndex(self, index)

 

Remove a Sequence from the alignment

Parameters:
  • index - The index of the sequence to remove
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.removeSeqByIndex
(inherited documentation)

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:
  • seq - The sequence whose elements we use
  • index - The index of the sequence to replace
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.replaceSeq
(inherited documentation)

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:
  • seqs - The sequences to add to the alignment
  • identifier_func - A key function to uniquely identify sequences
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.addOrReplaceSeqs
(inherited documentation)

removeAllSeqs(self)

 

Clears the entire alignment of sequences

Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.removeAllSeqs
(inherited documentation)

removeResidues(self, residues)

 

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

Parameters:
  • residues - The residues to remove
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.removeResidues
(inherited documentation)

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
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.mutateResidues
(inherited documentation)

addResidues(self, selection)

 

Adds the specified residues to the alignment

Parameters:
  • selection - A selection of residues
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.addResidues
(inherited documentation)

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.

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

Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.addGaps
(inherited documentation)

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
Overrides: domain.alignment.BaseAlignment.setGaps
(inherited documentation)

removeGaps(self, gap_indices)

 
Parameters:
  • gap_indices - Indices of gaps to remove
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.removeGaps
(inherited documentation)

removeTerminalGaps(self)

 

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

Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.removeTerminalGaps
(inherited documentation)

removeAllGaps(self)

 

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

Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.removeAllGaps
(inherited documentation)

insertSubalignment(self, aln, start)

 

Insert an alignment into the current alignment at the specified index

Parameters:
  • aln - The alignment to insert
  • start - The index at which to insert the alignment
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.insertSubalignment
(inherited documentation)

removeSubalignment(self, start, end)

 

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

Parameters:
  • start - The start index of the columns to remove
  • end - The end index of the columns to remove
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.removeSubalignment
(inherited documentation)

appendSubalignment(self, aln)

 

Append an alignment to this one

Parameters:
  • aln - The alignment to append
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.appendSubalignment
(inherited documentation)

replaceSubalignment(self, aln, start, end)

 

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

Parameters:
  • aln - The alignment to insert
  • start - The index at which to insert the alignment
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.replaceSubalignment
(inherited documentation)

setLockedColumns(self, columns, lock=True)

 

Sets the specified columns to the specified lock state

In undoable subclasses, this is an undoable method. We offer a private version of the method so that other undoable methods can call it without calling a second undoable method.

Parameters:
  • columns - an iterable of columns to set, specified by index
  • lock - Whether to lock or unlock columns
  • reset - Whether to reset the locks or add to existing ones
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.setLockedColumns
(inherited documentation)

setAllLocks(self, lock=True)

 

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

Parameters:
  • lock - Whether to lock or unlock the specified columns
Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.setAllLocks
(inherited documentation)

minimizeAlignment(self)

 

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

Decorators:
  • @command.do_command
Overrides: domain.alignment.BaseAlignment.minimizeAlignment
(inherited documentation)