Hi Józef,
I think I’m a little unsure what you’re trying to do. But hopefully Luca’s code might do what you are trying to do.
A bit of help with getting away from breaking things down into strings all the time:
I’ll often try things on the Python console and something like
pk = get('PK:hsqc.1.7')
pk.
followed by the tab button will give you a list of all the properties associated with a peak.
pk.a
followed by tab will give you lots of assignment related ones.
Unfortunately the whole peak assignment stuff is a bit involved because of the ability to have multiple assignments per peak dimension.
Luca uses
peak.getByDimensions('assignedNmrAtoms', [1])
which is a nice way to get hold of dimension-related properties such as assignments. So you can substitute ‘assignedNmrAtoms’ with something like ‘ppmPositions’ if you like. And the [1] refers to the dimension (note that it uses the dimension number, so 1 or 2 for a 2D, rather than starting at 0 as Python indexes usually would).
There is a similar
pk.getByAxisCodes('assignedNmrAtoms', ['N'])
method which can also be useful.
The other thing to remember is that you can get hold of lots things in a nested/extended way, so if you have an NmrAtom (e.g. from pk.assignedNmrAtoms), then you can get hold of individual bits of information with
na = get('NA:A.4.LYS.H)
na.name
na.nmrResidue.sequenceCode
na.nmrResidue.residueType
na.nmrResidue.nmrChain.name
etc.
Hope this helps,
Vicky