Subject: Re: [nmr_sparky] rename resonances in batch mode?
From: Tom Goddard
Date: Sep 2, 2009

Previous: 596 Next: 599


Hi Liwen,

Sparky has no batch atom / residue renaming capability. The rename resonance dialog (rr) can rename one residue/atom in all peak assignments. But renaming many different atoms and residues at once is not available.

The Python interface to Sparky does not have functions to change atom and residue names, nor does it allow reassignment of peaks. So writing a Sparky Python script to do this is not feasible. Those operations are done in C++ which can be hard to modify.

One approach you could consider is to edit your Sparky spectrum session files with a text editor capable of doing batch search and replace operations. I never used an editor to replace hundreds of different text patterns at once so I dont know if any editors can do that. For the replacements that just drop the -1 (CA-1 to CA) you might be able to handle all those with a single search/replace. The assignment lines in the session files look like:

rs |L46|CA| |R47|N| |R47|HN|

To avoid replacing text that is not really an assignment you might include the vertical bars | in your search and replace. Peak labels also have the assignment text. You could try to edit those, or maybe just delete all the labels in Sparky and recreate them once the assignment names have been changed.

Of course make backup copies of your session files if you try any of this.

Tom


-------- Original Message --------
Subject: [nmr_sparky] rename resonances in batch mode?
From: liwenfu24
To: nmr_sparky
Date: 9/2/09 5:02 AM

Dear Dr. Goddard,

I am going to perform the side chain assignment of a protein with 230 residues.

After the backbone assignment, there are atom names like CA-1, CB-1, C-1 mixed with CA, CB, C.
So, I want to rename Q2 CA-1 to M1 CA and something like that. The accelerator rr can do that.
But it is error prone to rename all these atom names one by one (230 x 3 =~ 1000) .

I am wondering that is it possible to replace all the atom names at once.
For example, we can create a list (4 columns or 2 columns)
And then tell Sparky to read the list and replace all the atom names;

------------ ----
4 columns
------------ ----
Q2 CA-1 M1 CA
T3 CA-1 Q2 CA
------------ ----

------------ ----
2 columns
------------ ----
001 M1
002 Q2
------------ ----

If the atom name to be renamed does not exist, generate a warning file (log).

Thanks in advance!

Best regards,

Liwen Fu