Package schrodinger :: Package application :: Package bioluminate :: Package ssv :: Module viewer :: Class SimplifiedSequenceViewer
[hide private]
[frames] | no frames]

Class SimplifiedSequenceViewer

                          PyQt4.QtGui.QSplitter --+    
                                                  |    
ui.sequencealignment.sequence_viewer.SequenceViewer --+
                                                      |
                                                     SimplifiedSequenceViewer

Creates a sequence viewer that can be opened by an action or added to a main window as a dockable item. Here is an example of how to add a dockable item to a QMainWindow, or AppFramework window:

   from schrodinger.applications.bioluminate import sequence_viewer 

   self.sequence_viewer = sequence_viewer.SimplifiedSequenceViewer(<window>)
   self.addDockWidget(
       QtCore.Qt.TopDockWidgetArea,
       self.sequence_viewer.asDock()
   )

If you want to add a button that will open the viewer in a new window:

   from schrodinger.applications.bioluminate import sequence_viewer

   self.sequence_viewer = sequence_viewer.SimplifiedSequenceViewer(<window>)
   self.viewer_button   = QtGui.QPushButton(self.tr('Open Model Viewer...'))
   self.viewer_button.clicked.connect(self.openSequenceViewer)

then in the connected method (openSequenceViewer):

   self.sequence_viewer.window.show()
   self.sequence_viewer.window.setFocus()

If you want to simply add a sequence viewer frame to your app:

   self.sequence_viewer = SimplifiedSequenceViewer(<window>)
   <layout>.addWidget( self.sequence_viewer.asFrame() )
Instance Methods [hide private]
 
__init__(self, parent, toolbars=None, auto_align=False, require3d=True)
 
_setContextMenus(self)
Private method to create the context menus used in the viewer.
 
setupViewer(self)
Sets up the viewer's window and context menus
 
enableMaestroSync(self)
Enables selection and color synchronization with Maestro
 
asDock(self)
Returns the viewer as a dock widget.
 
asFrame(self)
Returns the viewer as a frame widget
list of sequences
protein_sequences(self)
Property for all sequences in the viewer that are valid proteins
list of sequences
structure_sequences(self)
Property for all sequences in the viewer that have structures.
list of sequences
selected_sequences(self)
Property returning all selected sequences in the viewer.
schrodinger.structure.Structure
getReferenceStructure(self)
Gets the structure associated with the reference sequence from maestro's PT.
generator
generateSeqProjectRows(self, include_reference=True)
Create a generator for all sequences that have a project table row associated with them.
generator
generateSeqStructures(self, include_reference=True)
Create a generator for all sequences that have a project table row associated with them.
None or structure
getSeqStructure(self, sequence)
Get the structure associated with a Sequence.
 
importFromPDB(self, maestro_incorporate=True, multiple=True)
Import structures from comma-separated list of PDB IDs.
 
importFromFile(self, *args, **kwargs)
Callback for import file action
 
importFromFilePaths(self, filenames, to_maestro=True)
Import a list of filesnames into the sequence viewer.
 
importFromWorkspace(self, ignored=None)
Import a structure from the workspace and load it into the sequence viewer.
 
importFromProjectTable(self)
Import a structure from a selected PT row and load it into the sequence viewer.
 
createSequence(self)
Used to manually import a sequence into the viewer.
 
addAnnotationAction(self)
 
setColorModeAction(self)
 
focusFinder(self)
Switch focus to Find Pattern input box.
 
nameContextCallback(self, position, seq=None)
Callback used when context menus called for the view with the pdb name.
 
sequenceContextCallback(self, position, res=None)
Callback used when context menus called for the view with the sequences in it.
 
treeContextCallback(self, position, tree=None)
Callback used when context menus called for the tree view
 
selectOnlyByEntry(self, entry_ids)
Selects rows in the sequence viewer that are associated with the passed in entry ids.
 
selectOnlyBySeqs(self, sequences)
Selects rows in the sequence viewer that are associated with the passed in sequences.
 
deleteByEntry(self, entry_ids)
Deletes rows in the sequence viewer that are associated with the passed in entry ids.
 
deleteBySequences(self, sequences)
Deletes rows in the sequence viewer that are associated with the passed in sequences.
 
importFromMaestro(self, method)
 
closeWindow(self)
Action for the "Close" button

Inherited from ui.sequencealignment.sequence_viewer.SequenceViewer: addAllColorBlocks, addAnnotation, addConsensus, addGlobalAnnotations, addMeanHydrophobicity, addMeanPI, addSequenceLogo, addSymbols, addUserAnnotation, alignByResidueNumbers, alignMerge, alignStructures, alignmentSettingsDialog, analyzeBindingSite, anchorSelection, assignAntibodyScheme, associateMaestroEntries, auxBorderWidth, blastFailedCallback, blastOkCallback, buildModel, changeQuery, clearAnchors, clearConstraints, clearMarkedResidues, clearQueryConstraints, clearSequences, clearSet, closeEvent, collapseAllSequences, colorEntrySurface, colorSequenceNames, colorSequences, colorToRGB, computeSequenceProfile, copySequences, createCommandDict, cropSelectedResidues, deleteAnnotations, deletePredictions, deleteSelectedResidues, deleteSelectedSequences, deleteSet, deselectAll, disableQueryConstraints, displayLigands, displayMessage, downloadPDB, duplicateSequences, editSequence, emphasizeArea, enableQueryConstraints, excludeQueryEntries, excludeSelected, executeCommandFile, expandAllSequences, expandSelection, expandSelectionRef, fetchSequence, fillGaps, findNext, findPattern, findPrevious, generateRows, getConsiderGaps, getContents, getGlobalAnnotations, getMode, getSASA, getStructureAlignment, hideColumns, hideSelectedSequences, includeQueryEntries, incorporateIncludedEntries, incorporateSelectedEntries, incorporateStructure, initMaestro, invertSelection, invertSequenceSelection, loadFile, loadProject, lockGaps, maestroCommandCallback, maestroProjectChanged, maestroProjectClose, maestroProjectOpen, maestroWorkspaceChanged, makeTabsFromGroupList, markResidues, maxColumns, minimizeAlignment, moveBottom, moveDown, moveTop, moveUp, newSet, pairwiseAlignment, passSelectionToMaestro, pasteFasta, propagateColors, redo, removeAllColorBlocks, removeGaps, removeGlobalAnnotations, removeMaestroCallbacks, removeRedundancy, removeUserAnnotations, renameSequence, renumberResidues, resetHistory, resizeEvent, runBlast, runClustal, runPfam, runPredictors, runSSP, saveFile, saveImage, saveProject, selectAlignedBlocks, selectAll, selectAllSequences, selectColumns, selectIdentities, selectLigandContacts, selectResidues, selectSequencesByName, selectStructureBlocks, setAsReference, setBackgroundColor, setBoundaries, setCallback, setColorMode, setConsiderGaps, setDisplayHomology, setDisplayIdentity, setDisplayScore, setDisplaySimilarity, setHasHeaderRow, setHasRuler, setHasTooltips, setIdentityInColumns, setMode, setMouseAcross, setPadded, setPopupMenus, setUndoRedoActions, setUseColors, setWrapped, showAllSequences, showBlastResults, showColumns, showCompareSequencesDialog, showEvent, showJobLog, showJobSettings, synchronizeWithMaestro, toggleConstraints, toggleHistory, translate, undo, unlockGaps, unselectAllSequences, updateAnnotationsMenu, updateFontSize, updateStatusBar, updateView, weightColorsSettings, zoomIn, zoomOut

Class Variables [hide private]
  WORKSPACE = 'workspace'
  PROJET_TABLE = 'projecttable'
  PDB_STRING = 'pdb_string'
  FILES = 'files'
  MANUAL_SEQUENCE = 'manual_sequence'
  sequencesImported = QtCore.pyqtSignal(str)
Signal emitted after any structures have been imported by any means into the viewer.
Instance Variables [hide private]
  dock_widget
Widget the allows self.window to be dockable
  last_sequences_imported
Stores the last sequences added to the viewer.
Method Details [hide private]

__init__(self, parent, toolbars=None, auto_align=False, require3d=True)
(Constructor)

 
Parameters:
  • parent - Parent widget of the sequence viewer
  • toolbars (list of strings) - A list of toolbar flags to use (see ViewerWindow for available toolbars
  • auto_align (boolean) - Whether to auto-align sequences when a new one is imported
  • require3d (boolean) - Whether to allow fasta sequence files to be imported. If set to True (default) only structures with 3D coordinates are allowed.
Overrides: ui.sequencealignment.sequence_viewer.SequenceViewer.__init__

See Also: ViewerWindow

protein_sequences(self)

 

Property for all sequences in the viewer that are valid proteins

Returns: list of sequences
Decorators:
  • @property

structure_sequences(self)

 

Property for all sequences in the viewer that have structures.

Returns: list of sequences
Decorators:
  • @property

selected_sequences(self)

 

Property returning all selected sequences in the viewer. This does not include a child sequence.

Returns: list of sequences
Decorators:
  • @property

getReferenceStructure(self)

 

Gets the structure associated with the reference sequence from maestro's PT. If there is no structure for the reference None is returned.

Returns: schrodinger.structure.Structure

generateSeqProjectRows(self, include_reference=True)

 

Create a generator for all sequences that have a project table row associated with them. Yields each sequence's row from the PT.

Parameters:
  • include_reference (bool) - Whether to include the reference seq
Returns: generator
A generator that yields a schrodinger.project.ProjectRow

generateSeqStructures(self, include_reference=True)

 

Create a generator for all sequences that have a project table row associated with them. Yields each sequence's structure from the PT.

Parameters:
  • include_reference (bool) - Whether to include the reference structure
Returns: generator
A generator that yields a schrodinger.structure.Structure

getSeqStructure(self, sequence)

 

Get the structure associated with a Sequence.

Returns: None or structure
A structure object if found otherwise None

importFromPDB(self, maestro_incorporate=True, multiple=True)

 

Import structures from comma-separated list of PDB IDs. If multiple=False only the first PDB ID will be used.

Returns None if user cancelled, or PDB ID(s) if not.

Decorators:
  • @catch_last_added

importFromFile(self, *args, **kwargs)

 

Callback for import file action

Decorators:
  • @catch_last_added

importFromFilePaths(self, filenames, to_maestro=True)

 

Import a list of filesnames into the sequence viewer.

Parameters:
  • filenames (list of strings) - Filenames to be imported

importFromWorkspace(self, ignored=None)

 

Import a structure from the workspace and load it into the sequence viewer.

Decorators:
  • @catch_last_added

importFromProjectTable(self)

 

Import a structure from a selected PT row and load it into the sequence viewer.

Decorators:
  • @catch_last_added

createSequence(self)

 

Used to manually import a sequence into the viewer. We override the base class here so we can emit the sequencesImported signal.

Decorators:
  • @catch_last_added
Overrides: ui.sequencealignment.sequence_viewer.SequenceViewer.createSequence

selectOnlyBySeqs(self, sequences)

 

Selects rows in the sequence viewer that are associated with the passed in sequences.

Parameters:

deleteByEntry(self, entry_ids)

 

Deletes rows in the sequence viewer that are associated with the passed in entry ids. If any rows are selected before this is called, they are retained.

deleteBySequences(self, sequences)

 

Deletes rows in the sequence viewer that are associated with the passed in sequences. If any rows are selected before this is called, they are retained.


Class Variable Details [hide private]

sequencesImported

Signal emitted after any structures have been imported by any means into the viewer. The string passed in the emit will be one of:

Value:
QtCore.pyqtSignal(str)