Skip to content

Commit

Permalink
fix: fix issue #302
Browse files Browse the repository at this point in the history
- Allow optional parameters (...) to avoid errors if
`filterFourierTransformArtefacts` is combined with another peaks function.
  • Loading branch information
jorainer committed Sep 25, 2023
1 parent 585abb1 commit 6d16816
Show file tree
Hide file tree
Showing 3 changed files with 10 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: Spectra
Title: Spectra Infrastructure for Mass Spectrometry Data
Version: 1.11.10
Version: 1.11.11
Description: The Spectra package defines an efficient infrastructure
for storing and handling mass spectrometry spectra and functionality to
subset, process, visualize and compare spectra data. It provides different
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Spectra 1.11

## Changes in 1.11.11

- Fix issue with `filterFourierTransformArtefacts` function (see [issue
#302](https://github.com/rformassspectrometry/Spectra/issues/302)). Thanks
Adriano Rutz for reporting.

## Changes in 1.11.10

- `peaksData,MsBackendMemory` returns a `data.frame` if additional peak
Expand Down
6 changes: 3 additions & 3 deletions R/peaks-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ joinPeaksNone <- function(x, y, ...) {
threshold = 0.2,
keepIsotopes = TRUE,
maxCharge = 5,
isotopeTolerance = 0.005) {
isotopeTolerance = 0.005, ...) {
neutron <- 1.0033548378 # really C12, C13 difference
iso_dist <- neutron / seq(from = 1, by = 1, to = maxCharge)
## just calculate isotopes that are in the halfWindowSize
Expand Down Expand Up @@ -638,7 +638,7 @@ joinPeaksNone <- function(x, y, ...) {
#' @noRd
.peaks_filter_precursor_ne <- function(x, ppm = 20, tolerance = 0,
precursorMz, spectrumMsLevel,
msLevel = spectrumMsLevel) {
msLevel = spectrumMsLevel, ...) {
if (!spectrumMsLevel %in% msLevel || !nrow(x))
return(x)
keep <- is.na(closest(x[, "mz"], precursorMz, ppm = ppm,
Expand All @@ -656,7 +656,7 @@ joinPeaksNone <- function(x, y, ...) {
#' @noRd
.peaks_filter_precursor_keep_below <- function(x, ppm = 20, tolerance = 0,
precursorMz, spectrumMsLevel,
msLevel = spectrumMsLevel) {
msLevel = spectrumMsLevel, ...) {
if (!spectrumMsLevel %in% msLevel || !nrow(x))
return(x)
pmz <- precursorMz - tolerance - ppm(precursorMz, ppm = ppm)
Expand Down

0 comments on commit 6d16816

Please sign in to comment.