Package schrodinger :: Package application :: Package msv :: Package io :: Module structure_model :: Class MaestroStructureModel
[hide private]
[frames] | no frames]

Class MaestroStructureModel

       object --+                
                |                
sip.simplewrapper --+            
                    |            
          sip.wrapper --+        
                        |        
     PyQt4.QtCore.QObject --+    
                            |    
       AbstractStructureModel --+
                                |
                               MaestroStructureModel

Instance Methods [hide private]
 
__init__(self, parent=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
setAlignment(self, aln=None)
Set the alignment on the instance, connect any signals required, disconnect from a previous alignment if necessary, and emit a notification with the alignment
 
_rebuildResMap(self)
Rebuilds the mapping between residue objects in msv and residues in the workspace
schrodinger.application.msv.alignment.Alignment
getAlignment(self)
Returns an alignment containing sequences synchronized with their structural counterparts
 
getMappedRes(self, res)
Given an msv residue.Residue object, return an maestro_ui.WHResidue object and vice versa
tuple
_key_func(self, seq)
Take a sequence and returns a unique identifier for the sequence
 
setSyncable(self, seq, allow)
Set a sequence to be synchronizable with its structural counterpart
 
syncStructureSequences(self, cts=None)
Inspect all the structural sequences and synchronize them with the counterpart sequences in the alignment, if allowed
 
_applyCurrentWorkspaceSelection(self)
 
updateSelectionFromWS(self, selected, deselected)
Callback that receives selection information from the structure monitor, maps the selection from whresidues to msv residues and informs the alignment of the selection
 
alignmentResiduesChanged(self, seq, start, end)
Respond to residue changes in the alignment
 
alignmentResiduesRemoved(self, selection)
 
_setWSResidueSelection(self)
Maps the selection in the msv to whresidue objects and sets workspace selection via the structure monitor.
 
setWSResidueSelection(self, current_selection)
Store the current selection on the instance and call a helper method via a timer.
 
onAtomsChanged(self, added, removed)
Respond to residue mutation and deletion from the workspace
 
_updateEntriesIncluded(self, included_entries)
Respond to changes in pt entries by rebuilding the residue mapping and emitting a notification that the structure view's inclusion status has changed
 
onEntriesIncluded(self, all_included, newly_included)
Respond to the inclusion of new entries in the project table
 
onEntriesExlucluded(self, all_included, newly_excluded)
Respond to the exclusion of entries in the project table
 
onEntriesAdded(self, new_entries)
Respond to the addition of new entries into the project table by adding new sequences to msv and rebuilding residue mapping
dict (sequence, list)
getResidueColors(self, sequences)
Returns a dictionary mapping sequences to rgb code arrays.
bool
_isPolypeptide(self, chain)
Helper method to determine whether a chain is a valid polypeptide.
 
getSequenceStructurePairs(self, sequences)
Pairs sequences in msv with sequences in the structure model.
 
updateProjectEntries(self, sequences)
Updates structures in Maestro project after MSV modifies the structure

Inherited from AbstractStructureModel: enableSynchronization

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__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Instance Variables [hide private]

Inherited from AbstractStructureModel: alignmentChanged, requestUndoStackClear, structureViewInclusionChanged

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent=None)
(Constructor)

 

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

Overrides: object.__init__
(inherited documentation)

setAlignment(self, aln=None)

 

Set the alignment on the instance, connect any signals required, disconnect from a previous alignment if necessary, and emit a notification with the alignment

If the aln is None, we initialize an alignment

Parameters:
  • aln - An alignment to set on the instance, or None
Overrides: AbstractStructureModel.setAlignment
(inherited documentation)

_rebuildResMap(self)

 

Rebuilds the mapping between residue objects in msv and residues in the workspace

This method needs to be called whenever the workspace atoms change

Note that the cts in the project table and the workspace ct are never the same, even when all the pt cts are included in the workspace. All sequences read in from maestro are taken from the pt. We use the origin attribute on the Residue object to map from the pt residues to the workspace residues

getAlignment(self)

 

Returns an alignment containing sequences synchronized with their structural counterparts

Returns: schrodinger.application.msv.alignment.Alignment
Overrides: AbstractStructureModel.getAlignment
(inherited documentation)

_key_func(self, seq)

 

Take a sequence and returns a unique identifier for the sequence

When we synchronize with the workspace, sequences with the same key are considered to be different versions of the same sequence.

Parameters:
  • seq (schrodinger.application.msv.domain.Sequence) - A sequence
Returns: tuple
A tuple identifying a sequence

setSyncable(self, seq, allow)

 

Set a sequence to be synchronizable with its structural counterpart

Parameters:
  • seq - The sequence to set synchronization state for
  • allow - Whether the sequence should sync with its structural counterpart
Overrides: AbstractStructureModel.setSyncable
(inherited documentation)

syncStructureSequences(self, cts=None)

 

Inspect all the structural sequences and synchronize them with the counterpart sequences in the alignment, if allowed

Parameters:
  • cts - The cts to inspect or None, to inspect all available
Overrides: AbstractStructureModel.syncStructureSequences
(inherited documentation)

updateSelectionFromWS(self, selected, deselected)

 

Callback that receives selection information from the structure monitor, maps the selection from whresidues to msv residues and informs the alignment of the selection

Note: We ignore deselected items.

Parameters:
  • selected (list) - whresidues selected in the workspace
  • deselected (list) - whresidues deselected in the workspace

alignmentResiduesChanged(self, seq, start, end)

 

Respond to residue changes in the alignment

Parameters:
  • seq - The sequence in which residues have changed
  • start - The start of the change
  • end - The end of the change
Overrides: AbstractStructureModel.alignmentResiduesChanged
(inherited documentation)

setWSResidueSelection(self, current_selection)

 

Store the current selection on the instance and call a helper method via a timer. This prevents a loop in the selection behavior.

Parameters:
  • current_selection (schrodinger.application.msv.domain.alignment. ResidueSelection) - The selection in the msv

onAtomsChanged(self, added, removed)

 

Respond to residue mutation and deletion from the workspace

Parameters:
  • added (list of int) - The indices of added atoms
  • removed (list of int

    Note: We're not handling added atoms yet. The solution here is a stopgap until we have a better way of tracking residues through changes.

    ) - The indices of removed atoms

_updateEntriesIncluded(self, included_entries)

 

Respond to changes in pt entries by rebuilding the residue mapping and emitting a notification that the structure view's inclusion status has changed

Parameters:
  • included_entries (set of str) - The currently included entries

onEntriesIncluded(self, all_included, newly_included)

 

Respond to the inclusion of new entries in the project table

Parameters:
  • all_included (set of str) - All currently included entries
  • newly_included (set of str) - New entries

onEntriesExlucluded(self, all_included, newly_excluded)

 

Respond to the exclusion of entries in the project table

Parameters:
  • all_included (set of str) - All currently included entries
  • newly_excluded (set of str) - New entries

onEntriesAdded(self, new_entries)

 

Respond to the addition of new entries into the project table by adding new sequences to msv and rebuilding residue mapping

Parameters:
  • new_entries (set of str) - Newly added entries

getResidueColors(self, sequences)

 

Returns a dictionary mapping sequences to rgb code arrays.

The rgb code arrays specify the color of the residues in the corresponding sequence on the structure model

Parameters:
  • sequences - An iterable of schrodinger.applicaiton.msv.sequence.ProteinSequence
Returns: dict (sequence, list)
A mapping of sequences to rgb code arrays
Overrides: AbstractStructureModel.getResidueColors
(inherited documentation)

_isPolypeptide(self, chain)

 

Helper method to determine whether a chain is a valid polypeptide. The sole criterion is whether the chain contains a single standard residue.

TODO: Change this to test if the structure's residues contain a peptidic backbone (C-alpha, and C, N, O backbone atoms).

Parameters:
  • chain - The chain to inspect
Returns: bool
Whether the chain is a valid polypeptide

getSequenceStructurePairs(self, sequences)

 

Pairs sequences in msv with sequences in the structure model.

Parameters:
  • sequences - An iterable of schrodinger.applicaiton.msv.sequence.ProteinSequence
Returns:
A list of (sequence, chain) tuples

updateProjectEntries(self, sequences)

 

Updates structures in Maestro project after MSV modifies the structure

Parameters:
  • sequences - An iterable of schrodinger.applicaiton.msv.sequence.ProteinSequence