ccpn.ui.gui.modules package

Modules package

Subpackages

Submodules

ccpn.ui.gui.modules.CcpnModule module

This file contains CcpnModule base class modified by Geerten 1-12/12/2016

class ccpn.ui.gui.modules.CcpnModule.BorderOverlay(parent, borderColour=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Overlay widget that draws a border around the whole of the module ensuring a nice clean edge

paintEvent(ev)[source]

Paint the overlay to the screen

class ccpn.ui.gui.modules.CcpnModule.CcpnModule(mainWindow, name, closable=True, closeFunc=None, settingsScrollBarPolicies=('asNeeded', 'asNeeded'), **kwds)[source]

Bases: pyqtgraph.dockarea.Dock.Dock, ccpn.ui.gui.widgets.DropBase.DropBase, ccpn.core.lib.Notifiers.NotifierBase

Base class for CCPN modules sets self.application, self.current, self.project and self.mainWindow

Overide parameters for settings widget as needed

Usage:

__init__ initialises the module according to the settings given below:

_closeModule closing of the module.

If addition functionality is required, the correct procedure is to override this method within your class and end your method with super()._closeModule()

e.q.
def _closeModule(self):

# your functions here super(<YourModule>, self)._closeModule()

OR __init__ with closeFunc=<your close function>

HORIZONTAL = 'horizontal'
VERTICAL = 'vertical'
className = ''
close()[source]

Close the module from the commandline

defaultSettingsState = 0
dragEnterEvent(self, QDragEnterEvent)[source]
dragLeaveEvent(self, QDragLeaveEvent)[source]
dragMoveEvent(self, QDragMoveEvent)[source]
dropEvent(self, QDropEvent)[source]
enterEvent(self, QEvent)[source]
event(event)[source]

CCPNInternal Handle events for switching transparency of modules Modules become transparent when dragging to another module. Ensure that the dropAreas become active

findWindow()[source]
flashMessage(message)[source]
getDockArea(target=None)[source]
property gid: ccpn.core.lib.Pid.Pid

- ccpn.core.lib.Pid.Pid, immutable -

property id

- None, immutable - The module name without the pid-prefix but including the serial number (if any)

includeSettingsWidget = False
installMaximiseEventHandler(maximiseFunc, closeFunc)[source]

Attach a maximise function to the parent window. This is called when the WindowStateChanges to maximises

Parameters

maximiseFunc

labelOrientation = 'horizontal'
leaveEvent(self, QEvent)[source]
longClassName = 'Module'
property longPid: ccpn.core.lib.Pid.Pid

- ccpn.core.lib.Pid.Pid, immutable - Identifier for the object, unique within the project - added to give label to ccpnModules

maxSettingsState = 3
property moduleName

- None, mutable - Module name as appear on the GUI, without the pid identifier (e.g.: MO:, Module: or GD:, SpectrumDisplay:).

property pid: ccpn.core.lib.Pid.Pid

- ccpn.core.lib.Pid.Pid, immutable - Identifier for the object, unique within the project - added to give label to ccpnModules

property pidFields

- None, immutable - get the three parts of a Pid

removeMaximiseEventHandler()[source]

Clear the attached maximise function :return:

renameModule(newName)[source]

rename the Gui module a

resizeEvent(self, QResizeEvent)[source]
restoreWidgetsState(**widgetsState)[source]

Restore the gui params. To Call it: _setParams(**{“variableName”:”value”})

This is automatically called after every restoration and after the module has been initialised. Subclass this for a custom behaviour. for example custom callback after the widgets have been restored. Subclass like this:

def restoreWidgetsState(self, **widgetsState):

super(TheModule, self).restoreWidgetsState(**widgetsState) #First restore as default # do some stuff

Parameters

widgetsState

setExpandSettingsFlag(value)[source]

Set the expand flag to the True/False

settingsMinimumSizes = (100, 50)
settingsPosition = 'top'
shortClassName = 'MO'
startDrag()[source]
property titleName

- None, immutable - module name without the pid-prefix and serial number (if any)

property widgetsState

- None, immutable - return {“variableName”:”value”} of all gui Variables

class ccpn.ui.gui.modules.CcpnModule.CcpnModuleLabel(name, module, showCloseButton=True, closeCallback=None, enableSettingsButton=False, settingsCallback=None)[source]

Bases: pyqtgraph.dockarea.Dock.DockLabel

Subclassing DockLabel to modify appearance and functionality

TOP_LEFT = 'TOP_LEFT'
TOP_RIGHT = 'TOP_RIGHT'
getMaxIconSize(icon)[source]
property labelName

- None, immutable -

labelSize = 16
mouseDoubleClickEvent(ev)[source]

Handle the double click event

mouseMoveEvent(ev)[source]

Handle the mouse move event to spawn a drag event

mousePressEvent(event: PyQt5.QtGui.QMouseEvent)[source]

Re-implementation of the mouse event so a right mouse context menu can be raised.

paintEvent(ev)[source]

Copied from the parent VerticalLabel class to allow for modification in StyleSheet

resizeEvent(self, QResizeEvent)[source]
setModuleHighlight(hightlighted=False)[source]
setupLabelButton(button, iconName, position)[source]
sigDragEntered
updateStyle()[source]
class ccpn.ui.gui.modules.CcpnModule.DropAreaSelectedOverlay(parent)[source]

Bases: PyQt5.QtWidgets.QWidget

Overlay widget that draws highlight over the current module during a drag-drop operation

paintEvent(ev)[source]

Paint the overlay to the screen

setDropArea(area)[source]

Set the widget coverage, either hidden, or a rectangle covering the module

class ccpn.ui.gui.modules.CcpnModule.LabelNameValidator(parent, labelObj, allowSpace=True)[source]

Bases: PyQt5.QtGui.QValidator

Make sure the newly typed module name on a GUI is unique.

property checkState

- None, immutable -

clearValidCheck()[source]
resetCheck()[source]
validate(self, str, int) Tuple[QValidator.State, str, int][source]
class ccpn.ui.gui.modules.CcpnModule.NameEditor(parent, allowSpace=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.LineEdit.LineEdit

LineEdit widget that contains validator for checking filePaths exists

focusOutEvent(self, QFocusEvent)[source]
show(self)[source]

ccpn.ui.gui.modules.ChemicalShiftTable module

This file contains ChemicalShiftTable class

modified by Geerten 1-7/12/2016 tertiary version by Ejb 9/5/17

class ccpn.ui.gui.modules.ChemicalShiftTable.ChemicalShiftTable(parent=None, mainWindow=None, moduleParent=None, actionCallback=None, selectionCallback=None, chemicalShiftList=None, hiddenColumns=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

Class to present a NmrResidue Table and a NmrChain pulldown list, wrapped in a Widget

PRIMARYCOLUMN = '_object'
addWidgetToTop(widget, col=2, colSpan=1)[source]

Convenience to add a widget to the top of the table; col >= 2

attributeName = 'chemicalShiftLists'
className = 'ChemicalShiftListTable'
clearSelection()[source]

Clear the current selection in the table and remove objects from the current list

columnHeaders = {'_object': '_object', 'allPeaks': 'Assigned Peaks', 'allPeaksCount': 'Total Peak Count', 'atomName': 'AtomName', 'chainCode': 'ChainCode', 'comment': 'Comment', 'figureOfMerit': 'Figure of Merit', 'isDeleted': 'isDeleted', 'nmrAtom': 'NmrAtom', 'orphan': 'Orphaned', 'pid': 'ChemicalShift', 'residueType': 'ResidueType', 'sequenceCode': 'SequenceCode', 'shiftListPeaksCount': 'Peak Count', 'state': 'State', 'uniqueId': 'Unique ID', 'value': 'ChemicalShift Value (ppm)', 'valueError': 'Value Error'}
defaultHidden = ['uniqueId', 'isDeleted', 'figureOfMerit', 'allPeaks', 'chainCode', 'sequenceCode', 'state', 'orphan']
getDataFrameFromExpandedList(table=None, buildList=None, colDefs=None, expandColumn=None)[source]

Return a Pandas dataFrame from an internal list of objects The columns are based on the ‘func’ functions in the columnDefinitions

Parameters
  • buildList

  • colDefs

Return pandas dataFrameObject

populateTable(rowObjects=None, columnDefs=None, selectedObjects=None)[source]

Populate the table with a set of objects to highlight, or keep current selection highlighted with the first item visible.

Use selectedObjects = [] to clear the selected items

Parameters

rowObjects – list of objects to set each row

refreshTable()[source]
setDataFromSearchWidget(dataFrame)[source]

Set the data for the table from the search widget

tipTexts = ('Unique identifier for the chemicalShift', 'isDeleted', 'ChemicalShift.pid', 'ChemicalShift value in ppm', 'Error in the chemicalShift value in ppm', 'Figure of merit, between 0 and 1', 'Pid of nmrAtom if attached, or None', 'ChainCode of attached nmrAtom, or None', 'SequenceCode of attached nmrAtom, or None', 'ResidueType of attached nmrAtom, or None', 'AtomName of attached nmrAtom, or None', 'Active state of chemicalShift', 'Orphaned state of chemicalShift', 'List of assigned peaks associated with this chemicalShift', 'Number of assigned peaks attached to a chemicalShift\nbelonging to spectra associated with parent chemicalShiftList', 'Total number of assigned peaks attached to a chemicalShift\nbelonging to any spectra', 'Optional comment for each chemicalShift', 'None')
class ccpn.ui.gui.modules.ChemicalShiftTable.ChemicalShiftTableModule(mainWindow=None, name='Chemical Shift Table', chemicalShiftList=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a NmrResidueTable instance

activePulldownClass = None
className = 'ChemicalShiftTableModule'
includeSettingsWidget = True
maxSettingsState = 2
settingsPosition = 'left'
ccpn.ui.gui.modules.ChemicalShiftTable.main()[source]

Show the chemicalShiftTable module

ccpn.ui.gui.modules.ChemicalShiftTableWithAssignment module

This file contains AssignmentInspectorModule class

modified by Geerten 1-9/12/2016: - intialisation with ‘empty’ settings possible, - now responsive to current.nmrResidues

class ccpn.ui.gui.modules.ChemicalShiftTableWithAssignment.ChemicalShiftTableWithAssignment(mainWindow, name='Chemical Shift Table', chemicalShiftList=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This Module allows inspection of the NmrAtoms of a selected NmrResidue It responds to current.nmrResidues, taking the last added residue to this list The NmrAtom listWidget allows for selection of the nmrAtom; subsequently its assignedPeaks are displayed.

Position = 'top'
attributeName = 'peaks'
className = 'AssignmentInspectorModule'
getColumns()[source]

get columns for initialisation of table

includeSettingsWidget = True
maxSettingsState = 2

ccpn.ui.gui.modules.ChemicalShiftsMappingModule module

Module Documentation

This module has three sections plus settings:

| TABLE | PLOTS |
Settings | ————- |
| BAR CHART | ——————————-

This module plots a bar chart of NmrResidue number as function of delta shift for its (nmrAtoms) assigned peaks.

** Only NmrResidue with an integer as sequenceCode is allowed **.
E.G.: OK –> sequenceCode = 44;

NO –> sequenceCode = ‘44i-1’;

There are four modes of Deltadelta calculation (Settings): POSITIONS, HEIGHT, VOLUME, LINEWIDTHS

The delta shift for POSITIONS and LINEWIDTHS is calculated from the peak properties as following, assuming the NmrAtoms of interest H and N:

CSPi = √((Δδ_Hi )^2+α(Δδ_Ni )^2 )

The delta shift for HEIGHT and VOLUME is calculated from the peak properties as following:

CSPi = √((Δδ )^2

The peaks used are as default taken from the last peak list for the selected spectra (settings tab). Any sensible combination of NmrAtoms is allowed. See tutorials for more information.

Macros: # Example 1: On a the TStar project with all peaks correctly fitted to their spectra, this macro will show how to

extrapolate data from the CSM module and plot different properties. Paste into the Macro editor Module or directly into the PythonConsole Module and run it.

>>>
import numpy as np
from ccpn.util.Common import splitDataFrameWithinRange
from ccpn.ui.gui.widgets.PlotterWidget import PlotterWidget
from ccpn.ui.gui.modules.NmrResidueTable import KD, Deltas
from ccpn.core.lib.DataFrameObject import  DATAFRAME_OBJECT

moduleName = ‘Chemical Shift Mapping:1’ # The displayed CSM module name you want to get information from. csm = mainWindow.moduleArea.modules[moduleName] tableData = csm.tableData # dataframe as the displayed table. See https://pandas.pydata.org for Pandas documentation. deltasColumn = tableData[Deltas] # name in the table column deltasROI = [np.std(deltasColumn), np.max(deltasColumn)] # Deltas Region of Interest. Min the std of all deltas. kdsROI = [0.01, 0.2] # Kds Region of Interest. inner, outer = splitDataFrameWithinRange(tableData, Deltas, KD, *deltasROI, *kdsROI) # Split the data based on ROIs inner.index = [nr.sequenceCode+” “+nr.residueType for nr in inner.index] # will be used to make labels on the plot. widget = PlotterWidget() plot = widget.plotDataFrame(dataFrame=inner, kind=’bar’,title=’KDs and Deltas’) # See Pandas and Matplotlib for plots customisations. widget.show(windowTitle=’Macro CSM’, size=(500, 500)) >>>

class ccpn.ui.gui.modules.ChemicalShiftsMappingModule.ChemicalShiftsMapping(mainWindow, name='Chemical Shift Mapping', nmrChain=None, **kwds)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

className = 'ChemicalShiftsMapping'
close()[source]

Closes the CSM module

getBindingCurves(nmrResidues)[source]

Gets binding curve as dataFrame for specific NmrResidues. Returns a DataFrame as: Index -> nmrResidue Object, columns: int or float, raw values: int or float

Columns |as the concentration/time/etc value
index | 1 | 2 |

|----------------+--------|——-| | nmrResidue1 | 1.0 | 1.1 | | nmrResidue2 | 2.0 | 1.2 |

includeSettingsWidget = True
maxSettingsState = 2
refresh()[source]

Updates all widgets and data in the CSM module

restoreWidgetsState(**widgetsState)[source]

Restore the gui params. To Call it: _setParams(**{“variableName”:”value”})

This is automatically called after every restoration and after the module has been initialised. Subclass this for a custom behaviour. for example custom callback after the widgets have been restored. Subclass like this:

def restoreWidgetsState(self, **widgetsState):

super(TheModule, self).restoreWidgetsState(**widgetsState) #First restore as default # do some stuff

Parameters

widgetsState

setThresholdValue(value)[source]

Sets the Threshold Line to a new value and updates the graph

settingsPosition = 'left'
showNmrAtomsSettings()[source]
property tableData

- None, immutable - :return: dataFrame containing all data on the Chemical Shift Mapping Module table

Columns | “as the displayed table”
index | # | Index | Pid, _object, Sequence, Deltas, Kd …

|----------------+--------|——-| | 1 | 1 | 1 | | 2 | 2 | 2 |

property thresholdValue

- None, immutable - Gets the threshold value currently displayed on the graph

property widgetsState

- None, immutable - return {“variableName”:”value”} of all gui Variables

ccpn.ui.gui.modules.DataTableModule module

Module Documentation here

class ccpn.ui.gui.modules.DataTableModule.DataTableModule(mainWindow=None, name='DataTable Module', table=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a DataTable instance

activePulldownClass = None
className = 'DataTableModule'
includeNmrChains = False
includePeakLists = False
includeSettingsWidget = False
includeSpectrumTable = False
maxSettingsState = 2
settingsPosition = 'left'
ccpn.ui.gui.modules.DataTableModule.main()[source]

Show the dataTableModule

ccpn.ui.gui.modules.DataTableModuleABC module

class ccpn.ui.gui.modules.DataTableModuleABC.DataTableModuleBC(dataTable=None, mainWindow=None, name='Generic DataTable Module')[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a TableExample instance

className = 'DataTableModule'
includeSettingsWidget = True
maxSettingsState = 2
setDataTable(dataTable)[source]
settingsPosition = 'left'
class ccpn.ui.gui.modules.DataTableModuleABC.GuiDataTableBC(dataTable, parent=None, mainWindow=None, moduleParent=None, allowRowDragAndDrop=True, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

OBJECT = 'object'
TABLE = 'table'
action(*args)[source]
actionCheckBox(*args)[source]
className = 'GuiDataTableBC'
selection(*args)[source]
setDataTable(dataTable)[source]
ccpn.ui.gui.modules.DataTableModuleABC.main()[source]

ccpn.ui.gui.modules.IntegralTable module

class ccpn.ui.gui.modules.IntegralTable.IntegralTable(parent=None, mainWindow=None, moduleParent=None, integralList=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

Class to present a IntegralTable pulldown list, wrapped in a Widget

OBJECT = 'object'
TABLE = 'table'
attributeName = 'integralLists'
className = 'IntegralTable'
displayTableForIntegralList(integralList)[source]

Display the table for the IntegralList”

class ccpn.ui.gui.modules.IntegralTable.IntegralTableModule(mainWindow=None, name='Integral Table', integralList=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a integralTable instance

className = 'IntegralTableModule'
includeSettingsWidget = False
maxSettingsState = 2
selectIntegralList(integralList=None)[source]

Manually select a IL from the pullDown

settingsPosition = 'top'

ccpn.ui.gui.modules.MacroEditor module

class ccpn.ui.gui.modules.MacroEditor.MacroEditor(mainWindow=None, name='MacroEditor', filePath=None)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

Macro editor will run Python Files only.

className = 'MacroEditor'
exportToPdf()[source]
includeSettingsWidget = True
maxSettingsState = 2
openPath(filePath)[source]
restoreWidgetsState(**widgetsState)[source]

Restore the gui params. To Call it: _setParams(**{“variableName”:”value”}) :param widgetsState:

revertChanges()[source]
run()[source]
runProfiler()[source]
saveMacro()[source]

Saves the text inside the textbox to a file, if a file path is not specified, a save file dialog appears for specification of the file path.

saveMacroAs()[source]

Opens a save file dialog and saves the text inside the textbox to a file specified in the dialog.

settingsPosition = 'left'
ccpn.ui.gui.modules.MacroEditor.ShowMaxLines = {'All': 1.0, 'Half': 0.5, 'Minimal': 10, 'Top': 0.2}

Ideas for future development:

  • add local history of files.

E.g.: dumping to json every xMinutes This is not “simply” and undo. But will allow to add a GUI with a preview to older states and recover it. (bit like Pycharm)

macros_dir

myMacro.py myMacro_history.json

{ timeStamp1:”the text at timeStamp1”; timeStamp2:”the text at timeStamp2” }

  • add pre-defined code blocks. E.g.: ccpn common commands or common imports

ccpn.ui.gui.modules.MultipletListTable module

Module Documentation here

class ccpn.ui.gui.modules.MultipletListTable.MultipletListTableWidget(parent=None, mainWindow=None, moduleParent=None, multipletList=None, multiSelect=True, actionCallback=None, selectionCallback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

Class to present a multipletList Table

attributeName = 'multipletLists'
className = 'MultipletListTable'
positionsUnit = 'ppm'
class ccpn.ui.gui.modules.MultipletListTable.MultipletTableModule(mainWindow=None, name='Multiplet Table', multipletList=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a MultipletListTable instance

className = 'MultipletTableModule'
includeSettingsWidget = False
maxSettingsState = 2
selectMultipletList(multipletList=None)[source]

Manually select a multipletList from the pullDown

settingsPosition = 'top'

ccpn.ui.gui.modules.MultipletPeakTable module

Module Documentation here

class ccpn.ui.gui.modules.MultipletPeakTable.MultipletPeakListTableWidget(parent=None, mainWindow=None, moduleParent=None, peakList=None, multiSelect=False, actionCallback=None, selectionCallback=None, **kwds)[source]

Bases: ccpn.ui.gui.modules.PeakTable.PeakListTableWidget

Class to present a peakList Table linked to a multipletTable

attributeName = 'peakLists'
className = 'MultipletPeakListTable'
getIndexList(classItems, attribute)[source]

Get the list of objects on which to before the indexing

ccpn.ui.gui.modules.NmrResidueTable module

This file contains NmrResidueTableModule and NmrResidueTable classes

The NmrResidueModule allows for selection of displays, after which double-clicking a row navigates the displays to the relevant positions and marks the NmrAtoms of the selected NmrResidue.

Geerten 1-7/12/2016; 11/04/2017

class ccpn.ui.gui.modules.NmrResidueTable.NmrResidueTable(parent=None, mainWindow=None, moduleParent=None, actionCallback=None, selectionCallback=None, checkBoxCallback=None, _pulldownKwds=None, nmrChain=None, multiSelect=False, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

Class to present a NmrResidue Table and a NmrChain pulldown list, wrapped in a Widget

OBJECT = 'object'
TABLE = 'table'
addWidgetToPos(widget, row=0, col=2, rowSpan=1, colSpan=1, overrideMinimum=False, alignment=None)[source]

Convenience to add a widget to the top of the table; col >= 2

addWidgetToTop(widget, col=2, colSpan=1)[source]

Convenience to add a widget to the top of the table; col >= 2

attributeName = 'nmrChains'
className = 'NmrResidueTable'
defaultActionCallback(data)[source]

default Action Callback if not defined in the parent Module If current strip contains the double clicked nmrResidue will navigateToPositionInStrip

displayTableForNmrChain(nmrChain)[source]

Display the table for all NmrResidue’s of nmrChain

class ccpn.ui.gui.modules.NmrResidueTable.NmrResidueTableModule(mainWindow=None, name='NmrResidue Table', nmrChain=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a NmrResidueTable instance

activePulldownClass

alias of ccpn.core.NmrChain.NmrChain

className = 'NmrResidueTableModule'
includeDisplaySettings = False
includeNmrChains = False
includePeakLists = False
includeSettingsWidget = True
includeSpectrumTable = False
maxSettingsState = 2
navigateToNmrResidueCallBack(data)[source]

Navigate in selected displays to nmrResidue; skip if none defined

static onDestroyed(widget)[source]
paintEvent(self, QPaintEvent)[source]
selectNmrChain(nmrChain=None)[source]

Manually select an NmrChain from the pullDown

settingsPosition = 'left'

ccpn.ui.gui.modules.NotesEditor module

class ccpn.ui.gui.modules.NotesEditor.NotesEditorModule(mainWindow=None, name='Notes Editor', note=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module for editing the NotesList.

attributeName = 'notes'
className = 'NotesEditorModule'
includeSettingsWidget = False
maxSettingsState = 2
selectNote(note=None)[source]

Manually select a Note from the pullDown

settingsPosition = 'top'

ccpn.ui.gui.modules.ObjectAssigner module

class ccpn.ui.gui.modules.ObjectAssigner.New[source]

Bases: object

Small ‘fake’ object to get a non-nmrAtom in the objectTable. Maybe this should be solved differently. It works well though.

class ccpn.ui.gui.modules.ObjectAssigner.NotOnLine[source]

Bases: object

Small ‘fake’ object to get a message the user in the assignment Table that a specific dimension can not be assigned in one go since the frequencies of the peaks in this dimension are not on one line (i.e. the C frequencies of the CA and CB in a strip for instance). Maybe this should be solved differently. It works well though.

class ccpn.ui.gui.modules.ObjectAssigner.ObjectAssigner(parent, mainWindow, dim, objects, opts, **kwds)[source]

Bases: ccpn.ui.gui.widgets.Widget.Widget

createAssignmentWidget(dim)[source]
createAtomTypePulldown()[source]
createChainPulldown()[source]
createEmptyListWidget(dim, grid)[source]

Can be used to add a new listWidget before setting the content.

createEmptyNmrAtomsTable(grid)[source]

Can be used to add a new table before setting the content.

createEmptyWidgetLabel(dim, objects, grid)[source]
createResTypePulldown()[source]
createSeqCodePulldown()[source]
getNmrAtom(dim, item)[source]
setAtomType(item)[source]
setNmrChain(item)[source]
setResidueType(item)[source]
setSequenceCode(item)[source]

ccpn.ui.gui.modules.PeakTable module

Module Documentation here

class ccpn.ui.gui.modules.PeakTable.PeakListTableWidget(parent=None, mainWindow=None, moduleParent=None, peakList=None, multiSelect=True, actionCallback=None, selectionCallback=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

Class to present a peakList Table

attributeName = 'peakLists'
className = 'PeakListTable'
positionsUnit = 'ppm'
class ccpn.ui.gui.modules.PeakTable.PeakTableModule(mainWindow=None, name='Peak Table', peakList=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a PeakListTable instance

className = 'PeakTableModule'
includeSettingsWidget = False
maxSettingsState = 2
selectPeakList(peakList=None)[source]

Manually select a peakList from the pullDown

settingsPosition = 'top'

ccpn.ui.gui.modules.PipelineModule module

Module Documentation here

class ccpn.ui.gui.modules.PipelineModule.GuiPipeline(mainWindow, name='Pipeline', pipes=None, templates=None, **kwds)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule, ccpn.framework.lib.pipeline.PipelineBase.Pipeline

addPipe(pipeName)[source]
callbackResultWidget()[source]
className = 'GuiPipeline'
currentGuiPipes()[source]

currently displayed pipes

getPipeFromName(pipeName)[source]
property guiPipes

- None, mutable -

includeSettingsWidget = True
maxSettingsState = 2
moduleName = 'Pipeline'
pipeline2Json(path)[source]

save the pipeline state to json file. path: absolute path for a json file

property pipelineTemplates

- None, mutable -

restoreWidgetsState(**widgetsState)[source]
Overriden method from ccpnModule

Special case of restoring widgets for this module.

the only thing to be saved is the filePath of the pipeline. The guiPipeline has its own mechanism for restoring

runPipeline()[source]

Run all pipes in the specified order

setDataSelection()[source]
settingsPosition = 'top'
property widgetsState

- None, immutable - Special case of saving widgets for this module. the only thing to be saved is the filePath of the pipeline. The guiPipeline has its own mechanism for restoring

ccpn.ui.gui.modules.PluginModule module

class ccpn.ui.gui.modules.PluginModule.AutoGeneratedPluginModule(plugin=None, mainWindow=None, application=None)[source]

Bases: ccpn.ui.gui.modules.PluginModule.PluginModule

aborted = False
addRunButton()[source]
className = 'AutoGenerated PluginModule '
maxSettingsState = 2
params = [{}]
settings = [{}]
settingsPosition = 'top'
class ccpn.ui.gui.modules.PluginModule.PluginModule(plugin=None, mainWindow=None, application=None)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

abort()[source]
className = 'PluginModule'
closePlugin()[source]
includeSettingsWidget = True
issueMessage(message)[source]
maxSettingsState = 2
restoreWidgetsState(**widgetsState)[source]

Restore the gui params. To Call it: _setParams(**{“variableName”:”value”})

settingsPosition = 'top'
property widgetsState

- None, immutable - return {“variableName”:”value”} of all gui Variables

class ccpn.ui.gui.modules.PluginModule.TestQt(w=100, h=100)[source]

Bases: object

showWidget(widget)[source]

ccpn.ui.gui.modules.PyMolUtil module

Module Documentation here

class ccpn.ui.gui.modules.PyMolUtil.CodeBlock[source]

Bases: object

A class to concatenate multiple code lines for an easy export to file. Used for creating dynamically scripting files to be handled by external programs. Usage:

CB = CodeBlock() CB.addImport(‘from x import y’) CB.addCmd(‘myFunc’,’astring’, myStr=’BB’, myBool=True, myInt=22, myFloat=1.3) CB.toFile(‘~/testScript.py’) print(str(CB)) out:

from x import y myFunc(“astring”, myStr=”BB”, myBool=True, myInt=22, myFloat=1.3)

addCmd(funcName: str, *args, **kwargs)[source]

add a function call to the block. :param funcName: the function name to be called in the script :param args: any arg that the func needs, in the same original signature order and format. :param kwargs: any kwargs that the func needs, in any order but with the correct formatting.

E.g.:

addCmd(‘cmd.pseudoatom’,’theName’, resn=’PSD’, pos=None, q=0.0, mode=’rms’, quiet=1)

addFreeLine(line)[source]
addImport(theImport, *args, **kwargs)[source]
property fileHeader

- None, mutable - The message that will appear on top of the file, before any code.

toFile(filePath)[source]

dump block to a file

ccpn.ui.gui.modules.PyMolUtil.runPymolWithScript(application, pymolScriptPath)[source]

run pymol executing a script

ccpn.ui.gui.modules.PythonConsoleModule module

Module Documentation here

class ccpn.ui.gui.modules.PythonConsoleModule.PythonConsoleModule(mainWindow, name='Python Console', closeFunc=None, **kwds)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

Gui module to display the Ipyhton console within the program

className = 'PythonConsoleModule'
enterEvent(self, QEvent)[source]
includeSettingsWidget = True
leaveEvent(self, QEvent)[source]
maxSettingsState = 2
settingsPosition = 'top'

ccpn.ui.gui.modules.ReferenceChemicalShifts module

Module documentation here

class ccpn.ui.gui.modules.ReferenceChemicalShifts.ReferenceChemicalShifts(mainWindow, name='Reference Chemical Shifts')[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

className = 'ReferenceChemicalShifts'
includeSettingsWidget = False
maxSettingsState = 2
settingsPosition = 'top'

ccpn.ui.gui.modules.ResidueInformation module

class ccpn.ui.gui.modules.ResidueInformation.ResidueInformation(mainWindow, name='Residue Information', chain=None, **kwds)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module for a residue table and sequence module

activePulldownClass

alias of ccpn.core.Chain.Chain

className = 'ResidueInformation'
includeDisplaySettings = False
includeNmrChains = False
includePeakLists = False
includeSequentialStrips = False
includeSettingsWidget = True
includeSpectrumTable = False
maxSettingsState = 2
settingsPosition = 'left'
textColumns = {'1': ([1], [0, 2]), '3': ([0, 2, 4], (1, 3)), '5': ([0, 1, 3, 5, 6], (2, 4)), '7': ([0, 1, 2, 4, 6, 7, 8], (3, 5))}
textOptions = ['1', '3', '5', '7']

ccpn.ui.gui.modules.ResidueTable module

This file contains ResidueTableModule and ResidueTable classes

class ccpn.ui.gui.modules.ResidueTable.ResidueTable(parent=None, mainWindow=None, moduleParent=None, actionCallback=None, selectionCallback=None, checkBoxCallback=None, chain=None, multiSelect=False, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

Class to present a residue Table and a Chain pulldown list, wrapped in a Widget

OBJECT = 'object'
TABLE = 'table'
addWidgetToPos(widget, row=0, col=2, rowSpan=1, colSpan=1, overrideMinimum=False)[source]

Convenience to add a widget to the top of the table; col >= 2

addWidgetToTop(widget, col=2, colSpan=1)[source]

Convenience to add a widget to the top of the table; col >= 2

attributeName = 'chains'
className = 'ResidueTable'
defaultActionCallback(data, *args)[source]
displayTableForChain(chain)[source]

Display the table for all Residue’s of chain

class ccpn.ui.gui.modules.ResidueTable.ResidueTableModule(mainWindow=None, name='Residue Table', chain=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a ResidueTable instance

className = 'ResidueTableModule'
includeSettingsWidget = False
maxSettingsState = 2
navigateToResidueCallBack(data)[source]
paintEvent(self, QPaintEvent)[source]
selectChain(chain=None)[source]

Manually select an Chain from the pullDown

settingsPosition = 'left'

ccpn.ui.gui.modules.RestraintAnalysisTable module

Module Documentation here

class ccpn.ui.gui.modules.RestraintAnalysisTable.RestraintAnalysisTableModule(mainWindow=None, name='Restraint Analysis Table', peakList=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a RestraintAnalysisTable instance

activePulldownClass = None
className = 'RestraintAnalysisTableModule'
property dataFrame

- None, mutable -

includeDisplaySettings = True
includeNmrChains = False
includePeakLists = False
includeSettingsWidget = True
includeSpectrumTable = False
maxSettingsState = 2
restoreWidgetsState(**widgetsState)[source]

Restore the gui params. To Call it: _setParams(**{“variableName”:”value”})

This is automatically called after every restoration and after the module has been initialised. Subclass this for a custom behaviour. for example custom callback after the widgets have been restored. Subclass like this:

def restoreWidgetsState(self, **widgetsState):

super(TheModule, self).restoreWidgetsState(**widgetsState) #First restore as default # do some stuff

Parameters

widgetsState

selectPeakList(peakList=None)[source]

Manually select a peakList from the pullDown

settingsMinimumSizes = (500, 200)
settingsPosition = 'left'
class ccpn.ui.gui.modules.RestraintAnalysisTable.RestraintAnalysisTableWidget(parent=None, mainWindow=None, moduleParent=None, peakList=None, multiSelect=True, actionCallback=None, selectionCallback=None, hiddenColumns=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

Class to present a Restraint Analysis Table

EXPANDERCOLUMN = 3
ITEMKLASS

alias of ccpn.ui.gui.widgets.TableSorting.MultiColumnTableWidgetItem

MERGECOLUMN = 1
MINSORTCOLUMN = 3
PIDCOLUMN = 1
PRIMARYCOLUMN = '_object'
SPANCOLUMNS = (0, 1, 2, 3)
applySortToGroups = False
attributeName = 'peakLists'
className = 'RestraintAnalysisTable'
defaultHidden = ['Min_1', 'Min_2', 'Min_3', 'Min_4', 'Min_5', 'Min_6', 'Min_7', 'Min_8', 'Min_9', 'Max_1', 'Max_2', 'Max_3', 'Max_4', 'Max_5', 'Max_6', 'Max_7', 'Max_8', 'Max_9', 'Mean_1', 'Mean_2', 'Mean_3', 'Mean_4', 'Mean_5', 'Mean_6', 'Mean_7', 'Mean_8', 'Mean_9', 'STD_1', 'STD_2', 'STD_3', 'STD_4', 'STD_5', 'STD_6', 'STD_7', 'STD_8', 'STD_9']
enableMultiColumnSort = True
getDataFrameFromExpandedList(table=None, buildList=None, colDefs=None, expandColumn=None)[source]

Return a Pandas dataFrame from an internal list of objects The columns are based on the ‘func’ functions in the columnDefinitions

Parameters
  • buildList

  • colDefs

Return pandas dataFrameObject

onSectionClicked(*args)[source]

Respond to reordering the table

populateTable(rowObjects=None, columnDefs=None, selectedObjects=None)[source]

Populate the table with a set of objects to highlight, or keep current selection highlighted with the first item visible.

Use selectedObjects = [] to clear the selected items

Parameters

rowObjects – list of objects to set each row

positionsUnit = 'ppm'
refreshTable()[source]
setDataFromSearchWidget(dataFrame)[source]

Set the data for the table from the search widget

setTableFromDataFrameObject(dataFrameObject, columnDefs=None)[source]

Populate the table from a Pandas dataFrame

updateAutoExpand(expand)[source]

Set the auto-expand/collapsed state for adding new restraintTables, or sorting table

updateMeanLowerLimit(value)[source]

Set the lower limit for visible restraints

updateOutputTables(outputTables)[source]

Update the selected data lists from the parent module

updateRestraintTables(restraintTables)[source]

Update the selected restraint lists from the parent module

updateTableExpanders(expandState=None)[source]

Update the state of the expander buttons

ccpn.ui.gui.modules.RestraintAnalysisTable.main()[source]

ccpn.ui.gui.modules.RestraintTableModule module

Module Documentation here

class ccpn.ui.gui.modules.RestraintTableModule.GuiRestraintTable(parent=None, mainWindow=None, moduleParent=None, restraintTable=None, **kwds)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

Class to present a RestraintTable pulldown list, wrapped in a Widget

OBJECT = 'object'
TABLE = 'table'
addWidgetToTop(widget, col=2, colSpan=1)[source]

Convenience to add a widget to the top of the table; col >= 2

attributeName = 'restraintTables'
className = 'RestraintTable'
displayTableForRestraint(restraintTable)[source]

Display the table for all Restraints”

static getFirstRestraintAtomsPair(restraint)[source]

Get the first pair of atoms from the first restraintContribution of a restraint.

navigateToRestraintInDisplay(display, stripIndex=0, widths=None, showSequentialStructures=False, markPositions=True)[source]

Notifier Callback for selecting Object from item in the table

class ccpn.ui.gui.modules.RestraintTableModule.RestraintTableModule(mainWindow=None, name='Restraint Table', restraintTable=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a restaintsTable instance

className = 'RestraintTableModule'
includeNmrChains = False
includePeakLists = False
includeSettingsWidget = True
includeSpectrumTable = False
maxSettingsState = 2
selectRestraintTable(restraintTable=None)[source]

Manually select a restraintTable from the pullDown

settingsPosition = 'left'

ccpn.ui.gui.modules.SpectrumDisplay1d module

Module Documentation here

class ccpn.ui.gui.modules.SpectrumDisplay1d.SpectrumDisplay1d(mainWindow)[source]

Bases: ccpn.ui.gui.lib.GuiSpectrumDisplay.GuiSpectrumDisplay

MAXPEAKLABELTYPES = 7
MAXPEAKSYMBOLTYPES = 4
adjustContours()[source]
lowerContourBase()[source]

Decreases contour base level for all spectra visible in the display.

processSpectra(pids: Sequence[str], event)[source]

Display spectra defined by list of Pid strings

raiseContourBase()[source]

Increases contour base level for all spectra visible in the display.

setVisibleAxes()[source]

Set which of the axis widgets are visible based on the strip tilePositions and stripArrangement

ccpn.ui.gui.modules.SpectrumDisplayNd module

Module Documentation here

class ccpn.ui.gui.modules.SpectrumDisplayNd.SpectrumDisplayNd(mainWindow)[source]

Bases: ccpn.ui.gui.lib.GuiSpectrumDisplay.GuiSpectrumDisplay

MAXPEAKLABELTYPES = 7
MAXPEAKSYMBOLTYPES = 4
addContourLevel()[source]

Increases number of contours by 1 for all spectra visible in the display.

adjustContours()[source]
lowerContourBase()[source]

Decreases contour base level for all spectra visible in the display.

raiseContourBase()[source]

Increases contour base level for all spectra visible in the display.

removeContourLevel()[source]

Decreases number of contours by 1 for all spectra visible in the display.

updateTraces()[source]

ccpn.ui.gui.modules.StructureTable module

This file contains StructureTableModule and StructureTable classes

class ccpn.ui.gui.modules.StructureTable.GuiTableStructure(*args, **kwargs)[source]

Bases: ccpn.ui.gui.widgets.GuiTable.GuiTable

GuiTable specific to tables that only contain a single pid for the pandas dataframe

class ccpn.ui.gui.modules.StructureTable.StructureTable(parent=None, mainWindow=None, moduleParent=None, structureEnsemble=None, **kwds)[source]

Bases: ccpn.ui.gui.modules.StructureTable.GuiTableStructure

Class to present a StructureTable and a StructureData pulldown list, wrapped in a Widget

OBJECT = 'object'
TABLE = 'table'
addWidgetToTop(widget, col=2, colSpan=1)[source]

Convenience to add a widget to the top of the table; col >= 2

attributeName = 'structureEnsembles'
className = 'StructureTable'
displayTableForDataSetStructure(structureEnsemble)[source]

Display the table for all StructureDataSet

displayTableForStructure(structureEnsemble)[source]

Display the table for all StructureEnsembles

initialiseButtons(index)[source]

Set index of radioButton

navigateToStructureInDisplay(display, stripIndex=0, widths=None, showSequentialStructures=False, markPositions=True)[source]

Notifier Callback for selecting Object from item in the table

objectClass = 'StructureEnsemble'
class ccpn.ui.gui.modules.StructureTable.StructureTableModule(mainWindow=None, name='Structure Table', structureEnsemble=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a StructureTable instance

className = 'StructureTableModule'
includeNmrChains = False
includePeakLists = False
includeSettingsWidget = True
includeSpectrumTable = False
maxSettingsState = 2
selectStructureEnsemble(structureEnsemble=None)[source]

Manually select a StructureEnsemble from the pullDown

settingsPosition = 'left'

ccpn.ui.gui.modules.ViolationTableModule module

Module Documentation here

class ccpn.ui.gui.modules.ViolationTableModule.ViolationTableModule(mainWindow=None, name='ViolationTable Module', table=None, selectFirstItem=False)[source]

Bases: ccpn.ui.gui.modules.CcpnModule.CcpnModule

This class implements the module by wrapping a ViolationTable instance

activePulldownClass = None
className = 'ViolationTableModule'
includeNmrChains = False
includePeakLists = False
includeSettingsWidget = False
includeSpectrumTable = False
maxSettingsState = 2
settingsPosition = 'left'
ccpn.ui.gui.modules.ViolationTableModule.main()[source]

Show the dataTableModule