Package schrodinger :: Package application :: Package matsci :: Module reordergui :: Class ReorderAtomFrame
[hide private]
[frames] | no frames]

Class ReorderAtomFrame

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

A frame which allows the user to reorder the atoms of a comparison structure based on the atom order of a reference structure. The widgets provide the ability to guess at atom order based on multiple algorithms and also manually specify order using 2D images of the structures.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QFrame: Shadow, Shape, StyleMask

Inherited from PyQt4.QtGui.QWidget: RenderFlag, RenderFlags

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
__init__(self, parent=None, by_element=True, by_smiles=True, by_smarts=True, by_superposition=True, layout=None, reference_structure=None, comparison_structure=None)
Create a ReorderAtomFrame widget
 
setStructures(self, reference, comparison)
Set the reference and comparison structures
 
guessMode(self, guessmode)
Set the current guess mode - affects label texts and enabling/disabling widgets and user interaction signals.
 
selectRefAtom(self, index)
Select the current atom in the reference structure
 
mapPair(self, ref_index, comp_index, advance=True, guess=False)
Create a mapping between an atom in the Comparison structure to an atom in the Reference structure.
 
unmapPair(self, ref_index, comp_index)
Create a mapping between an atom in the Comparison structure to an atom in the Reference structure.
 
mapCompAtom(self, comp_index, ref_index=None, auto=True, advance=True)
Map an atom in the Comparison structure to an atom in the Reference structure
 
autoMap(self)
Automatically map no-brainer atoms based on the current mapping.
int
compAtomFromRefAtom(self, index)
Get the atom in the Comparison structure that is mapped to the given index in the Reference structure
int
refAtomFromCompAtom(self, index)
Get the atom in the Reference structure that is mapped to the given index in the Comparison structure
 
highlightCompAtom(self, comp_index)
Highlight an atom in the Comparision structure
 
highlightRefAtom(self, ref_index)
Highlight an atom in the Reference structure
 
highlightMapPair(self, ref_index, comp_index)
Highlight the mapped pair of atoms
 
guessOrder(self)
Make a guess at the new order of the Comparison atoms
 
guessAccepted(self)
User has accpeted the guess, make the atoms truly mapped
 
guessRejected(self)
User has rejected the guess remove it
bool
isInGuessMode(self)
Is the panel currently in guess mode?
 
finishGuess(self)
Finish guess mode after the user has accepted or rejected the guess.
bool
doneReordering(self)
Check if the reordering process is done
schrodinger.structure.Structure, list or (None, None)
getReorderedStructure(self)
Get a reordered version of the comparison structure
 
resetMap(self)
Reset only the map, keeping the structures
 
reset(self, reset_structures=True)
Reset the frame

Inherited from PyQt4.QtGui.QFrame: changeEvent, drawFrame, event, frameRect, frameShadow, frameShape, frameStyle, frameWidth, lineWidth, midLineWidth, paintEvent, setFrameRect, setFrameShadow, setFrameShape, setFrameStyle, setLineWidth, setMidLineWidth, sizeHint

Inherited from PyQt4.QtGui.QWidget: acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsMargins, contentsRect, contextMenuEvent, contextMenuPolicy, create, cursor, customContextMenuRequested, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, enabledChange, ensurePolished, enterEvent, 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, 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, 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, senderSignalIndex, 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]

Inherited from PyQt4.QtGui.QFrame: Box, HLine, NoFrame, Panel, Plain, Raised, Shadow_Mask, Shape_Mask, StyledPanel, Sunken, VLine, WinPanel

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, parent=None, by_element=True, by_smiles=True, by_smarts=True, by_superposition=True, layout=None, reference_structure=None, comparison_structure=None)
(Constructor)

 

Create a ReorderAtomFrame widget

Parameters:
  • parent (QWidget) - The parent widget with a .warning(str) method
  • by_element (bool) - Provide widgets to allow a guess based on lone elements
  • by_smiles (bool) - Provide widgets to allow a guess based on unique SMILES order
  • by_smarts (bool) - Provide widgets to allow a guess based on SMARTS patterns
  • by_superposition (bool) - Provide widgets to allow a guess based on 3D superposition of the structures
  • layout (QBoxLayout) - The layout to place this frame into
  • reference_structure (schrodinger.structure.Structure) - The structure to use as the reference
  • comparison_structure (schrodinger.structure.Structure) - The structure to use as the comparison
Overrides: object.__init__

setStructures(self, reference, comparison)

 

Set the reference and comparison structures

Parameters:

guessMode(self, guessmode)

 

Set the current guess mode - affects label texts and enabling/disabling widgets and user interaction signals.

Parameters:
  • guessmode (bool) - True if a guess is currently taking place and has not yet been Accepted/Rejected, False if any other situation

selectRefAtom(self, index)

 

Select the current atom in the reference structure

Parameters:
  • index (int) - The index of the atom to select

mapPair(self, ref_index, comp_index, advance=True, guess=False)

 

Create a mapping between an atom in the Comparison structure to an atom in the Reference structure.

Parameters:
  • ref_index (int) - The atom index of the reference atom to map
  • comp_index (int) - The atom index of the comparison atom to map
  • advance (bool) - True if the Reference atom selection should be advanced, False if not
  • guess (bool) - True if this mark results from a guess, False if not. The background color used depends on this parameter.

unmapPair(self, ref_index, comp_index)

 

Create a mapping between an atom in the Comparison structure to an atom in the Reference structure.

Parameters:
  • ref_index (int) - The atom index of the reference atom to map
  • comp_index (int) - The atom index of the comparison atom to map

mapCompAtom(self, comp_index, ref_index=None, auto=True, advance=True)

 

Map an atom in the Comparison structure to an atom in the Reference structure

Parameters:
  • comp_index (int) - The atom index of the comparison atom to map
  • ref_index (int or None) - If an int, the index of the reference atom to map to. If not given, the selected reference atom will be used
  • auto (bool) - Whether to Auto guess additional atoms based on this mapping. Default is True - but autoguessing will only occur if the user has checked the Auto guess box.
  • advance (bool) - True if the Reference atom selection should be advanced, False if not

autoMap(self)

 

Automatically map no-brainer atoms based on the current mapping. No-brainer atoms are atoms that are the only atoms remaining of a given element, or hydrogens bound to mapped atoms that can be uniquely identified.

compAtomFromRefAtom(self, index)

 

Get the atom in the Comparison structure that is mapped to the given index in the Reference structure

Parameters:
  • index (int) - The index of the Reference atom to check
Returns: int
The index of the Comparison atom mapped to the given Reference atom

refAtomFromCompAtom(self, index)

 

Get the atom in the Reference structure that is mapped to the given index in the Comparison structure

Parameters:
  • index (int) - The index of the Comparison atom to check
Returns: int
The index of the Reference atom mapped to the given Comparison atom

highlightCompAtom(self, comp_index)

 

Highlight an atom in the Comparision structure

Parameters:
  • comp_index (int) - The index of the comparison atom to highlight

highlightRefAtom(self, ref_index)

 

Highlight an atom in the Reference structure

Parameters:
  • ref_index (int) - The index of the reference atom to highlight

highlightMapPair(self, ref_index, comp_index)

 

Highlight the mapped pair of atoms

Parameters:
  • ref_index (int) - The index of the reference atom to highlight
  • comp_index (int) - The index of the comparison atom to highlight

isInGuessMode(self)

 

Is the panel currently in guess mode?

Returns: bool
True if the panel is in guess mode, False if not

finishGuess(self)

 

Finish guess mode after the user has accepted or rejected the guess.

Note - this method should be callable even if not currently in a guess.

doneReordering(self)

 

Check if the reordering process is done

Returns: bool
True if all the atoms in one of the structures are mapped

getReorderedStructure(self)

 

Get a reordered version of the comparison structure

Returns: schrodinger.structure.Structure, list or (None, None)
The comparison structure with the atoms reordered as specified in the mapping, and the list used to reorder the structure. The first element of the list is the original index of the atom that is first in the reordered structure, the second is the original index of the atom that is second in the reordered structure, etc. (None, None) is returned if the structure is not ready for reordering.

reset(self, reset_structures=True)

 

Reset the frame

Parameters:
  • reset_structures (bool) - True if structures should be reset, False if they should be kept