Package schrodinger :: Package application :: Package desmond :: Module fep_gui :: Class _LigMut
[hide private]
[frames] | no frames]

Class _LigMut

       object --+                
                |                
sip.simplewrapper --+            
                    |            
          sip.wrapper --+        
                        |        
     PyQt4.QtCore.QObject --+    
                            |    
           object --+       |    
                    |       |    
    sip.simplewrapper --+   |    
                        |   |    
 PyQt4.QtGui.QPaintDevice --+    
                            |    
          PyQt4.QtGui.QWidget --+
                                |
                               _LigMut


Class of the "Ligand Functional Group Mutation by FEP" panel.

The type of perturbation(s) that this panel allows the user to define is substition of a functional group of a
selected molecule, which is usually a ligand molecule, with one or more selected fragments.

So the panel helps the user to accomplishes two tasks:
1. Select the functional group for substitution. This is done by the user picking the bond that connects the group and
   the other part of the molecule. We call this bond ``attachment bond'', the group to be substituted the ``substitution
   group'', and the unchanged part of the molecule the ``core''. One thing to note is a restriction of the panel: there
   can be only 1 attachment bond between the substitution group and the core and the attachment has to be a single bond.
2. Select fragment(s) in the given table. The challenge here for the panel is two folds:
   a. To generate a correct mutated structure with a selected fragment.
   b. If user modified the generated structure on the Workspace, the changes should be memorized by the panel such that
      when user clicks the Write button the user-modified structure will be outputed. This is uneasy, just imagine if
      user selects 2 or more fragments and modifies them one after another.

Under the hood, the panel should do the following things:
1. Seperate the original to-be-mutated molecule into a new CT.
2. Generate a new molecule with each selected fragment. We generally call such a molecule ``mutant''. Each mutant will be
   in a separate CT by itself.
3. We need to provide information to identify which molecule is mutated and also which part of the molecule is mutation.
   This is done by properly setting an atom property: "i_fep_subst":
   i_fep_subst = 0    atoms not belong to the mutated molecule.
   i_fep_subst = 1    atoms belong to the mutated molecule, but not belong to the part of the mutation.
   i_fep_subst = 2    atoms belong to the mutated molecule, and also belong to the part of the mutation.
   i_fep_subst = 98   the atom at the core side of the attachment bond.
   i_fep_subst = 97   the atom at the substitution-group side of the attachment bond.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QWidget: RenderFlag, RenderFlags

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
__init__(self, master, win, mode='desmond')
Constructs an `_LigMut' object with the given parameters: master - the widget that this `_LigMut' object is constructed upon.
 
viewClicked(self, index)
 
resetClicked(self, index)
 
_paint_lig(self, color)
Paints the ligand molecule with the given `color'.
 
setFragTableEnabled(self, should_enable=True)
If `should_enable' is true, enables the "Show" and "Reset" columns of the fragment table.
 
_disect_struc_impl(self, i_atom)
Called by the '_disect_struc' function to separate the molecule that the 'i_atom' belongs to into a new CT.
 
_disect_struc(self, i_atom)
Separates the molecule that the 'i_atom' belongs to into a new CT.
 
getAttachmentAtoms(self)
Returns a tuple, which contains the indices of the two atoms of the attachment bond.
 
prepickBondCallback(self)
This will be called when the user clicks the picking checkbutton of panel.
 
pickBondCallback(self, frag_atom, core_atom)
'frag_atom' and 'core_atom' are the indices of the attachment atoms, and the former is at the substitution-group side, the latter at the core side.
 
_handle_focusin(self)
 
_gen_mutant_impl(self, i_row)
 
_gen_mutant(self, i_row)
Generates a mutated structure with the `i_row' fragment.
 
_show_mutant_impl(self, i_row)
 
_show_mutant(self, i_row)
Displays the mutated structure in the Workspace when user clicks the corresponding radiobutton in the "Show" column.
 
_reset_mutant(self, i_row)
Resets the mutated structure to the default one and displays it in the Workspace when user clicks the corresponding push button in the "Reset" column.
 
selectionChangedCallback(self, ignored1, ignored2)
Monitors the selection of fragments and updates the number of selected items on the GUI.
 
reset(self)
Resets the look of panel.
 
getFragList(self)
Returns a list of strings that are the names of the selected fragments.
 
_getStructs(self, fraglist=[])
Ligand functional group mutation - get a list of structures.
 
getStructures(self, fraglist=[])
Ligand functional group mutation - get a list of structures.

Inherited from PyQt4.QtGui.QWidget: acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsMargins, contentsRect, contextMenuEvent, contextMenuPolicy, create, cursor, customContextMenuRequested, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, enabledChange, ensurePolished, enterEvent, event, find, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontChange, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabGesture, grabKeyboard, grabMouse, grabShortcut, graphicsEffect, graphicsProxyWidget, handle, hasFocus, hasMouseTracking, height, heightForWidth, hide, hideEvent, inputContext, inputMethodEvent, inputMethodHints, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isEnabledToTLW, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isTopLevel, isVisible, isVisibleTo, isWindow, isWindowModified, keyPressEvent, keyReleaseEvent, keyboardGrabber, languageChange, layout, layoutDirection, leaveEvent, locale, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, palette, paletteChange, parentWidget, pos, previousInFocusChain, raise_, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, repaint, resetInputContext, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGraphicsEffect, setHidden, setInputContext, setInputMethodHints, setLayout, setLayoutDirection, setLocale, setMask, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setShortcutAutoRepeat, setShortcutEnabled, setShown, setSizeIncrement, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, topLevelWidget, underMouse, ungrabGesture, unsetCursor, unsetLayoutDirection, unsetLocale, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, winId, window, windowActivationChange, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, x, x11Info, x11PictureHandle, y

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

Inherited from PyQt4.QtGui.QPaintDevice: colorCount, depth, heightMM, logicalDpiX, logicalDpiY, numColors, paintingActive, physicalDpiX, physicalDpiY, widthMM

Inherited from sip.simplewrapper: __new__

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

Class Variables [hide private]
  FRAG_NAME = []
  FRAG_LIB_NAME = 'diverse_fragments'
  ATOM_MARKER = 'i_fep_subst_lig'
  MCPRO_FRAG_NAME = []
  DESMOND_FRAG = ['methyl', 'ethyl', 'hydroxy', 'amino', 'ammoni...

Inherited from PyQt4.QtGui.QWidget: DrawChildren, DrawWindowBackground, IgnoreMask

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Inherited from PyQt4.QtGui.QPaintDevice: PdmDepth, PdmDpiX, PdmDpiY, PdmHeight, PdmHeightMM, PdmNumColors, PdmPhysicalDpiX, PdmPhysicalDpiY, PdmWidth, PdmWidthMM

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, master, win, mode='desmond')
(Constructor)

 

Constructs an `_LigMut' object with the given parameters:
master  - the widget that this `_LigMut' object is constructed upon.
win     - the window object of this panel.
mode    - can be either 'desmond' or 'mcpro' mode. For this particular panel, these two modes have different available
          fragment lists.

Overrides: object.__init__

_getStructs(self, fraglist=[])

 

Ligand functional group mutation - get a list of structures. Returns list of CTs and number of selected rows

getStructures(self, fraglist=[])

 

Ligand functional group mutation - get a list of structures.
- Returns a tuple. The first elements of the tuple is a list of 'Structure' objects, and the second one is the number of selected fragments.
- The 'Structure' objects in the list will be eventually writen out from the panel.
- Some characteristics of the 'Structure' objects in the list are the following:
  environment CTs        0 or more CTs; i_fep_subst = 0; without CT property "s_fep_fragname"
  original molecule CT   1 CT; i_fep_subst = 1, 98, 99, 2; CT property "s_fep_fragname" = "none"
  mutated  molecule CTs  1 or more CTs; i_fep_subst = 1, 98, 99, 2; CT property "s_fep_fragname" = <fragment name>


Class Variable Details [hide private]

DESMOND_FRAG

Value:
['methyl',
 'ethyl',
 'hydroxy',
 'amino',
 'ammonio',
 'carboxy',
 'fluoro',
 'chloro',
...