Source code for ccpn.ui.gui.popups.AtomPopup
"""
Module Documentation here
"""
#=========================================================================================
# Licence, Reference and Credits
#=========================================================================================
__copyright__ = "Copyright (C) CCPN project (http://www.ccpn.ac.uk) 2014 - 2021"
__credits__ = ("Ed Brooksbank, Luca Mureddu, Timothy J Ragan & Geerten W Vuister")
__licence__ = ("CCPN licence. See http://www.ccpn.ac.uk/v3-software/downloads/license")
__reference__ = ("Skinner, S.P., Fogh, R.H., Boucher, W., Ragan, T.J., Mureddu, L.G., & Vuister, G.W.",
"CcpNmr AnalysisAssign: a flexible platform for integrated NMR analysis",
"J.Biomol.Nmr (2016), 66, 111-124, http://doi.org/10.1007/s10858-016-0060-y")
#=========================================================================================
# Last code modification
#=========================================================================================
__modifiedBy__ = "$modifiedBy: Ed Brooksbank $"
__dateModified__ = "$dateModified: 2021-03-23 15:38:09 +0000 (Tue, March 23, 2021) $"
__version__ = "$Revision: 3.0.3 $"
#=========================================================================================
# Created
#=========================================================================================
__author__ = "$Author: CCPN $"
__date__ = "$Date: 2017-03-30 11:28:58 +0100 (Thu, March 30, 2017) $"
#=========================================================================================
# Start of code
#=========================================================================================
from ccpn.ui.gui.popups.AttributeEditorPopupABC import AttributeEditorPopupABC
from ccpn.util.Common import greekKey, getIsotopeListFromCode, makeIterableList
from ccpn.core.Atom import Atom
from ccpn.ui.gui.widgets.CompoundWidgets import EntryCompoundWidget, TextEditorCompoundWidget, \
PulldownListCompoundWidget, CheckBoxCompoundWidget
from ccpn.util import Constants as ct
from functools import partial
MERGE = 'merge'
_NameSeparator = '-- NEF Atoms --'
def _setAtomNames(cls, atom, residue = None):
from ccpnmodel.ccpncore.lib.assignment.ChemicalShift import PROTEIN_ATOM_NAMES, ALL_ATOMS_SORTED
from ccpn.core.lib.AssignmentLib import NEF_ATOM_NAMES
compoundWidget = cls.name
pulldown = compoundWidget.pulldownList
atomsNameOptions = []
if not residue:
residue = cls._getParentResidue()
residueAtomNames = residue._getChemAtomNames()
NEF_atomNames = makeIterableList(NEF_ATOM_NAMES.values())
atomsNameOptions = residueAtomNames + [_NameSeparator] + [x for x in NEF_atomNames if x not in residueAtomNames]
compoundWidget.modifyTexts(atomsNameOptions)
separatorItemIndex = pulldown.getItemIndex(_NameSeparator) #this bit could be done at higher level. We need a Separator Object.
separatorItem = pulldown.model().item(separatorItemIndex)
if separatorItem:
separatorItem.setEnabled(False)
def _setResidue(cls, atom):
parentResidue = cls._getParentResidue()
if parentResidue:
cls.residue.modifyTexts([parentResidue.id])
cls.residue.select(parentResidue.id)
else:
cls.residue.modifyTexts([])