ccpn.AnalysisAssign.modules package

Module Documentation here

Submodules

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.

LARGE_STRETCH = 100000
SETTING_PADDING = 4
attributeName = 'peaks'
className = 'AssignmentInspectorModule'
includeSettingsWidget = True
maxSettingsState = 2
navigateToNmrResidueCallBack(data)[source]

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'
getColumns()[source]

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

activePulldownClass

alias of ccpn.core.NmrChain.NmrChain

className = 'BackboneAssignmentModule'
findAndDisplayMatches(nmrResidue)[source]

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

navigateToNmrResidueCallBack(data)[source]

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]
ccpn.AnalysisAssign.modules.BackboneAssignmentModule.nmrAtomsFromOffsets(nmrResidue)[source]

Retrieve a list of nmrAtoms from nmrResidue

ccpn.AnalysisAssign.modules.BackboneAssignmentModule.nmrAtomsFromResidue(nmrResidue)[source]

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]
setEditPopupVisible(visible)[source]

Hide the edit popup balloon

setHLineText(text)[source]

Set the text of the top horizontal Line

setNotAlignedText(text)[source]

Set the text of the notAligned widget

showNotAligned(flag)[source]

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.PeakAssigner.mainTest()[source]

Testing

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

assignSelected()[source]

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
restrictedPick(nmrResidue=None)[source]

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.

restrictedPickAndAssign(nmrResidue=None)[source]

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]
mousePressEvent(event)[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

updateEndPoints()[source]

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.

addConnectedList(connectedAtom)[source]

maintain number of links between adjacent nmrAtoms.

clearConnectedList()[source]

Clear all connections for this guiNmrAtom but do not delete.

getConnectedList(connectedAtom)[source]

Retrieve number of links between adjacent nmrAtoms.

mouseDoubleClickEvent(event)[source]

CCPN INTERNAL - re-implementation of double click event

mousePressEvent(event)[source]

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]
clear()[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.

addConnectionsBetweenAllGroups(nmrChainId)[source]

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.

clearAllGuiNmrAtoms()[source]

clear the displacements in the nmrAtoms.

createNmrAtoms(nmrAtoms)[source]

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

deleteNmrAtoms(nmrAtoms)[source]

Delete peak lines associated with the deleted nmrAtoms.

getAssignmentLinesFromPeaks(peaks)[source]

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

getIndexNmrResidue(nmrResidue)[source]

get the index in the nmrResidueList of the required nmrResidue.

rebuildNmrResidues(nmrResidues)[source]

Rebuild the peaks of a specified nmrResidue.

rebuildPeakAssignments()[source]

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.

removeAssignmentLinesFromScene()[source]

Remove all the peakLines from the scene.

removeConnectionLinesFromScene()[source]

Remove all the connection from the scene.

reset()[source]
setNmrResidueSelection(nmrResidues)[source]
size(nmrChainId)[source]

return the number of elements in the list nmrChain.

updateAssignmentLines()[source]

Update the endpoints of the assignment lines.

updateConnectedChainPositions()[source]

Update the positions of the groups in the scene.

updateConnectionLines()[source]

Update the endpoints of the connection lines.

updateEndPoints(lineDict)[source]

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.

updateMainChainPositions(nmrChainId)[source]

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.

activePulldownClass

alias of ccpn.core.NmrChain.NmrChain

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

Deassign the peak by removing the assigned nmrAtoms from the list

defineAtoms()[source]
disconnectAllNmrResidues(selectedNmrResidue=None)[source]
disconnectNextNmrResidue(selectedNmrResidue=None)[source]
disconnectNmrResidue(selectedNmrResidue=None)[source]
disconnectPreviousNmrResidue(selectedNmrResidue=None)[source]
includeSettingsWidget = True
initialiseScene()[source]

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

maxSettingsState = 2
navigateToNmrResidue(selectedNmrResidue=None)[source]

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.

resetScene()[source]

Reset all gui items and data in the scene.

resetSequenceGraph()[source]

Reset the module to the default nmrChain.

sceneBlocking()[source]

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

selectSequence(nmrChain=None)[source]

Manually select a Sequence from the pullDown

setNmrChain(nmrChain)[source]
setNmrChainDisplay(nmrChainOrPid, showPredictions=True, showSideChain=False)[source]
settingsPosition = 'left'
showChainsChanged(data=None)[source]

Respond to a change in the chains list

showNmrChainFromPulldown(data=None)[source]

Clear and redraw the nmrChain selected from the pulldown.

showNmrResidue(obj)[source]
showPredictions(data=None)[source]

Show predictions and calculate predicted sequences

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

Clear and redraw the nmrChain selected from the pulldown.

unlinkNearestNmrResidue(selectedNmrResidue=None)[source]

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'
sortNmrAtomPairs(nmrAtomPairs)[source]

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