Skip to content

Commit

Permalink
In addFragments() use ... to pass parameters to `calculateFragmen…
Browse files Browse the repository at this point in the history
…ts()`
  • Loading branch information
lgatto committed Nov 16, 2023
1 parent f4dd213 commit ae80f07
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: PSMatch
Title: Handling and Managing Peptide Spectrum Matches
Version: 1.7.0
Version: 1.7.1
Authors@R:
c(person(given = "Laurent", family = "Gatto",
email = "laurent.gatto@uclouvain.be",
Expand Down
17 changes: 17 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# PSMatch 1.7

## PSMatch 1.7.1

- In `addFragments()` use `...` to pass parameters to
`calculateFragments()`.

## PSMatch 1.7.0

- New Bioc devel.

# PSMatch 1.5

## PSMatch 1.5.0

- New Bioc devel.

# PSMatch 1.3

## PSMatch 1.3.3
Expand Down
9 changes: 7 additions & 2 deletions R/fragments-add.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
##' peaks to be considered matching (see [MsCoreUtils::common()]
##' for more details).
##'
##' @param ... additional parameters (except `verbose`) passed to
##' [calculateFragments()] to calculate fragment m/z values to be
##' added to the spectra in `x`.
##'
##' @return Return a `character()` with fragment ion labels.
##'
##' @importFrom MsCoreUtils common
Expand Down Expand Up @@ -64,7 +68,8 @@
##' plotSpectra(sp, labels = addFragments, labelPos = 3)
addFragments <- function(x,
tolerance = 0,
ppm = 20) {
ppm = 20,
...) {
stopifnot(requireNamespace("Spectra"))
stopifnot(inherits(x, "Spectra"),
length(x) == 1)
Expand All @@ -73,7 +78,7 @@ addFragments <- function(x,

## Prepare x and y data
x_data <- Spectra::peaksData(x)[[1L]]
y_data <- calculateFragments(y, verbose = FALSE)
y_data <- calculateFragments(y, verbose = FALSE, ...)
y_data <- y_data[order(y_data$mz), ]

## Find common peaks and prepare annotations
Expand Down
6 changes: 5 additions & 1 deletion man/addFragments.Rd

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

0 comments on commit ae80f07

Please sign in to comment.