Automating Restricted Peak Picking

22 views
Skip to first unread message

Thomas Evangelidis

unread,
Apr 8, 2025, 2:20:53 PMApr 8
to NMR POKY/SPARKY USER GROUP

Hi Woonghee,

is it possible to script and automate restricted peak picking in POKY? I divide the peaks in the reference spectrum into groups, each with different tolerances (see the attachment; I save the tolerances of each peak as a "Note"). However, for large proteins—like the one I’m currently working on (29 kDa)—the restricted picking for each group takes a very long time to complete.

I was wondering if it’s possible to write a script to do the restricted peak picking for all groups of peaks and let it run unattended for several hours.

Thank you in advance,

Thomas

Screenshot from 2025-04-08 20-05-29.png


Lee, Woonghee

unread,
Apr 8, 2025, 3:40:10 PMApr 8
to Thomas Evangelidis, NMR POKY/SPARKY USER GROUP

Thomas,

 

Sure, you can.

 

Let say your spectrum instance is called “spec”.

 

picked_peaks = spec.pick_peaks(region, height_threshholds, min_linewidth, min_dropoff)

 

So, in your case you can loop through regions.

 

Woonghee Lee, I.E.I.P., M.S., Ph.D.

 

Assistant Professor & Data Science and Chemistry Certificate Program Director

Department of Chemistry

University of Colorado Denver

1151 Arapahoe St. (Science Bldg.) Rm 4128A (office), Rm 4128 (dry lab), Rm 4133 (wet lab)

Denver, CO 80217-3364, USA

Office: +1-303-315-7672

woongh...@ucdenver.edu

 

https://poky.clas.ucdenver.edu

https://poky.clas.ucdenver.edu/wlee-group

https://clas.ucdenver.edu/chemistry/woonghee-lee

https://clas.ucdenver.edu/chemistry/data-science-and-chemistry-certificate

 

Shipping/Mailing Address:

Woonghee Lee

1201 5th St. UCD CHEM-194

P.O. Box 173364 (USPS)

Denver, CO 80204, USA

 

A white circle with blue text and a black background

Description automatically generated

 

From: nmr-s...@googlegroups.com <nmr-s...@googlegroups.com> on behalf of Thomas Evangelidis <tev...@aiffinity.com>
Date: Tuesday, April 8, 2025 at 12:21 PM
To: NMR POKY/SPARKY USER GROUP <nmr-s...@googlegroups.com>
Subject: [NMR POKY/SPARKY] Automating Restricted Peak Picking

[External Email - Use Caution]

 

--
You received this message because you are subscribed to the Google Groups "NMR POKY/SPARKY USER GROUP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nmr-sparky+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nmr-sparky/15ec8008-c848-4d6a-b693-82cd752bc323n%40googlegroups.com.

Lee, Woonghee

unread,
Apr 8, 2025, 3:46:45 PMApr 8
to Thomas Evangelidis, NMR POKY/SPARKY USER GROUP

Thomas,

 

One reason the speed matters is that the screen updates every time picking for one region is done when you run through multiple regions. So that you can do a kind of “coarse grain (merging regions)” picking and filtering out unmatched peaks based on your tolerance for better performance. This needs some trials and errors to find the best settings.

 

Woonghee Lee, I.E.I.P., M.S., Ph.D.

 

Assistant Professor & Data Science and Chemistry Certificate Program Director

Department of Chemistry

University of Colorado Denver

1151 Arapahoe St. (Science Bldg.) Rm 4128A (office), Rm 4128 (dry lab), Rm 4133 (wet lab)

Denver, CO 80217-3364, USA

Office: +1-303-315-7672

woongh...@ucdenver.edu

 

https://poky.clas.ucdenver.edu

https://poky.clas.ucdenver.edu/wlee-group

https://clas.ucdenver.edu/chemistry/woonghee-lee

https://clas.ucdenver.edu/chemistry/data-science-and-chemistry-certificate

 

Shipping/Mailing Address:

Woonghee Lee

1201 5th St. UCD CHEM-194

P.O. Box 173364 (USPS)

Denver, CO 80204, USA

 

A white circle with blue text and a black background

Description automatically generated

 

Thomas Evangelidis

unread,
Apr 9, 2025, 3:04:17 PMApr 9
to Lee, Woonghee, NMR POKY/SPARKY USER GROUP

Hi Woonghee,

I’m attaching the updated “Restricted Peak Pick” plugin file, now enhanced to use custom tolerance values read from the Note of each peak.

I’ve added a toggle button labeled "Use tolerance values from 'Note'". When activated, the program iterates through each peak and performs restricted peak picking using the tolerance values specified in the Note field, which must follow this format:
<nucleus>=<float>, <nucleus>=<float>, ...

I’ve tested this on a 2D → 4D case, and it works correctly in both the new mode and the previous modes, producing consistent results. I haven’t tested it yet on 2D → 3D or 3D → 4D, but in principle, it should work.

Feel free to replace the existing python file if you'd like to include this in the main distribution.

Also, following your suggestion, I now perform restricted peak picking in two rounds. In the first round, I select about half of the 2D peaks (as shown in the screenshot). After selecting and removing irrelevant 4D peaks, I run the process again with the remaining 2D peaks. With this method and the new enhancement, the process has become really efficient!

Best regards,
Thomas


--
======================================================================

Dr. Thomas Evangelidis

CEO & CTO

AI|ffinity s.r.o.

Twitter: tevangelidis, LinkedIn: Thomas Evangelidis

restrictedpick.py
Restricted_Peak_Picking_N-HN_to_4D_round1.png

Lee, Woonghee

unread,
Apr 9, 2025, 3:51:07 PMApr 9
to Thomas Evangelidis, NMR POKY/SPARKY USER GROUP

Thank you  Thomas. I will take a look.

 

 

Woonghee Lee, I.E.I.P., M.S., Ph.D.

 

Assistant Professor & Data Science and Chemistry Certificate Program Director

Department of Chemistry

University of Colorado Denver

1151 Arapahoe St. (Science Bldg.) Rm 4128A (office), Rm 4128 (dry lab), Rm 4133 (wet lab)

Denver, CO 80217-3364, USA

Office: +1-303-315-7672

woongh...@ucdenver.edu

 

https://poky.clas.ucdenver.edu

https://poky.clas.ucdenver.edu/wlee-group

https://clas.ucdenver.edu/chemistry/woonghee-lee

https://clas.ucdenver.edu/chemistry/data-science-and-chemistry-certificate

 

Shipping/Mailing Address:

Woonghee Lee

1201 5th St. UCD CHEM-194

P.O. Box 173364 (USPS)

Denver, CO 80204, USA

 

A white circle with blue text and a black background

Description automatically generated

 

Thomas Evangelidis

unread,
Apr 9, 2025, 4:02:07 PMApr 9
to Lee, Woonghee, NMR POKY/SPARKY USER GROUP
I am sorry. Here is the restrictedpick.py zipped.
restrictedpick.zip
Reply all
Reply to author
Forward
0 new messages