Automating Conversion in Peaklist

Hi,

Can I have a Macro that opens the peaklist, converts the Assign F1 column (ex: L.20.VAL.N) to (V20), and writes the converted values into the Annotation column?

Thank you.

Hi,

We would recommend having a look at our Macro writing tutorials:

To access Assign F1 of peak you need to iterate through the peak list, for instance:
myPeakList = get(‘PL:spectra.1’).peaks
for peak in myPeakList:
print(peak.assignments)

NmrResidues of the nmrAtoms (Assign F1) can be accessed by:
peak.assignments[0][0].nmrResidue

and then sequence code and residue type can be found (.residueType and .sequenceCode)

That is assuming that there is single assignment on that dimension.

As some of your peaks might not have Assign F1 you should use try/except python expression.

Peak annotation can be set by:
pk.annotation = myNewString

Best wishes,
Eliza

You may find this dictionary helpful:

threeToOneLetter = {
‘ALA’: ‘A’, ‘CYS’: ‘C’, ‘ASP’: ‘D’, ‘GLU’: ‘E’, ‘PHE’: ‘F’,
‘GLY’: ‘G’, ‘HIS’: ‘H’, ‘ILE’: ‘I’, ‘LYS’: ‘K’, ‘LEU’: ‘L’,
‘MET’: ‘M’, ‘ASN’: ‘N’, ‘PRO’: ‘P’, ‘GLN’: ‘Q’, ‘ARG’: ‘R’,
‘SER’: ‘S’, ‘THR’: ‘T’, ‘VAL’: ‘V’, ‘TRP’: ‘W’, ‘TYR’: ‘Y’
}

Eliza

It worked. Many Tnx.