Skip to content

Commit

Permalink
docs: added more info about additional arguments in get_peaks
Browse files Browse the repository at this point in the history
responding to #27
  • Loading branch information
ethanbass committed Aug 17, 2023
1 parent d027b96 commit c6e96a2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Fixed bug in `plot_chroms` causing mismatched legend labels in base R plot.
* Added additional arguments to `plot_chroms` function: `xlim`,`ylim`, and `legend_position`.
* Added additional information about arguments available in `get_peaks` for fine-tuning the peak-finding algorithm (in response to [#27](https://github.com/ethanbass/chromatographR/issues/27)).

# chromatographR 0.5.2

Expand Down
21 changes: 17 additions & 4 deletions R/get_peaks.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
#'
#' Peaks are located by finding zero-crossings in the smoothed first derivative
#' of the specified chromatographic traces (function \code{\link{find_peaks}}).
#' At the given positions, an exponential-gaussian hybrid (or regular gaussian)
#' function is fit to the signal using \code{\link{fit_peaks}}). The area is then
#' calculated using a trapezoidal approximation.
#' Additional arguments can be provided to \code{\link{find_peaks}} to fine-tune
#' the peak-finding algorithm. For example, the \code{smooth_window} can be
#' increased to prevent peaks from being split into multiple features. Overly
#' aggressive smoothing may cause small peaks to be overlooked. At the given
#' positions, an exponential-gaussian hybrid (or regular gaussian)
#' function is fit to the signal using \code{\link{fit_peaks}} according to the
#' value of \code{fit}. Finally, the area is calculated using trapezoidal
#' approximation.
#'
#' The \code{sd}, \code{FWHM}, \code{tau}, and \code{area} are returned in units
#' determined by \code{time.units}. By defaults the units are in minutes.
Expand Down Expand Up @@ -35,7 +40,11 @@
#' Either an integer specifying the number of clusters to use for parallel
#' processing or a cluster object created by \code{\link[parallel]{makeCluster}}.
#' Defaults to 2. On Windows integer values will be ignored.
#' @param \dots Additional arguments to \code{\link{find_peaks}}.
#' @param \dots Additional arguments to \code{\link{find_peaks}}. Arguments
#' provided to \code{\link{find_peaks}} can be used to fine-tune the peak-finding
#' algorithm. Most importantly, the \code{smooth_window} should be increased if
#' features are being split into multiple bins. Other arguments that can be used
#' here include \code{smooth_type}, \code{slope_thresh}, and \code{amp_thresh}.
#' @return The result is an S3 object of class \code{peak_list}, containing a nested
#' list of data.frames containing information about the peaks fitted for each
#' chromatogram at each specified wavelength. The data.frame includes information
Expand All @@ -52,6 +61,10 @@
#' function authored by Ron Wehrens (though the underlying algorithms for peak
#' identification and peak-fitting are not the same).
#' @references
#' O'Haver, Tom. Pragmatic Introduction to Signal Processing:
#' Applications in scientific measurement.
#' /href{https://terpconnect.umd.edu/~toh/spectrum/} (Accessed January, 2022).
#'
#' Wehrens, R., Carvalho, E., Fraser, P.D. 2015. Metabolite profiling in
#' LC–DAD using multivariate curve resolution: the alsace package for R. \emph{
#' Metabolomics} \bold{11}:143-154. \doi{10.1007/s11306-014-0683-5}
Expand Down
21 changes: 17 additions & 4 deletions man/get_peaks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c6e96a2

Please sign in to comment.