HeightError or SNR values for assigned peaks

   Hi, Thanks for the help and answering questions. Is there a way to get Height Error or SNR for the peak list table shown here. I tried to just use the estimated noise level, but it shows one order of magnitude more noise compared to other NMR processing program. It is for a 13C-13C DARR spectra where I transferred assignment from Star file using a Macro file was done by Vicky in the past Thanks!!!..     


Nesreen

Hi Nesreen,

You can see the signal to noise ratio S/N for a peak with the command peak.signalToNoiseRatio.
It is calculated as:
S/N = 2.5A/Npp
where
A = height of the chosen peak
and
Npp = peak-to-peak noise (spectrum noise threshold positive and negative limits).

Open the Python Console from View menu or with the shortcut space-space.
Select one or few peaks, assuming you set the noise threshold value from the estimate noise popup then run:

Python
  1. for peak in current.peaks:
  2. print(f`Pid: {peak.pid}, S/N: {peak.signalToNoiseRatio}`)




We will add to the table the height error, (calculated from the fitting), and the S/N in two different columns.

(06-01-2021, 12:37 pm)LucaM Wrote:
Python
  1. for peak in current.peaks:
  2.    print(f`Pid: {peak.pid}, S/N: {peak.signalToNoiseRatio}`)





How can you implement this code. I usually just use the interface. Do I simply run in on the terminal window?

Hi,
I tend to open the Python console with Space,Space (or View / Python Console) and then type/paste code into the lower part of the console.
Best wishes,
Vicky

(08-04-2021, 06:46 pm)VickyH Wrote: Hi,
I tend to open the Python console with Space,Space (or View / Python Console) and then type/paste code into the lower part of the console.
Best wishes,
Vicky

I totally missed it in LucaM`s first post. Thanks for the reply Vicky you are the best.

I notice that we have the ability to add `HeightError` and `VolumeError` to our peak tables. Is there a way to calculate these values and add them to the table?

If you reckoned that the peak Error was simply the spectrum noise, you could set the values with something like this:

Python
  1. sp = get(`SP:hsqc`)
  2. pl = get(`PL:hsqc.1`)
  3. for peak in pl.peaks:
  4. peak.heightError = sp.noiseLevel



Working out what the volume error is, might be a bit more complicated. We do a fit for the volume, so in theory you`d have to Monte Carlo style thing with lots fits to get an error estimate.