Skip to content

Address issue 823#828

Merged
sneumann merged 15 commits into
develfrom
jomain
Apr 22, 2026
Merged

Address issue 823#828
sneumann merged 15 commits into
develfrom
jomain

Conversation

@jorainer

Copy link
Copy Markdown
Collaborator

This PR:

- Add parameter `rtCenterFun` to `PeakDensityParam()` allowing to specify the
  function to calculate the feature's retention time from the assigned
  chromatographic peaks' retention times (issue #823).
- Ensure backward compatibility with `PeakDensityParam` not having that slot.
- Load test data from *MsDataHub* instead of *msdata* and remove dependency
  on *msdata*.
- Use `Spectra::rbindlistWithRownames()` for a fast,
  `data.table::rbindlist()`-based way to row-bind `data.frame`s.
@jorainer

Copy link
Copy Markdown
Collaborator Author

Note @sneumann : this PR includes now also:

  • remove dependency on the msdata R package: load all test files from MsDataHub. also the longtests were adapted accordingly.
  • performance improvement for some functions by using Spectra::rbindlistWithRownames() to row-bind data.frames.

@jorainer jorainer requested review from philouail and sneumann March 26, 2026 11:54
@jorainer

Copy link
Copy Markdown
Collaborator Author

Wait - why are there now merge conflicts. I will have a look at them


test_that("findChromPeaks,OnDiskMSnExp,MassifquantParam works", {
mzf <- system.file("microtofq/MM14.mzML", package = "msdata")
mzf <- faahko_3_files[1L]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the MsDataHub set of files have names instead of adressing by index ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's how I understood it. each file is one "data set", and they can be accessed by default through their name. But in this particular case I was defining the faahko_3_files variable in the main testthat.R file. It is 3 files from faahKO.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, now I got it. You wanted something like faahko_3_files["ko15.CDF"] instead of accessing by index. I think faahko_3_files does not have names, but I could directly use the MsDataHub::ko15.CDF() instead.

## Check that we've got all required columns
.reqCols <- c("mz", "rt", "sample")
if (sleep > 0)
if (sleep > 0 | rtCenterFun == "wMean")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, sleep >0 was for displaying stuff during processing ?
Ah, we need intensity either when displaying stuff or when calculating weights ? I was initially surprised why these quite different conditions were ored.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes exactly.

Comment thread R/XcmsExperiment.R
Comment thread tests/testthat.R Outdated
microtofq_fs <- c(system.file("microtofq/MM14.mzML", package = "msdata"),
system.file("microtofq/MM8.mzML", package = "msdata"))
microtofq_od <- readMSData(microtofq_fs, mode = "onDisk")
## microtofq_fs <- c(system.file("microtofq/MM14.mzML", package = "msdata"),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to get them into MsDataHub ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not want to add all files to MsDataHub - we can use other files for testing purposes too, the microtofq files were handy because they were small. There was no particular need or reason to use them (apart from the size). So I did not add them to MsDataHub but I changed to other test files. It's anyway better to use less different test files as they need to be downloaded and cached by the testing machine - so we save bandwidth.

Comment thread DESCRIPTION
MsFeatures,
MsExperiment (>= 1.5.4),
Spectra (>= 1.16.1),
Spectra (>= 1.21.5),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, found that Dependency bump

Comment thread DESCRIPTION Outdated
mgcv,
rhdf5
rhdf5,
MsDataHub

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Versioned MsDataHub ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I will add that.

@jorainer

Copy link
Copy Markdown
Collaborator Author

OK, @sneumann I fixed the merge conflicts. Also, I reverted to load the FAAH KO data files still from the faahKO R package. For now (this release) I think that's saver as we would need to change some additional test files, results files etc.

@sneumann

Copy link
Copy Markdown
Owner

Cool, I can confirm it works locally. Merging and pushing now.
Unsuer why we have a GH actions failure on Win+Mac, but that is not xcms related.
YOurs, STeffen

@sneumann sneumann merged commit 161fe37 into devel Apr 22, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants