Diagnose SNR threshold in peak detection
Source:R/nmr_detect_peaks_align.R
nmr_detect_peaks_tune_snr.RdDiagnose SNR threshold in peak detection
Usage
nmr_detect_peaks_tune_snr(
ds,
NMRExperiment = NULL,
SNR_thresholds = seq(from = 2, to = 6, by = 0.1),
...
)Arguments
- ds
An nmr_dataset_1D dataset
- NMRExperiment
A string with the single NMRExperiment used explore the SNR thresholds. If not given, use the first one.
- SNR_thresholds
A numeric vector with the SNR thresholds to explore
- ...
Arguments passed on to
nmr_detect_peaksnmr_datasetAn nmr_dataset_1D.
nDivRange_ppmSegment size, in ppms, to divide the spectra and search for peaks.
baselineThreshAll peaks with intensities below the thresholds are excluded. Either:
A numeric vector of length the number of samples. Each number is a threshold for that sample
A single number. All samples use this number as baseline threshold.
NULL. If that's the case, a default function is used (nmr_baseline_threshold()), which assumes that there is no signal in the region 9.5-10 ppm.
range_without_peaksA numeric vector of length two with a region without peaks, only used when
baselineThresh = NULLfit_lorentziansIf
TRUE, fit a lorentzian to each detected peak, to infer its inflection points. For now disabled for backwards compatibility.verboseLogical (
TRUEorFALSE). Show informational messages, such as the estimated baselinescalesThe parameter of peakDetectionCWT function of MassSpecWavelet package, look it up in the original function.
SNR.ThThe parameter of peakDetectionCWT function of MassSpecWavelet package, look it up in the original function. If you set -1, the function will itself re-compute this value.
Value
A list with the following elements:
peaks_detected: A data frame with the columns from the nmr_detect_peaks output and an additional columnSNR_thresholdwith the threshold used on each row.num_peaks_per_region: A summary of thepeaks_detectedtable, with the number of peaks detected on each chemical shift regionplot_num_peaks_per_region: A visual representation ofnum_peaks_per_regionplot_spectrum_and_detections: A visual representation of the spectrum and the peaks detected with each SNR threshold. Use plotly::ggplotly or plot_interactive on this to zoom and explore the results.
See also
nmr_detect_peaks
Other peak detection functions:
Pipelines,
nmr_baseline_threshold(),
nmr_detect_peaks(),
nmr_detect_peaks_plot(),
nmr_detect_peaks_plot_overview(),
nmr_identify_regions_blood(),
nmr_identify_regions_cell(),
nmr_identify_regions_urine(),
nmr_integrate_regions()