Hi Christian,
I looked into the merging stuff. This is something which is still rather rudimentary at the moment, but certainly something we will be sorting out in future.
The main thing to bear in mind (and I think the reason this wasn’t sorted sooner) is that merging NmrAtoms is irreversible and not undoable. So for this is reason the programme doesn’t do this automatically, and we will certainly always leave this as something that the user has to initiate themselves.
So before doing any merging I would always save and/or archive the project.
At the moment you can merge NmrAtoms by hand. Double-click on an NmrAtom in the sidebar, then change the NmrResidue from e.g. 5-1 to 4 and tick the “Merge with Existing” box below.
There is a bug which means the 5-1 NmrAtom will still show in the sidebar, although it no longer exists (will make sure we sort that out). But you’ll be able to see in the chemical shift list, that the merge has taken place (another bug means you may have to reload the chemical shift list for it to update fully - again will make sure we sort this soon).
I think in future we’ll make sure you can also merge things at an NmrResidue level, not just the NmrAtom level. And of course it should be possible to do this for the whole NmrChain in one go.
Until we get this sorted, it would be rather tedious to have to merge all your NmrAtoms by hand at the moment, so I’ve written you a macro which will merge all the i-1 NmrAtoms with those belonging to the actual i-1 NmrAtoms in your ‘A’ NmrChain. This will also the delete the (then obsolete) i-1 NmrAtoms properly.
Obviously if there is no actual i-1 residue (e.g. if it is a Proline and you have no proline assignments), then the residue will not be merged and you will have to make the change by hand. But hopefully that shouldn’t affect many residues.
# Macro to merge "-1" NmrAtoms with the actual i-1 NmrAtoms
# Make sure the correct NmrChain has been selected in the first line
nmrChain = project.getByPid('NC:A')
for nmrRes in nmrChain.nmrResidues:
if nmrRes.relativeOffset == -1:
if nmrRes.mainNmrResidue:
if nmrRes.mainNmrResidue.previousNmrResidue:
newSeqCode = nmrRes.mainNmrResidue.previousNmrResidue.sequenceCode
for nmrAtom in nmrRes.nmrAtoms:
nmrAtom.assignTo(sequenceCode=newSeqCode, mergeToExisting=True)
project.deleteObjects(nmrRes)
Any problems, let me know.
Vicky