ccpn.ui.gui.lib package

Module Documentation here

Subpackages

Submodules

ccpn.ui.gui.lib.ChangeStateHandler module

Module Documentation here

class ccpn.ui.gui.lib.ChangeStateHandler.ChangeDict(enabled=True, *args, **kwds)[source]

Bases: collections.OrderedDict

Dict that contains the changes that are applied to a popup Can be enabled or disabled

blockChanges()[source]

Block all changes to the dict

property enabled

- None, mutable -

class ccpn.ui.gui.lib.ChangeStateHandler.changeState(widget, allChanges, applyState, revertState, okButton, applyButton, revertButton, numApplies)

Bases: tuple

allChanges

Alias for field number 1

applyButton

Alias for field number 5

applyState

Alias for field number 2

numApplies

Alias for field number 7

okButton

Alias for field number 4

revertButton

Alias for field number 6

revertState

Alias for field number 3

widget

Alias for field number 0

ccpn.ui.gui.lib.GuiGenerator module

ccpn.ui.gui.lib.GuiGenerator.generateWidget(params, widget, argsDict=None, columns=1)[source]
ccpn.ui.gui.lib.GuiGenerator.selectedRadioButton(self, argsDict, param)[source]

ccpn.ui.gui.lib.GuiIntegralListView module

Get the regions between two peak Limits and fill the area under the curve.

class ccpn.ui.gui.lib.GuiIntegralListView.GuiIntegralListView[source]

Bases: ccpn.ui.gui.lib.GuiListView.GuiListViewABC

integralList is the CCPN wrapper object

ccpn.ui.gui.lib.GuiListView module

Module Documentation here

class ccpn.ui.gui.lib.GuiListView.GuiListViewABC[source]

Bases: PyQt5.QtWidgets.QGraphicsItem

Base class for gui<Type>ListView objects

boundingRect(self) QRectF[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
setDisplayed(visible)[source]
setVisible(self, bool)[source]

ccpn.ui.gui.lib.GuiMainWindow module

This Module implements the main graphics window functionality It works in concert with a wrapper object for storing/retrieving attibute values

class ccpn.ui.gui.lib.GuiMainWindow.GuiMainWindow(application=None)[source]

Bases: ccpn.ui.gui.lib.GuiWindow.GuiWindow, PyQt5.QtWidgets.QMainWindow

WindowMaximiseMinimise
changeEvent(self, QEvent)[source]
clearLogFile()[source]
closeEvent(event: PyQt5.QtGui.QCloseEvent) None[source]

handle close event from the X button

getMenuAction(menuString, topMenuAction=None)[source]
keyPressEvent(self, QKeyEvent)[source]
makeDisabledFileIcon(icon)[source]
property modules

- None, immutable - Return tuple of modules currently displayed

newMacroFromLog()[source]

Displays macro editor with contents of the log.

printToFile()[source]
property project: ccpn.core.Project.Project

- ccpn.core.Project.Project, immutable - The current project

redo()[source]
saveLogFile()[source]
searchMenuAction(menuString, topMenuAction=None)[source]
showNefPopup(path=None)[source]

Query for a Nef file if path is None Opens the Nef import popup If path specified then opens popup to the file otherwise opens load dialog

startPlugin(Plugin)[source]
property ui

- None, immutable - The application.ui instance; eg. the gui

undo()[source]

ccpn.ui.gui.lib.GuiMultipletListView module

Module Documentation here

class ccpn.ui.gui.lib.GuiMultipletListView.GuiMultipletListView[source]

Bases: ccpn.ui.gui.lib.GuiListView.GuiListViewABC

multipletList is the CCPN wrapper object

ccpn.ui.gui.lib.GuiNotifier module

Notifier extensions for Gui objects, wrapping it into a class that also acts as the called function, displatching the ‘user’ callback if required. The Notifier can be defined relative to any valid V3 Widget object as it first checks if the triggered signature is valid.

The callback function is passed a callback dictionary with relevant info (see docstring of Notifier class. This idea was copied from the Traitlets package.

Very similar (and if fact based upon) the Notifier Class for core objects, but separate to keep graphics code isolated

April 2017: First design by Geerten Vuister

class ccpn.ui.gui.lib.GuiNotifier.GuiNotifier(theObject: Any, triggers: list, targetName: list, callback: Callable[[...], Optional[str]], debug=False, **kwargs)[source]

Bases: ccpn.core.lib.Notifiers.NotifierABC

GuiNotifier class:

triggers callback function with signature: callback(callbackDict [, *args] [, **kwargs])

Notifier.DROPEVENT [dropTargets] theObject, theObject should inherit from QtWidgets.QWidget

and be droppable

targetName targetName: optional dropTargets to filter for

before callback (None to skip), as defined in DropBase

trigger, notifier, event, isCcpnJson, [dropTargets]

dropTargets: keywords defining type of dropped objects: currently implemented: ‘urls’, ‘text’, ‘pids’ (see DropBase)

Implemention:

The callback provides a dict with several key, value pairs and optional arguments and/or keyword arguments if defined in the instantiation of the Notifier object. (idea following the Traitlets concept). Note that this dict also contains a reference to the GuiNotifier object itself; this way it can be used to pass-on additional implementation specfic information to the callback function.

On Intialisation, the GuiNotifier instance sets the appropriate callback functions of the widget, as defined in DropBase, from which each Ccpn-Widget derives.

DRAGMOVEEVENT = 'dragMoveEvent'
DROPEVENT = 'dropEvent'
ENTEREVENT = 'enterEvent'
unRegister()[source]

unregister the notifiers

ccpn.ui.gui.lib.GuiNotifier.skip(*args, **kwargs)[source]

Do nothing

ccpn.ui.gui.lib.GuiPath module

Module Documentation here

class ccpn.ui.gui.lib.GuiPath.PathEdit(parent, fileMode='Path', **kwds)[source]

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

LineEdit widget that contains validator for checking filePaths exists

class ccpn.ui.gui.lib.GuiPath.PathValidator(parent=None, fileMode='Path')[source]

Bases: PyQt5.QtGui.QValidator

property checkState

- None, immutable -

clearValidCheck()[source]
resetCheck()[source]
validate(self, str, int) Tuple[QValidator.State, str, int][source]

ccpn.ui.gui.lib.GuiPeakListView module

Module Documentation here

class ccpn.ui.gui.lib.GuiPeakListView.GuiPeakListView[source]

Bases: ccpn.ui.gui.lib.GuiListView.GuiListViewABC

peakList is the CCPN wrapper object

ccpn.ui.gui.lib.GuiSpectrumDisplay module

Module Documentation here

class ccpn.ui.gui.lib.GuiSpectrumDisplay.GuiSpectrumDisplay(mainWindow, useScrollArea=False)[source]

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

Main spectrum display Module object.

This module inherits the following attributes from the SpectrumDisplay wrapper class:

title Name of spectrumDisplay;

:return <str>

stripDirection Strip axis direction

:return <str>:(‘X’, ‘Y’, None) - None only for non-strip plots

stripCount Number of strips

:return <str>.

comment Free-form text comment

comment = <str> :return <str>

axisCodes Fixed string Axis codes in original display order

:return <tuple>:(X, Y, Z1, Z2, …)

axisOrder String Axis codes in display order, determine axis display order

axisOrder = <sequence>:(X, Y, Z1, Z2, …) :return <tuple>:(X, Y, Z1, Z2, …)

is1D True if this is a 1D display

:return <bool>

window Gui window showing SpectrumDisplay

window = <Window> :return <Window>

nmrResidue NmrResidue attached to SpectrumDisplay

nmrResidue = <NmrResidue> :return <NmrResidue>

positions Axis centre positions, in display order

positions = <Tuple> :return <Tuple>

widths Axis display widths, in display order

widths = <Tuple> :return <Tuple>

units Axis units, in display order

:return <Tuple>

resetAxisOrder Reset display to original axis order findAxis Find axis

findAxis(axisCode)

:param axisCode :return axis

MAXPEAKLABELTYPES = 0
MAXPEAKSYMBOLTYPES = 0
addStrip(strip=None) GuiStripNd[source]

Creates a new strip by cloning strip with index (default the last) in the display.

attachZPlaneWidgets()[source]

Attach the strip zPlane navigation widgets for the strips to the correct containers

autoRange()[source]

Zooms Y axis of current strip to show entire region.

clearContourAttributes()[source]

Clear all the contour attributes associated with the spectrumViews in the spectrumDisplay Attributes will revert to the spectrum values

clearSpectra()[source]
Returns

remove all displayed spectra

property columnCount

- None, immutable - Strip column count. This is independent of the stripArrangement and always returns the same value. If stripArrangement is ‘Y’, strips are in a row and ‘column’ will return the visible column count If stripArrangement is ‘X’, strips are in a column and ‘column’ will return the visible row count

copyContourAttributesFromSpectra()[source]

Copy all the contour attributes associated with a spectrumView.spectrum to the spectrumView for all spectrumViews in the spectrumDisplay

decreaseStripSize()[source]

Decrease the width/height of the strips depending on the orientation

decreaseTraceScale()[source]
deleteStrip(strip)[source]

Delete a strip from the spectrumDisplay

Parameters

strip – strip to delete as object or pid

displaySpectrum(spectrum)[source]

Display spectrum, with spectrum axes ordered according to display axisCodes :return SpectrumView instance or None

getSpectrumViewFromSpectrum(spectrum)[source]

Get the local spectrumView linked to the spectrum

getVisibleSpectra() list[source]

Return a list of spectra currently visible in the spectrumDisplay

hideAllStripHeaders(handle=None)[source]

Convenience to hide headers of all strips

hideSpectrumToolbar()[source]

hide the spectrum toolbar

hideToolbar()[source]

hide the toolbar

includeSettingsWidget = True
increaseStripSize()[source]

Increase the width/height of the strips depending on the orientation

increaseTraceScale()[source]
property isGrouped

- None, mutable - Return whether the spectrumDisplay contains grouped spectra

makeStripPlot(peaks=None, nmrResidues=None, autoClearMarks=True, sequentialStrips=True, markPositions=True, widths=None)[source]

Make a list of strips in the current spectrumDisplay based on the list of peaks or the list of nmrResidues passing in Can only choose either peaks or nmrResidues, peaks chosen will override any selected nmrResidues

maxSettingsState = 2
removeCurrentStrip()[source]

Remove current.strip if it belongs to self.

removePhasingTraces()[source]

Removes all phasing traces from all strips.

removeSpectrum(spectrum)[source]

Remove a spectrum from the spectrumDisplay

renameModule(name)[source]

rename the Gui module a

resizeEvent(self, QResizeEvent)[source]
restoreSpectrumState(discard=False)[source]

Restore the state for this widget

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

property rowCount

- None, immutable - Strip row count. This is independent of the stripArrangement and always returns the same value. If stripArrangement is ‘Y’, strips are in a row and ‘row’ will return the visible row count If stripArrangement is ‘X’, strips are in a column and ‘row’ will return the visible column count

setColumnStretches(stretchValue=False, scaleFactor=1.0, widths=True, minimumWidth=None, deletingStrip=False)[source]

Set the column widths of the strips so that the last strip accommodates the axis bar if necessary.

setHorizontalTraces(trace)[source]
setLastAxisOnly(lastAxisOnly: bool = True)[source]
setScrollbarPolicies(horizontal='asNeeded', vertical='asNeeded')[source]

Set the scrolbar policies; convenience to expose to the user

setToolbarButtons()[source]

Setup the buttons in the toolbar for each spectrum

setVerticalTraces(trace)[source]
setVisibleAxes()[source]

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

setVisibleSpectrum(spectrum, visible)[source]

Toggle on/off a spectrum from the visible spectra :param spectrum: :param visible: bool. True to show, False to hide :return:

settingsMinimumSizes = (250, 50)
settingsPosition = 'left'
showAllStripHeaders(handle=None)[source]

Convenience to show headers of all strips

showAxes(strips=None, stretchValue=False, widths=True, minimumWidth=100, deletingStrip=False)[source]
showSpectrumToolbar()[source]

show the spectrum toolbar

showToolbar()[source]

show the toolbar

property stripArrangement

- None, mutable - Strip axis direction (‘X’, ‘Y’, ‘T’, None) - None only for non-strip plots

stripAtTilePosition(tilePosition: Tuple[int, int]) Strip[source]

Return the strip at a given tilePosition

stripColumn()[source]

Return the ordered stripColumn at a given column tilePositions are independent of stripArrangement

stripRow()[source]

Return the ordered stripRow at a given row tilePositions are independent of stripArrangement

toggleCrosshair()[source]

Toggles whether cross hair is displayed in all strips of spectrum display.

toggleDoubleCrosshair()[source]

Toggles whether double cross hairs are displayed in all strips of spectrum display.

toggleGrid()[source]

Toggles whether grid is displayed in all strips of spectrum display.

toggleHTrace()[source]
togglePhaseConsole()[source]

Toggles whether phasing console is displayed.

toggleSideBands()[source]

Toggles whether sideBands are displayed in all strips of spectrum display.

toggleSpectrumToolbar()[source]

Toggle the spectrum toolbar

toggleToolbar()[source]

Toggle the toolbar

toggleVTrace()[source]
updateSpectrumTraces()[source]

Add traces to all strips

property zPlaneNavigationMode

- None, mutable - Position of the zPlane navigation buttons

class ccpn.ui.gui.lib.GuiSpectrumDisplay.ScrollAreaWithPredicateStylesheet(styleSheetTemplate, predicate, mutator, *args, **kwds)[source]

Bases: ccpn.ui.gui.widgets.ScrollArea.ScrollArea

checkPredicate()[source]
modifyStyleSheet(predicate)[source]
resizeEvent(self, QResizeEvent)[source]
ccpn.ui.gui.lib.GuiSpectrumDisplay.styleSheetMutator(styleSheetTemplate, predicate, clazz)[source]
ccpn.ui.gui.lib.GuiSpectrumDisplay.styleSheetPredicate(target)[source]

ccpn.ui.gui.lib.GuiSpectrumView module

Module Documentation here

class ccpn.ui.gui.lib.GuiSpectrumView.GuiSpectrumView[source]

Bases: PyQt5.QtWidgets.QGraphicsObject

getTraceParameters(position, dim)[source]
paint(self, QPainter, QStyleOptionGraphicsItem, widget: QWidget = None)[source]
refreshData()[source]
setDisplayed(visible)[source]

Change visible state of the spectrumView

setVisible(visible)[source]

Change visible state of the spectrumView

class ccpn.ui.gui.lib.GuiSpectrumView.SpectrumViewParams(valuePerPoint, pointCount, minAliasedFrequency, maxAliasedFrequency, minSpectrumFrequency, maxSpectrumFrequency, axisReversed, spectralWidth, aliasingIndex, foldingMode, regionBounds, minFoldingFrequency, maxFoldingFrequency, isTimeDomain)

Bases: tuple

aliasingIndex

Alias for field number 8

axisReversed

Alias for field number 6

foldingMode

Alias for field number 9

isTimeDomain

Alias for field number 13

maxAliasedFrequency

Alias for field number 3

maxFoldingFrequency

Alias for field number 12

maxSpectrumFrequency

Alias for field number 5

minAliasedFrequency

Alias for field number 2

minFoldingFrequency

Alias for field number 11

minSpectrumFrequency

Alias for field number 4

pointCount

Alias for field number 1

regionBounds

Alias for field number 10

spectralWidth

Alias for field number 7

valuePerPoint

Alias for field number 0

class ccpn.ui.gui.lib.GuiSpectrumView.TraceParameters(inRange, pointPositions, startPoint, endPoint)

Bases: tuple

endPoint

Alias for field number 3

inRange

Alias for field number 0

pointPositions

Alias for field number 1

startPoint

Alias for field number 2

ccpn.ui.gui.lib.GuiSpectrumView1d module

Module Documentation here

class ccpn.ui.gui.lib.GuiSpectrumView1d.GuiSpectrumView1d[source]

Bases: ccpn.ui.gui.lib.GuiSpectrumView.GuiSpectrumView

buildContours = True
buildContoursOnly = False
getVisibleState(dimensionCount=None)[source]

Get the visible state for the X/Y axes

hPhaseTrace = None
refreshData()[source]

ccpn.ui.gui.lib.GuiSpectrumViewNd module

Module Documentation here

class ccpn.ui.gui.lib.GuiSpectrumViewNd.AxisPlaneData(startPoint, endPoint, pointCount)

Bases: tuple

endPoint

Alias for field number 1

pointCount

Alias for field number 2

startPoint

Alias for field number 0

class ccpn.ui.gui.lib.GuiSpectrumViewNd.GuiSpectrumViewNd[source]

Bases: ccpn.ui.gui.lib.GuiSpectrumView.GuiSpectrumView

getVisibleState(dimensionCount=None)[source]

Get the visible state for the X/Y axes

refreshData()[source]
property traceScale: float

- float, mutable - Scale for trace in this spectrumView

ccpn.ui.gui.lib.GuiStrip module

Module Documentation here

class ccpn.ui.gui.lib.GuiStrip.GuiStrip(spectrumDisplay)[source]

Bases: ccpn.ui.gui.widgets.Frame.Frame

property aliasEnabled

- None, mutable - Get aliasEnabled for the strip

property aliasLabelsEnabled

- None, mutable - Get aliasLabelsEnabled for the strip

property aliasShade

- None, mutable - Get aliasShade for the strip

autoRange()[source]
calibrateFromPeaks()[source]
clearMarks()[source]

Sets the marks at current position

close(self) bool[source]
property contextMenuMode

- None, mutable -

property contourThickness

- None, mutable - Get the contour thickness for the strip

createMark()[source]

Sets the marks at current position

createPeak(ppmPositions: List[float]) Tuple[Tuple[ccpn.core.Peak.Peak, ...], Tuple[ccpn.core.PeakList.PeakList, ...]][source]

Create peak at position for all spectra currently displayed in strip.

property crosshairVisible

- None, mutable - True if crosshair is visible.

cyclePeakSymbols()[source]

Cycle through peak symbol types.

cycleSymbolLabelling()[source]

Toggles whether peak labelling is minimal is visible in the strip.

property doubleCrosshairVisible

- None, mutable - True if doubleCrosshair is visible.

estimateNoise()[source]

Estimate noise in the current region

firstVisibleSpectrum()[source]

return the first visible spectrum in the strip, or the first if none are visible.

getAxesVisible()[source]

Get the visibility of strip axes

getAxisPosition(axisIndex)[source]
getAxisRegion(axisIndex)[source]

Return the region currently displayed in the strip as tuple(min, max) for given axis. axisIndex is the screen axis; X is 0, Y is 1

getAxisRegions() Tuple[Tuple, ...][source]

Return a tuple if tuples for the regions ((min, max), …) Visible direction of axes is not preserved

getAxisWidth(axisIndex)[source]
getBottomAxisHeight()[source]

return the height of the bottom axis margin

getObjectsUnderMouse()[source]

Get the selected objects currently under the mouse

getRightAxisWidth()[source]

return the width of the right axis margin

getStackingMode()[source]
property gridVisible

- None, mutable - True if grid is visible.

mainViewSize()[source]

Return the width/height for the mainView of the OpenGL widget

makeStripPlot(includePeakLists=True, includeNmrChains=True, includeSpectrumTable=False)[source]

Make a strip plot in the current spectrumDisplay

markAxisIndices(indices=None)[source]

Mark the X/Y/XY axisCodes by index

moveTo(newIndex: int)[source]

Move strip to index newIndex in orderedStrips.

property multipletLabelsEnabled

- None, mutable - Get multipletLabelsEnabled for the strip

navigateToPeak(peak, widths: Optional[List[float]] = None)[source]

Navigate to peak.position, optionally setting widths of this Strip

navigateToPosition(positions: List[float], axisCodes: Optional[List[str]] = None, widths: Optional[List[float]] = None)[source]

Navigate to positions, optionally setting widths of this Strip

optionsChanged
property peakLabelsEnabled

- None, mutable - Get peakLabelsEnabled for the strip

pickPeaks(regions: List[Tuple[float, float]]) list[source]

Peak-pick in regions for all spectra currently displayed in the strip. :param regions: a list of (minVal,maxVal) tuples in display order :return a list of Peak instances

refresh()[source]

Refresh the display for strip and redraw contours

refreshDevicePixelRatio()[source]

Set the devicePixel ratio in the GL window

removePhasingTraces()[source]
report()[source]

Generate a drawing object that can be added to reports :return reportlab drawing object:

resetZoom()[source]
resizeEvent(self, QResizeEvent)[source]
restoreZoomFromState(zoomState)[source]

Restore zoom from a saved state :param zoomState: list of Axis coordinate Left, Right, Bottom, Top

setAspectRatioMode(mode)[source]
setAxesVisible(rightAxisVisible=True, bottomAxisVisible=False)[source]

Set the visibility of strip axes

setAxisPosition(axisIndex, position, rescale=True, update=True)[source]

Set the axis position of the strip if rescale is False, the symbols, etc., must explicitly be refreshed

setAxisRegion(axisIndex, width, rescale=True, update=True)[source]

Set the axis region for the strip. if rescale is False, the symbols, etc., must explicitly be refreshed

setAxisWidth(axisIndex, width, rescale=True, update=True)[source]

Set the axis width of the strip, centred on the axis position if rescale is False, the symbols, etc., must explicitly be refreshed

setBottomAxisVisible(axisVisible=False)[source]

Set the visibility of the bottom axis

setFixedAspectRatios(ratios)[source]
setPeakSymbols(value)[source]

set the peak symbol type.

setRightAxisVisible(axisVisible=False)[source]

Set the visibility of the right axis

setStackingMode(value)[source]
setStripNotifiers()[source]

Set the notifiers for the strip.

setSymbolLabelling(value)[source]

Toggles whether peak labelling is minimal is visible in the strip.

setTraceScale(traceScale)[source]
property sideBandsVisible

- None, mutable - True if sideBands are visible.

property spectrumBordersVisible

- None, mutable - True if spectrumBorders are visible.

stripResized
property symbolLabelling

- None, mutable - Get the symbol labelling for the strip

property symbolSize

- None, mutable - Get the symbol size for the strip

property symbolThickness

- None, mutable - Get the symbol thickness for the strip

property symbolType

- None, mutable - Get the symbol type for the strip

toggleGrid()[source]

Toggles whether grid is visible in the strip.

toggleNoiseThresholdLines()[source]
toggleSideBands()[source]

Toggles whether sideBands are visible in the strip.

turnOffPhasing()[source]
turnOnPhasing()[source]
updateAxisRatios()[source]
viewRange()[source]
zoom(xRegion: Tuple[float, float], yRegion: Tuple[float, float])[source]

Zooms strip to the specified region.

property zoomState

- None, immutable -

zoomX(x1: float, x2: float)[source]

Zooms x axis of strip to the specified region

zoomY(y1: float, y2: float)[source]

Zooms y axis of strip to the specified region

ccpn.ui.gui.lib.GuiStrip1d module

Module Documentation here

class ccpn.ui.gui.lib.GuiStrip1d.GuiStrip1d(spectrumDisplay)[source]

Bases: ccpn.ui.gui.lib.GuiStrip.GuiStrip

Strip class for display of 1D spectra

This module inherits the following attributes from the Strip wrapper class:

axisCodes Fixed string Axis codes in original display order

:return <tuple>:(X, Y, Z1, Z2, …)

axisOrder String Axis codes in display order, determine axis display order

axisOrder = <sequence>:(X, Y, Z1, Z2, …) :return <tuple>:(X, Y, Z1, Z2, …)

positions Axis centre positions, in display order

positions = <Tuple> :return <Tuple>:(<float>, …)

widths Axis display widths, in display order

widths = <Tuple> :return <Tuple>:(<float>, …)

units Axis units, in display order

:return <Tuple>

spectra List of the spectra attached to the strip
(whether display is currently turned on or not)

:return <Tuple>:(<Spectrum>, …)

delete Delete a strip clone Create new strip that duplicates this one, appending it at the end moveTo Move strip to index newIndex in orderedStrips

moveTo(newIndex:int)

:param newIndex:<int> new index position

findAxis Find axis
findAxis(axisCode)
param axisCode

:return axis

displaySpectrum Display additional spectrum on strip, with spectrum axes ordered according to axisOrder
displaySpectrum(spectrum:Spectrum, axisOrder:Sequence=()

:param spectrum:<Spectrum> additional spectrum to display :param axisOrder:<Sequence>=() new axis ordering

peakIsInPlane Return whether the peak is in currently displayed planes for strip
peakIsInPlane(peak:Peak)

:param peak:<Peak> peak of interest :return <bool>

peakIsInFlankingPlane Return whether the peak is in planes flanking currently displayed planes for strip
peakIsInFlankingPlane(peak:Peak)

:param peak:<Peak> peak of interest :return <bool>

peakPickPosition Pick peak at position for all spectra currently displayed in strip
peakPickPosition(position:List[float])

:param position:<List> coordinates to test :return <Tuple>:(<Peak>, …)

peakPickRegion Peak pick all spectra currently displayed in strip in selectedRegion
selectedRegion:List[List[float])

:param selectedRegion:<List> of <List> of coordinates to test :return <Tuple>:(<Peak>, …)

autoRange()[source]
flipXYAxis()[source]

Flip the X and Y axes

flipXZAxis()[source]

Flip the X and Y axes

flipYZAxis()[source]

Flip the X and Y axes

getStackingMode()[source]
setStackingMode(value)[source]
showExportDialog()[source]

show the export strip to file dialog

property symbolType

- None, mutable - Get the symbol type for the strip

toggleCalibrateX()[source]
toggleCalibrateY()[source]
toggleHorizontalTrace()[source]

Toggles whether or not horizontal trace is displayed.

toggleNoiseThresholdLines(*args)[source]
toggleVerticalTrace()[source]

Toggles whether or not vertical trace is displayed.

ccpn.ui.gui.lib.GuiStripContextMenus module

A File containing all the context menus of a gui Strip. To create a menu:

  • make a list of objs of type _SCMitem

  • call the function _createMenu, give the strip where the context menu will be needed and the list of items

ccpn.ui.gui.lib.GuiStripNd module

This widget implements the nD (n>2) strip. Strips are contained within a SpectrumDisplay.

Some of the available methods:

changeZPlane(n:int=0, planeCount:int=None, position:float=None): Changes the position

of the z axis of the strip by number of planes or a ppm position, depending on which is specified.

nextZPlane(n:int=0): Decreases z ppm position by one plane prevZPlane(n:int=0): Decreases z ppm position by one plane

resetZoom(axis=None): Resets zoom of strip axes to limits of maxima and minima of

the limits of the displayed spectra.

toggleHorizontalTrace(self): Toggles display of the horizontal trace. toggleVerticalTrace(self): Toggles display of the vertical trace.

setStripLabelText(text:str): set the text of the stripLabel getStripLabelText() -> str: get the text of the stripLabel showStripLabel(doShow:bool): show/hide the stripLabel

class ccpn.ui.gui.lib.GuiStripNd.GuiStripNd(spectrumDisplay)[source]

Bases: ccpn.ui.gui.lib.GuiStrip.GuiStrip

Strip class for display of nD spectra

This module inherits the following attributes from the Strip wrapper class:

axisCodes Fixed string Axis codes in original display order

:return <tuple>:(X, Y, Z1, Z2, …)

axisOrder String Axis codes in display order, determine axis display order

axisOrder = <sequence>:(X, Y, Z1, Z2, …) :return <tuple>:(X, Y, Z1, Z2, …)

positions Axis centre positions, in display order

positions = <Tuple> :return <Tuple>:(<float>, …)

widths Axis display widths, in display order

widths = <Tuple> :return <Tuple>:(<float>, …)

units Axis units, in display order

:return <Tuple>

spectra List of the spectra attached to the strip
(whether display is currently turned on or not)

:return <Tuple>:(<Spectrum>, …)

delete Delete a strip clone Create new strip that duplicates this one, appending it at the end moveTo Move strip to index newIndex in orderedStrips

moveTo(newIndex:int)

:param newIndex:<int> new index position

findAxis Find axis
findAxis(axisCode)
param axisCode

:return axis

displaySpectrum Display additional spectrum on strip, with spectrum axes ordered according to axisOrder
displaySpectrum(spectrum:Spectrum, axisOrder:Sequence=()

:param spectrum:<Spectrum> additional spectrum to display :param axisOrder:<Sequence>=() new axis ordering

peakIsInPlane Return whether the peak is in currently displayed planes for strip
peakIsInPlane(peak:Peak)

:param peak:<Peak> peak of interest :return <bool>

peakIsInFlankingPlane Return whether the peak is in planes flanking currently displayed planes for strip
peakIsInFlankingPlane(peak:Peak)

:param peak:<Peak> peak of interest :return <bool>

peakPickPosition Pick peak at position for all spectra currently displayed in strip
peakPickPosition(position:List[float])

:param position:<List> coordinates to test :return <Tuple>:(<Peak>, …)

peakPickRegion Peak pick all spectra currently displayed in strip in selectedRegion
selectedRegion:List[List[float])

:param selectedRegion:<List> of <List> of coordinates to test :return <Tuple>:(<Peak>, …)

copyStrip()[source]

Copy the strip into new SpectrumDisplay

extractVisiblePlanes(openInSpectrumDisplay=True) list[source]

Extract all visible planes of strip to file, creating a Spectrum instance for each plane :param openInSpectrumDisplay: optionally open in a new SpectrumDisplay :returns: a list of Spectrum instances

flipXYAxis()[source]

Flip the X and Y axes :return A new SpectrumDisplay instance

flipXZAxis()[source]

Flip the X and Z axes :return A new SpectrumDisplay instance

flipYZAxis()[source]

Flip the Y and Z axes :return A new SpectrumDisplay instance

getAxisLimits(axis)[source]
reorderSpectra()[source]
resetAxisRange(axis)[source]
showExportDialog()[source]

show the export strip to file dialog

toggleCalibrateX()[source]
toggleCalibrateXY()[source]

Toggle widgets for both axes

toggleCalibrateY()[source]
toggleHorizontalTrace()[source]

Toggles whether or not horizontal trace is displayed.

toggleLastAxisOnly()[source]

Toggles whether the axis is displayed in the last strip of the display.

toggleVerticalTrace()[source]

Toggles whether or not vertical trace is displayed.

ccpn.ui.gui.lib.GuiWindow module

Module Documentation here

class ccpn.ui.gui.lib.GuiWindow.GuiWindow(application)[source]

Bases: object

add1DIntegral(peak=None)[source]

Peak: take self.application.currentPeak as default

addMultiplet()[source]

add current peaks to a new multiplet

calibrateFromPeaks()[source]

Calibrate the current strip from the selected peaks

clearMarks()[source]

Clears all marks in all windows for the current task.

createMark(axisIndex=None)[source]

Creates a mark at the current cursor position in the current strip.

createMultipletAxisMarks(axisIndex=None)[source]

Creates marks at the selected multiplet positions.

createPeakAxisMarks(axisIndex=None)[source]

Creates marks at the selected peak positions.

cyclePeakSymbols()[source]

restore the zoom of the currently selected strip to the top item of the queue

cycleSymbolLabelling()[source]

restore the zoom of the currently selected strip to the top item of the queue

deassignPeaks()[source]

Deassign all from selected peaks

deleteSelectedItems(parent=None)[source]

Delete peaks/integrals/multiplets from the project

estimateNoise()[source]

estimate the noise in the visible region of the current strip

estimateVolumes()[source]

Estimate volumes of peaks selected by right-mouse menu If clicking on a selected peak then apply to all selected, otherwise apply to clicked peaks

filterOnCurrentTable()[source]
getCurrentPositionAndStrip()[source]
hideAllSpectra()[source]

hides all spectra in the spectrum display.

invertSelectedSpectra()[source]

invertes the selected spectra in the spectrum display. The toggled in will be hided and the hidden spectra will be displayed.

makeStripPlot(includePeakLists=True, includeNmrChains=True, includeSpectrumTable=False)[source]

Make a strip plot in the current spectrumDisplay

markPositions(axisCodes, chemicalShifts)[source]

Create marks based on the axisCodes and adds annotations where appropriate.

Parameters
  • axisCodes – The axisCodes making a mark for

  • chemicalShifts – A list or tuple of ChemicalShifts at whose values the marks should be made

markSelectedMultiplets(axisIndex=None)[source]

Mark the positions of all selected multiplets

markSelectedPeaks(axisIndex=None)[source]

Mark the positions of all selected peaks

movePeaks(direction: str = 'up')[source]

Move the peaks in the current strip with the cursors

moveToNextSpectrum()[source]

moves to next spectrum on the current strip, Toggling off the currently displayed spectrum.

moveToPreviousSpectrum()[source]

moves to next spectrum on the current strip, Toggling off the currently displayed spectrum.

newPhasingTrace()[source]
nextZPlane()[source]

navigate to the next Z plane for the currently selected strip

nextZoom()[source]

change to the next stored zoom

panSpectrum(direction: str = 'up')[source]

Pan/Zoom the current strip with the cursor keys

previousZPlane()[source]

navigate to the previous Z plane for the currently selected strip

previousZoom()[source]

change to the previous stored zoom

recalculateCurrentPeakHeights()[source]

Recalculates the peak height without changing the ppm position

refitCurrentPeaks(singularMode=True)[source]
removePhasingTraces()[source]

Removes all phasing traces from all strips.

reorderPeakListAxes()[source]

Reorder axes of all peaks in peakList of first selected peak by right-mouse menu

resetAllZoom()[source]

zoom out of the currently selected strip

restoreZoom()[source]

restore the zoom of the currently selected strip

selectAllPeaks(strip=None)[source]

selects all peaks in the strip or current strip if any and if the spectrum is toggled on

setContourLevels()[source]

Open the contour settings popup for the current strip

setMouseMode(mode)[source]
setPeakAliasing()[source]

Set the aliasing for the currently selected peaks

setPhasingPivot()[source]
showAllSpectra()[source]

shows all spectra in the spectrum display.

snapCurrentPeaksToExtremum(parent=None)[source]

Snaps selected peaks. If more then one, pops up a Yes/No. Uses the minDropFactor from the preferences, and applies a parabolic fit to give first-estimate of lineWidths

stackSpectra()[source]
storeZoom()[source]

store the zoom of the currently selected strip

switchMouseMode()[source]
toggleConsole()[source]
  • Opens a new pythonConsole module if none available.

  • Show/hide the pythonConsole module if already one available.

toggleCrosshair()[source]

Toggles whether crosshairs are displayed in all spectrum displays

toggleCrosshairAll()[source]

Toggles whether crosshairs are displayed in all windows.

toggleDoubleCrosshairAll()[source]

Toggles whether double crosshairs are displayed in all windows.

toggleGrid()[source]

toggle grid for the spectrum displays in this window.

toggleGridAll()[source]

Toggles grid display in all windows

toggleHTrace(window: ccpn.ui.gui.lib.GuiWindow.GuiWindow)[source]

Toggles whether horizontal traces are displayed in the specified window.

toggleLastAxisOnly(window: ccpn.ui.gui.lib.GuiWindow.GuiWindow)[source]

Toggles whether the axis is displayed in the last strip of the display

togglePhaseConsole(window: ccpn.ui.gui.lib.GuiWindow.GuiWindow)[source]

Toggles whether the phasing console is displayed in the specified window.

toggleSideBands()[source]

toggle sideBands for the spectrum displays in this window.

toggleSideBandsAll()[source]

Toggles sideBand display in all windows

toggleVTrace(window: ccpn.ui.gui.lib.GuiWindow.GuiWindow)[source]

Toggles whether vertical traces are displayed in the specified window.

traceScaleDown(window: ccpn.ui.gui.lib.GuiWindow.GuiWindow, scale=0.7142857142857143)[source]

Halves the scale for all traces in the specified window.

traceScaleScale(window: ccpn.ui.gui.lib.GuiWindow.GuiWindow, scale: float)[source]

Changes the scale of a trace in all spectrum displays of the window.

traceScaleUp(window: ccpn.ui.gui.lib.GuiWindow.GuiWindow, scale=1.4)[source]

Doubles the scale for all traces in the specified window.

zoomIn()[source]

zoom in to the currently selected strip

zoomOut()[source]

zoom out of the currently selected strip

ccpn.ui.gui.lib.MenuActions module

Module Documentation here

class ccpn.ui.gui.lib.MenuActions.AddToCollectionPopup(mainWindow=None, project=None, *args, **kwds)[source]

Bases: ccpn.ui.gui.widgets.SpeechBalloon.SpeechBalloon

Balloon to hold the collection list For later when a more complex selector is required

class ccpn.ui.gui.lib.MenuActions.CreateNewObjectABC(**kwds)[source]

Bases: object

An ABC to implement an abstract callback function to create new object The __call__(self, dataPid, node) method acts as the callback function

getObj()[source]

returns obj from node or None

parentMethodName = None
class ccpn.ui.gui.lib.MenuActions.OpenItemABC(useNone=False, **kwds)[source]

Bases: object

An ABC to implement an abstract openItem in moduleArea class The __call__(self, dataPid, node) method acts as the callback function

contextMenuText = 'Open as a Module'
getObj()[source]

returns obj from node or None

hasOpenMethod = True
objectArgumentName = 'obj'
openItemDirectMethod = None
openItemMethod = None
useApplication = True
validActionTargets = (<class 'ccpn.core.Spectrum.Spectrum'>, <class 'ccpn.core.PeakList.PeakList'>, <class 'ccpn.core.MultipletList.MultipletList'>, <class 'ccpn.core.IntegralList.IntegralList'>, <class 'ccpn.core.NmrChain.NmrChain'>, <class 'ccpn.core.Chain.Chain'>, <class 'ccpn.core.SpectrumGroup.SpectrumGroup'>, <class 'ccpn.core.Sample.Sample'>, <class 'ccpn.core.ChemicalShiftList.ChemicalShiftList'>, <class 'ccpn.core.RestraintTable.RestraintTable'>, <class 'ccpn.core.Note.Note'>, <class 'ccpn.core.StructureEnsemble.StructureEnsemble'>, <class 'ccpn.core.DataTable.DataTable'>, <class 'ccpn.core.ViolationTable.ViolationTable'>, <class 'ccpn.core.Collection.Collection'>)
class ccpn.ui.gui.lib.MenuActions.RaisePopupABC(useParent=False, useNone=False, **kwds)[source]

Bases: object

An ABC to implement an abstract popup class The __call__(self, dataPid, node) method acts as the callback function

getObj()[source]

returns obj from node or None

objectArgumentName = 'obj'
parentObjectArgumentName = None
popupClass = None

ccpn.ui.gui.lib.NoUIModuleBase module

ccpn.ui.gui.lib.PeakList module

Module Documentation here

ccpn.ui.gui.lib.PeakList.restrictedPick(peakListView, axisCodes, peak=None, nmrResidue=None)[source]

Takes a Peak or an NmrResidue, not both, a set of axisCodes, and a PeakListView. Derives positions for picking and feeds them into a PeakList wrapper function that performs the picking.

ccpn.ui.gui.lib.Shortcuts module

Module Documentation here

ccpn.ui.gui.lib.Shortcuts.addShortCut(keys=None, obj=None, func=None, context=None)[source]

Add a new shortcut to the widget/context and store in the shortcut list :param keys - string containing the keys; e.g., ‘a, b’ or the keySequence object:

e.g., QtGui.QKeySequence.SelectAll

Parameters
  • to (obj - widget to attach keySequence) –

  • attach (func - function to) –

  • WidgetShortcut|ApplicationShortcut (context - context; e.g.,) –

ccpn.ui.gui.lib.Shortcuts.clearShortcuts(widget=None)[source]

Clear all shortcuts that exist in all objects from the current widget :param widget - target widget:

ccpn.ui.gui.lib.Shortcuts.storeShortcut(keys=None, obj=None, func=None, context=None, shortcut=None)[source]

Store the new shortcut in the dict, may be an Action from the menu :param keys - string containing the keys; e.g., ‘a, b’ or the keySequence object:

e.g., QtGui.QKeySequence.SelectAll

Parameters
  • to (obj - widget to attach keySequence) –

  • attach (func - function to) –

  • WidgetShortcut|ApplicationShortcut (context - context; e.g.,) –

ccpn.ui.gui.lib.SpectrumDisplay module

Module Documentation here

ccpn.ui.gui.lib.SpectrumDisplay.makeStripPlot(spectrumDisplay: ccpn.ui.gui.lib.GuiSpectrumDisplay.GuiSpectrumDisplay, nmrAtomPairs: List[List[ccpn.core.NmrAtom.NmrAtom]], autoWidth=True, widths=None)[source]
ccpn.ui.gui.lib.SpectrumDisplay.makeStripPlotFromSingles(spectrumDisplay: ccpn.ui.gui.lib.GuiSpectrumDisplay.GuiSpectrumDisplay, nmrAtoms: List[ccpn.core.NmrAtom.NmrAtom], autoWidth=True)[source]
ccpn.ui.gui.lib.SpectrumDisplay.navigateToCurrentNmrResiduePosition(application)[source]

Takes the current nmrResidue and navigates (centres) to that position all strips and spectrum displays of the project. Called by shortcut. For a more generic usage refer to: “navigateToPositionInStrip” instead

ccpn.ui.gui.lib.SpectrumDisplay.navigateToCurrentPeakPosition(application, selectFirstPeak=False)[source]

Takes the current peak position and navigates (centres) to that position all strips and spectrum displays of the project. Called by shortcut. For a more generic usage refer to: “navigateToPositionInStrip” instead

ccpn.ui.gui.lib.SpectrumDisplay.navigateToNmrResidueInStrip(spectrumDisplay: ccpn.ui.gui.lib.GuiSpectrumDisplay.GuiSpectrumDisplay, strip, nmrResidue, widths=None, markPositions=False)[source]
ccpn.ui.gui.lib.SpectrumDisplay.navigateToPeakInStrip(spectrumDisplay: ccpn.ui.gui.lib.GuiSpectrumDisplay.GuiSpectrumDisplay, strip, peak, widths=None)[source]

ccpn.ui.gui.lib.StripLib module

Strip Library functionalities

ccpn.ui.gui.lib.StripLib.copyStripAxisPositionsAndWidths(fromStrip, toStrip)[source]

copy the strip axes to the new strip

ccpn.ui.gui.lib.StripLib.isPositionWithinfBounds(strip: ccpn.ui.gui.lib.GuiStrip.GuiStrip, shift: ccpn.core._OldChemicalShift._OldChemicalShift, axis: object)[source]

Determines whether a given shift is within the bounds of the specified axis of the specified strip.

NBNB Bug Fixed by Rasmus 13/3/2016. This was not used then. Maybe it should be?

Modified to use aliasingLimits instead of spectrumLimits. Rasmus, 24/7/2016

ccpn.ui.gui.lib.StripLib.matchAxesAndNmrAtoms(strip: ccpn.ui.gui.lib.GuiStrip.GuiStrip, nmrAtoms: List[ccpn.core.NmrAtom.NmrAtom])[source]
ccpn.ui.gui.lib.StripLib.navigateToNmrAtomsInStrip(strip: ccpn.ui.gui.lib.GuiStrip.GuiStrip, nmrAtoms: List[ccpn.core.NmrAtom.NmrAtom], widths=None, markPositions: bool = False, setNmrResidueLabel=False, axisMask=None)[source]

Takes an NmrResidue and optional spectrum displays and strips and navigates the strips and spectrum displays to the positions specified by the peak.

ccpn.ui.gui.lib.StripLib.navigateToNmrResidueInDisplay(nmrResidue, display, stripIndex=0, widths=None, showSequentialResidues=False, markPositions=True, showDropHeaders=False, axisMask=None)[source]

Navigate in to nmrResidue in strip[stripIndex] of display, with optionally-1, +1 residues in strips[stripIndex-1] and strips[stripIndex+1]. return list of strips

Parameters
  • nmrResidue – nmrResidue to display

  • display – target spectrumDisplay for nmrResidue

  • stripIndex – location of strip in display (assumed 0 if connected and showSequentialResidues)

  • widths – ignored (for now)

  • showSequentialResidues – boolean selecting if sequential strips are displayed

  • markPositions – boolean selecting if marks are displayed

Returns

list of strips

ccpn.ui.gui.lib.StripLib.navigateToPositionInStrip(strip, positions: List[float], axisCodes: Optional[List[str]] = None, widths: Optional[List[float]] = None)[source]

Takes a strip, a list of positions and optionally, a parallel list of axisCodes. Navigates to specified positions in strip using axisCodes, if specified, otherwise it navigates to the positions in the displayed axis order of the strip.

ccpn.ui.gui.lib.Validators module

Module Documentation here

class ccpn.ui.gui.lib.Validators.LineEditValidator(parent=None, allowSpace=True, allowEmpty=True)[source]

Bases: PyQt5.QtGui.QValidator

Validator to restrict input to non-whitespace characters

property checkState

- None, immutable -

clearValidCheck()[source]
resetCheck()[source]
validate(self, str, int) Tuple[QValidator.State, str, int][source]
class ccpn.ui.gui.lib.Validators.LineEditValidatorCoreObject(parent=None, target=None, klass=None, allowSpace=True, allowEmpty=True)[source]

Bases: PyQt5.QtGui.QValidator

Validator to restrict input to non-whitespace characters and restrict input to the names not already in the core object klass

property checkState

- None, immutable -

clearValidCheck()[source]
property isValid

- None, immutable -

resetCheck()[source]
validate(self, str, int) Tuple[QValidator.State, str, int][source]

ccpn.ui.gui.lib.guiDecorators module

Module Documentation here

ccpn.ui.gui.lib.mouseEvents module

various mouse event functions. See ViewBox.py for the full mouse commands description.

ccpn.ui.gui.lib.mouseEvents.controlLeftMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.controlMiddleMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.controlRightMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.controlShiftLeftMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.controlShiftMiddleMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.controlShiftRightMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.doDebug(msg)[source]
ccpn.ui.gui.lib.mouseEvents.getCurrentMouseMode()[source]
ccpn.ui.gui.lib.mouseEvents.getMouseEventDict(event: PyQt5.QtGui.QMouseEvent)[source]

Return a dict with the status of each mouseEvent as boolean

ccpn.ui.gui.lib.mouseEvents.leftMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.makeDragEvent(self, dataDict, texts, label=None, action=1, alignCentre=True)[source]

Create a new drag event with ‘self’ as the source

Parameters
  • self – source of the new drag event

  • dataDict – data to add as mimeData

  • texts – list of strings to copy/move to list widget types (if required)

  • label – string required to create the drag icon

  • action – QtCore.Qt.CopyAction or Move action - may be used by dropEvent

Returns

ccpn.ui.gui.lib.mouseEvents.middleMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.rightMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.setCurrentMouseMode(mode)[source]
ccpn.ui.gui.lib.mouseEvents.shiftLeftMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.shiftMiddleMouse(event: PyQt5.QtGui.QMouseEvent)[source]
ccpn.ui.gui.lib.mouseEvents.shiftRightMouse(event: PyQt5.QtGui.QMouseEvent)[source]