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

Class ProteinAlignment

       object --+                    
                |                    
sip.simplewrapper --+                
                    |                
          sip.wrapper --+            
                        |            
     PyQt4.QtCore.QObject --+        
                            |        
      alignment.BaseAlignment --+    
                                |    
       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)
 
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
 
removeAllSeqs(self)
Clears the entire alignment of sequences
 
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 alignment.ProteinAlignment: __init__

Inherited from alignment.BaseAlignment: __add__, __contains__, __deepcopy__, __getitem__, __iter__, __len__, __repr__, __str__, addSeq, alignmentLocked, calculateMatrix, columns, createConsensusSequence, findPattern, getAlignedBlocks, getColumn, getEntropy, getFrequencies, getGaps, getGlobalAnnotationData, getIdentities, getRedundantSequences, getResidueData, getResidueIndices, getSeqIndex, getSimilarityScore, getSubalignment, getTerminalGaps, lockedColumns, removeSeqs

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, 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 alignment.BaseAlignment: mergePairwiseAlignments, padAlignment

Inherited from alignment.BaseAlignment (private): _insertGaps

Class Variables [hide private]

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Instance Variables [hide private]

Inherited from alignment.BaseAlignment: alignmentLengthAboutToChange, alignmentLengthChanged, sequenceNameChanged, sequenceResiduesChanged, sequencesAboutToBeInserted, sequencesAboutToBeRemoved, sequencesInserted, sequencesRemoved

Properties [hide private]

Inherited from alignment.ProteinAlignment: global_annotations, seq_annotations

Inherited from 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

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

removeAllSeqs(self)

 

Clears the entire alignment of sequences

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

removeGaps(self, gap_indices)

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

removeTerminalGaps(self)

 

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

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