process_chromatogram.Rd
The function takes smoothed d0, d1, and d2 vectors and processes the chromatogram by baseline expansion of peaks detected in the second derivative. In short, the algorithm detects all peak apices in the chromatogram as negative minima craddled by inflection points in the second derivative of the chromatogram. Each peak apex detected is then subjected to a baseline expansion algorithm in order to determine the peak boundaries and baseline boundaries of the peaks.
It is not recommended to use this function directly unless you know what you are doing. Instead, use the supplied API functions defined.
process_chromatogram(
d0,
d2,
st,
apex_thresh = 0,
w = 5L,
p = -1L,
liftoff = 0,
touchdown = 0.5,
output = 0L,
fit_emg = 1L,
fit_only_vip = 1L,
fit_hess = 0L,
fit_rel_lim = 0.05,
pts_per_peak = 30L,
min_shoulder_pts = 3L,
min_rounded_pts = 3L,
reltol = 1e-08,
abstol = -1e+35,
alpha = 1,
gamma = 2.1,
rho = 0.75,
sigma = 0.75,
maxit = 2000L,
maxeval = 2000L
)
Numeric vector containing the smoothed XIC trace
Numeric vector containing the second derivative of smoothed XIC
Numeric vector containing scan times
Second derivative threshold value.
Apex detection window. Do not change unless you know what you are doing.
Apex location of a specific peak. Leave blank if you wish to process the entire chromatogram.
Slope difference threshold (in percent) for the peak front.
Slope difference threshold (in percent) for the peak tail.
integer
value (0 = no output, 1 = verbose output).
Indicates if EMG deconvolution should be performed (0 = no EMG deconvolution, 1 = EMG deconvolution will be performed)
Indicates if EMG deconvolution should be performed on only the selected peak indicated by p (0 = no, 1 = yes)
Deprecated.
Minimum relative peak height of neighboring peaks to the selected peak that will be deconvoluted.
Minimum number of points per peak
Minimum number of points between minima and maxima for at least one of the peaks in a shoulder pair
Minimum number of points between minima and maxima for at least one of the peaks in a rounded peak pair
Relative tolerance of the Nelder-Mead minimizer for EMG deconvolution
Absolute tolerance of the Nelder-Mead minimizer for EMG deconvolution
Reflection coefficient of the Nelder-Mead minimizer for EMG deconvolution
Expansion coefficient of the Nelder-Mead minimizer for EMG deconvolution
Contraction coefficient of the Nelder-Mead minimizer for EMG deconvolution
Shrink coefficient of the Nelder-Mead minimizer for EMG deconvolution
Maximum iterations for the Nelder-Mead minimizer for EMG deconvolution
Maximum objective function calls for the Nelder-Mead minimizer for EMG deconvolution
A list of peak characteristics.
require("signal")
x <- seq(1, 200, 1)
st <- seq_len(length(x))*0.05
vec <- 1e5*dnorm(x, 100, 5) # create a vector with a gaussian peak
noise <- rnorm(length(x), 0, 5) # generate a noise vector
nvec <- vec + noise # create a noisy `chromatogram`.
smvec <- signal::sgolayfilt(nvec, n = 5) # smooth the vector using Savitzky-Golay
ddsmvec <- signal::sgolayfilt(nvec, n = 5, m = 2) # get the second derivative of the smoothed vector
cpc::process_chromatogram(d0 = smvec, d2 = ddsmvec, st = st, apex_thresh = 10)
#> $current_peak
#> [1] -1
#>
#> $d2_apex
#> [1] 99
#>
#> $adj_apex
#> [1] 99
#>
#> $front_inf
#> [1] 93.86427
#>
#> $tail_inf
#> [1] 104.0671
#>
#> $front_baseline_bound
#> [1] 70
#>
#> $tail_baseline_bound
#> [1] 132
#>
#> $front_peak_bound
#> [1] 77
#>
#> $tail_peak_bound
#> [1] 119
#>
#> $front_code
#> [1] 1
#>
#> $tail_code
#> [1] 1
#>
#> $area
#> [1] 99971.41
#>
#> $inf_area
#> [1] 68096.87
#>
#> $emg_mu
#> [1] 98.46778
#>
#> $emg_sigma
#> [1] 4.978848
#>
#> $emg_lambda
#> [1] 1.864577
#>
#> $emg_area
#> [1] 100144.2
#>
#> $emg_conv
#> [1] 1
#>