ccpn.AnalysisAssign.modules package

Module Documentation here


ccpn.AnalysisAssign.modules.AssignmentInspectorModule module

This file contains AssignmentInspectorModule class

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

class ccpn.AnalysisAssign.modules.AssignmentInspectorModule.AssignmentInspectorModule(mainWindow, name='Assignment Inspector', 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.

attributeName = 'peaks'
className = 'AssignmentInspectorModule'
includeSettingsWidget = True
maxSettingsState = 2

Navigate in selected displays to nmrResidue; skip if none defined

settingsPosition = 'top'
class ccpn.AnalysisAssign.modules.AssignmentInspectorModule.AssignmentInspectorTable(parent=None, mainWindow=None, moduleParent=None, actionCallback=None, selectionCallback=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

OBJECT = 'object'
TABLE = 'table'
attributeName = 'chemicalShifts'
className = 'AssignmentInspectorTable'

get columns for initialisation of table

ccpn.AnalysisAssign.modules.BackboneAssignmentModule module

Module Documentation here

class ccpn.AnalysisAssign.modules.BackboneAssignmentModule.BackboneAssignmentModule(mainWindow=None, name='Backbone Assignment')[source]

Bases: ccpn.ui.gui.modules.NmrResidueTable.NmrResidueTableModule


alias of ccpn.core.NmrChain.NmrChain

className = 'BackboneAssignmentModule'

Find and displays the matches to nmrResidue

includeDisplaySettings = True
includeSettingsWidget = True
maxSettingsState = 2
navigateToNmrResidue(nmrResidue, row=None, col=None)[source]

Navigate in selected displays to nmrResidue; skip if no displays defined If matchCheckbox is checked, also call findAndDisplayMatches


Navigate in selected displays to nmrResidue; skip if none defined

settingsMinimumSizes = (500, 200)
settingsPosition = 'left'
ccpn.AnalysisAssign.modules.BackboneAssignmentModule.markNmrAtoms(mainWindow, nmrAtoms: List[ccpn.core.NmrAtom.NmrAtom])[source]

Retrieve a list of nmrAtoms from nmrResidue


Retrieve a list of nmrAtoms from nmrResidue

ccpn.AnalysisAssign.modules.NmrAtomAssigner module

AtomSelector module:

used for backbone and sidechain assignments to set the nmrAtom of a (number of) selected peaks to a specific nucleus. Thus far, it set the ‘y-axis’ dimension of the peak (to be made flexible in the settings tab). Options other than ‘protein’ are not yet implemented.

Original by SS First rework by GWV Reworked by EJB

class ccpn.AnalysisAssign.modules.NmrAtomAssigner.NmrAtomAssignerModule(mainWindow=None, name='NmrAtomAssigner', nmrAtom=None)[source]

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

Module to be used with PickAndAssignModule for prediction of nmrAtom names and assignment of nmrAtoms to peak dimensions Responds to current.nmrResidue and current.peaks; accepts nmrResidue pid drops

assignNmrAtomsToPeaks(nmrAtom, peaks)[source]

Assign the nmrAtom to the dimension

atomLabel(atom, offset, showAll=False)[source]
className = 'NmrAtomAssignerModule'
deassignAtomFromSelectedPeaks(peaks, nmrAtom)[source]

Deassign the nmrAtom from the dimension

defaultSettingsState = 0
getResidueTypes(moleculeType: str = 'protein')[source]

return a list of residue types assiciated with the moleculeType :param moleculeType - str [‘protein’, ‘DNA’, ‘RNA’, ‘carbohydrate’, ‘other’] :return list of str:

includeSettingsWidget = True
maxSettingsState = 2
settingsPosition = 'top'

ccpn.AnalysisAssign.modules.PeakAssigner module

Module to assign peaks Responds to current.peaks

class ccpn.AnalysisAssign.modules.PeakAssigner.AssignmentTable(parent=None, mainWindow=None, dataFrameObject=None, actionCallback=None, selectionCallback=None, checkBoxCallback=None, clearSelectionCallback=None, _pulldownKwds=None, enableMouseMoveEvent=True, multiSelect=False, selectRows=True, numberRows=False, autoResize=False, enableExport=True, enableDelete=True, enableSearch=True, allowRowDragAndDrop=True, hideIndex=True, stretchLastSection=True, **kwds)[source]

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

Subclassed for some added functionality

class ccpn.AnalysisAssign.modules.PeakAssigner.AxisAssignmentObject(parent, parentModule, dimIndex, mainWindow, grid=None, **kwds)[source]

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

Create a new frame for displaying information in 1 axis of peakassigner

setAlternativesTable(atomList: list)[source]
setAssignedTable(atomList: list)[source]

Hide the edit popup balloon


Set the text of the top horizontal Line


Set the text of the notAligned widget


Show/hide of notAligned and assignmentFrame

class ccpn.AnalysisAssign.modules.PeakAssigner.EditNmrAtomBalloon(mainWindow=None, project=None, *args, **kwds)[source]

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

Balloon to hold the pulldown lists for editing the nmrAtom

class ccpn.AnalysisAssign.modules.PeakAssigner.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).

class ccpn.AnalysisAssign.modules.PeakAssigner.PeakAssigner(mainWindow, name='Peak Assigner')[source]

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

Module for assignment of nmrAtoms to the different axes of a peak. Module responds to current.peak

activePulldownClass = None
className = 'PeakAssigner'
eventFilter(target, event)[source]

Event filter to handle a mainWidget resizing

includeSettingsWidget = True
maxSettingsState = 2
settingsPosition = 'left'


ccpn.AnalysisAssign.modules.PickAndAssignModule module

Do a restricted peak pick along the ‘y-axis’ of (a set of) spectra. Use settings to define the spectral displays, the active spectra and the tolerances for peak picking

This module closely works with the Atom Selector module

First version by SS Refactored by GWV to be responsible to active state on start; proper callbacks and to include “Restricted pick and assign” button.

class ccpn.AnalysisAssign.modules.PickAndAssignModule.PickAndAssignModule(mainWindow, name='Pick and Assign')[source]

Bases: ccpn.ui.gui.modules.NmrResidueTable.NmrResidueTableModule

Do a restricted peak pick along the ‘y-axis’ of (a set of) spectra. Use settings to define the spectral displays, the active spectra and the tolerances for peak picking

This module closely works with the Atom Selector module


Assign current.peaks on the bases of nmrAtoms of current.nmrResidue

className = 'PickAndAssignModule'
goToPositionInModules(nmrResidue=None, row=None, col=None)[source]

Go to the positions defined my NmrAtoms of nmrResidue in the active displays

includeDisplaySettings = True
includeNmrChains = False
includePeakLists = False
includeSettingsWidget = True
includeSpectrumTable = True
maxSettingsState = 2

Routine refactored in revision 9381.

Takes an NmrResidue feeds it into restricted pick lib functions and picks peaks for all spectrum displays specified in the settings tab. Pick uses X and Z axes for each spectrumView as centre points with tolerances and the y as the long axis to pick the whole region.


Functionality for beta2 to include the Assign part

Takes an NmrResidue feeds it into restricted pick lib functions and picks peaks for all spectrum displays specified in the settings tab. Pick uses X and Z axes for each spectrumView as centre points with tolerances and the y as the long axis to pick the whole region.

Calls assignSelected to assign

settingsMinimumSizes = (500, 200)
settingsPosition = 'top'

ccpn.AnalysisAssign.modules.SequenceGraph module

Module Documentation here

class ccpn.AnalysisAssign.modules.SequenceGraph.AssignmentLine(x1, y1, x2, y2, colour, width, parent=None, style=None, peak=None, guiAtom1: Optional[ccpn.AnalysisAssign.modules.SequenceGraph.GuiNmrAtom] = None, guiAtom2: Optional[ccpn.AnalysisAssign.modules.SequenceGraph.GuiNmrAtom] = None, displacement=None)[source]

Bases: PyQt5.QtWidgets.QGraphicsLineItem

Object to create lines between GuiNmrAtoms with specific style, width, colour and displacement. Displacement allows multiplet peak lines to be shown as adjacent lines between the same nmrAtom.

hoverEnterEvent(self, QGraphicsSceneHoverEvent)[source]
hoverLeaveEvent(self, QGraphicsSceneHoverEvent)[source]

Required to respond to mouse press events.

paint(painter, option, widget)[source]

Automatically update the end-points of the assignment lines to point to the correct guiNmrAtoms


Update the endPoints of the line to point. Co-ordinates are relative to the group to which the graphicsItem belongs, in this case the guiNmrResidue group. GuiNmrResidue group is the top level relative to the scene.

class ccpn.AnalysisAssign.modules.SequenceGraph.GuiNmrAtom(mainWindow, text, pos=None, nmrAtom=None)[source]

Bases: PyQt5.QtWidgets.QGraphicsSimpleTextItem

A graphical object specifying the position and name of an atom when created by the Assigner. Can be linked to a Nmr Atom.


maintain number of links between adjacent nmrAtoms.


Clear all connections for this guiNmrAtom but do not delete.


Retrieve number of links between adjacent nmrAtoms.


CCPN INTERNAL - re-implementation of double click event


CCPN INTERNAL - re-implementation of mouse press event

class ccpn.AnalysisAssign.modules.SequenceGraph.GuiNmrResidue(parent, nmrResidue, caAtom, lineSpacing)[source]

Bases: PyQt5.QtWidgets.QGraphicsSimpleTextItem

Object linking residues displayed in Assigner and Nmr Residues. Contains functionality for drag and drop assignment in conjunction with the Sequence Module.

class ccpn.AnalysisAssign.modules.SequenceGraph.GuiNmrResidueGroup(parent, nmrResidue, caAtom, pos, lineSpacing)[source]

Bases: PyQt5.QtWidgets.QGraphicsItemGroup

Group item to group all nmrAtoms/connecting lines of nmrResidue

mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)[source]
mouseMoveEvent(self, QGraphicsSceneMouseEvent)[source]
mousePressEvent(self, QGraphicsSceneMouseEvent)[source]
class ccpn.AnalysisAssign.modules.SequenceGraph.GuiSelection(guiRes, colour, width, style, spacing, type)[source]

Bases: PyQt5.QtWidgets.QGraphicsItemGroup

Item to hold the lines for a selection

class ccpn.AnalysisAssign.modules.SequenceGraph.GuiSelectionBoxes(scene)[source]

Bases: PyQt5.QtWidgets.QGraphicsItemGroup

Group item to group all selection boxes

addSelection(nmrResidue, guiRes, colour, width, style, spacing)[source]
addSelectionLeftBracket(nmrResidue, guiRes, colour, width, style, spacing)[source]
addSelectionRightBracket(nmrResidue, guiRes, colour, width, style, spacing)[source]
class ccpn.AnalysisAssign.modules.SequenceGraph.NmrResidueList(mainWindow, settingsWidget, lineColour, textColour, atomSpacing, lineSpacing, lineWidth, lineConnectWidth, scene, module, defaultResidueAtoms, atomPositionDict)[source]

Bases: object

A Class to hold the information about each gui object in the scene

addBackboneAtoms(nmrResidue, backboneAtoms, atomNames, guiAtoms)[source]

add the backbone atoms.


Add the connections between the groups.

addNmrResidue(nmrChainId, nmrResidue, index=0, _insertNmrRes=True, spacing=66, residueAtoms=None, showPredictions=True, showSideChain=False)[source]

Add a new nmrResidue at the required position.

addSideChainAtoms(nmrResidue, cbAtom, atomNames, guiAtoms)[source]

Add the sideChain atoms above the backbone line.


clear the displacements in the nmrAtoms.


Create new peak lines associated with the created/undeleted nmrAtoms.


Delete peak lines associated with the deleted nmrAtoms.


Get the list of assignment lines attached o the given peaks.


get the index in the nmrResidueList of the required nmrResidue.


Rebuild the peaks of a specified nmrResidue.


Rebuild all the peak assignments in the display after changing the number of spectra.

rebuildPeakLines(peaks, rebuildPeakLines=False, makeListFromPeak=False)[source]

Clear all lines on the display associated with peak.


Remove all the peakLines from the scene.


Remove all the connection from the scene.


return the number of elements in the list nmrChain.


Update the endpoints of the assignment lines.


Update the positions of the groups in the scene.


Update the endpoints of the connection lines.


Update the end points from the dict.

updateGuiResiduePositions(nmrChainId, updateMainChain=True, updateConnectedChains=True)[source]

Update the positions of the residues and connected residues in other chains if required.


Update the positions of the group in the scene. May need to set vertical positions when more groups are allowed

class ccpn.AnalysisAssign.modules.SequenceGraph.SequenceGraphModule(mainWindow=None, name='Sequence Graph', nmrChain=None)[source]

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

A module for the display of stretches of sequentially linked and assigned stretches of NmrResidues.


alias of ccpn.core.NmrChain.NmrChain

className = 'SequenceGraph'
deassignPeak(selectedPeak=None, selectedNmrAtom=None)[source]

Deassign the peak by removing the assigned nmrAtoms from the list

includeSettingsWidget = True

Replace the scene with a new one to reset the size of the scrollbars.

maxSettingsState = 2

Navigate in selected displays to nmrResidue; skip if none defined

predictSequencePosition(nmrResidueList: list, showPredictions=True)[source]

Predicts sequence position for Nmr residues displayed in the Assigner and highlights appropriate positions in the Sequence Module if it is displayed.


Reset all gui items and data in the scene.


Reset the module to the default nmrChain.


Context manager to handle blocking, unblocking, resizing of the scene.


Manually select a Sequence from the pullDown

setNmrChainDisplay(nmrChainOrPid, showPredictions=True, showSideChain=False)[source]
settingsPosition = 'left'

Respond to a change in the chains list


Clear and redraw the nmrChain selected from the pulldown.


Show predictions and calculate predicted sequences

showShiftListPulldown(data=None, chains=None)[source]

Clear and redraw the nmrChain selected from the pulldown.


ccpn.AnalysisAssign.modules.SideChainAssignmentModule module

Module Documentation here

class ccpn.AnalysisAssign.modules.SideChainAssignmentModule.SideChainAssignmentModule(mainWindow, name='Sidechain Assignment')[source]

Bases: ccpn.AnalysisAssign.modules.PickAndAssignModule.PickAndAssignModule

className = 'SideChainAssignmentModule'

Sorts pairs of NmrAtoms into ‘greek’ order. Used in _startAssignmentFromPairs to pass correctly ordered lists to makeStripPlot so strips are in the correct order.