View source: R/read_NMR_spectra.R
| peak_detection2d | R Documentation |
Detects local maxima in each spectrum of a 2D NMR dataset and converts the detected peaks into a 1D specmine dataset suitable for downstream analysis.
peak_detection2d(
specmine_2d_dataset,
baseline_thresh = NULL,
noiseFilt = 0,
negatives = FALSE,
verbose = TRUE
)
specmine_2d_dataset |
A specmine 2D dataset containing one numeric matrix per sample. |
baseline_thresh |
Optional numeric threshold used as the minimum intensity for peak detection.
If |
noiseFilt |
Integer noise filter level: |
negatives |
Logical indicating whether variables with negative ppm values should be kept. |
verbose |
Logical indicating whether progress messages should be shown. |
A specmine dataset object as a list. The data element is a numeric matrix where
rows correspond to detected 2D peak coordinates encoded as combined F1/F2 positions and columns
correspond to samples. Matrix entries contain peak intensities, with missing values indicating
that a given peak was not detected in a sample. The returned object also includes the original
sample metadata, the dataset description, the dataset type set to "nmr-peaks", and
labels describing the x-axis and data values. This output represents a reduced 1D peak table
derived from the input 2D NMR spectra.
m <- matrix(c(0, 5, 0, 0), nrow = 2)
rownames(m) <- c("1.0", "1.1")
colnames(m) <- c("2.0", "2.1")
x <- list(data = list(s1 = m), metadata = data.frame(), description = "Toy")
try(peak_detection2d(x, baseline_thresh = 1, negatives = TRUE, verbose = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.