Command cd and Macro connect backbone

Dear all,

I’ve used the shortcut ‘cd’ to toggle the double cross-hair on and off, but at some point the shortcut was not working anymore, even when selected in the context menu. What can be the problem? And how can I fix it?
Further, the macro ‘connect backbone’ is not working for me. I have no idea what’s going wrong. Do you have any suggestions?
Many thanks,
Charlotte

Hi Charlotte,

what operating system are you using? On my Mac CD seems to work fine in the updated 3.0.4 version. Are you on Windows by any chance? That can sometimes throw up errors in the graphics that we don’t see on other operating systems.

I’m not sure what macro you are referring to. I can’t seem to find a macro called “Connect Backbone” anywhere. Is this a bespoke macro that someone created for you? If you send us a copy we can hopefully trace what is going on from the commands that it uses.

Vicky

Hi Vicky,

I’m using CcpNMR AnalysisAssign version 3.0.4 in the cluster of my university, so it’s Linux.
I’m sorry, the actual name of the Macro is connectNCONmrResidues.

Charlotte

Hi Charlotte,

On the macro issue: Looks like there could be a bug in this which means it wasn’t working on all the epxt types it should have been. So NCO and NCOCX would have been okay but NcoCX wouldn’t.

Have a look and see if this works for you:

# Macro to set the NmrResidues of the N and CO dimensions of a peak in an experiment containing an NCO
# onebond transfer as being connected in the N(i)-CO(i-1) direction


from ccpn.core.lib.ContextManagers import undoBlock
from ccpn.ui.gui.widgets.MessageDialog import showWarning
from ccpn.AnalysisAssign.modules.SequenceGraph import SequenceGraphModule

def _checkNumPeaks():
    if len(current.peaks) > 1:
        showWarning('Too many peaks selected', 'Please make sure you have only select one peak.')
        return(False)
    elif len(current.peaks) == 0:
        showWarning('No peak selected', 'Please make sure you select one peak.')
        return(False)
    else:
        return(True)

def _checkExptType(expType):
    if 'NCO' in expType:
        return True
    elif 'Nco' in expType:
        return True
    else:
        return False


def _connectNmrResidues():
    peak = current.peak
    if _checkExptType(peak.spectrum.experimentType):
        for assignments in peak.assignedNmrAtoms:
            for na in assignments:
                if na.name == 'N':
                    nNmrRes = na.nmrResidue
                elif na.name == 'C':
                    coNmrRes = na.nmrResidue
        nNmrRes.connectPrevious(coNmrRes)
    else:
        showWarning('Incorrect peak selected', 'Please make sure your peak is from a spectrum type that connects '
                                               'N(i) with CO(i-1) via a one-bond transfer.')


###### Start of Macro #########

with undoBlock():
    if _checkNumPeaks():
        _connectNmrResidues()

for sg in mainWindow.modules:
    if isinstance(sg, SequenceGraphModule):
        print(f'  module {sg}')
        sg.showNmrChainFromPulldown()

To run this macro simply go to Macro / New and then paste in the code above. Select your peak and then press the green play button. Let me know if solves your problem or if there is something else that might be going on.
Note that the macro will only work if your atom names are N and C (NEF/IUPAC names for the backbone amide nitrogen and carbonyl atoms).

On the crosshair issue: it could be worth checking that the isotopeCodes are set correctly for your spectra: double-click on them in the sidebar to open Spectrum Properties and then go to the Dimensions tab.

Vicky

Hi Vicky,

I will try out and let you know.

Thank you very much,
Charlotte