Skip to content

Add support for skipFilled in featureSpectra for XcmsExperiment and two bug fixes#815

Merged
sneumann merged 10 commits intodevelfrom
jomain
Oct 13, 2025
Merged

Add support for skipFilled in featureSpectra for XcmsExperiment and two bug fixes#815
sneumann merged 10 commits intodevelfrom
jomain

Conversation

@jorainer
Copy link
Collaborator

In this PR:

  • Fix conversion from XcmsExperiment objects to XCMSnExp (issue Convert XcmsExperiment to XCMSnExp object error #807).
  • Add parameter columns to chromPeakData() to allow extraction of selected columns.
  • Add support for parameter skipFilled to featureSpectra() for XcmsExperiment and XcmsExperimentHdf5 to avoid extraction of spectra for gap-filled chromatographic peaks.
  • Fix: add missing import of the spectraData() method from Spectra.

- Fix issue #812 : parameters `minFraction` and `maxFeatures` were not correctly
  considered in `plotChromPeakDensity()`.
- Add parameter `columns` to `chromPeakData()` for `XCMSnExp` and
  `XcmsExperiment` classes to allow extraction of selected columns.
- Add support for parameter `columns` to the `chromPeakData()` method for
  `XcmsExperimentHdf5` objects.
- Parameter `skipFilled` is now supported for `featureSpectra,XcmsExperiment`.
- Add unit tests checking that parameter `skipFilled` works correctly for
  `featureSpectra()` for `XcmsExperimentHdf5` objects.
@jorainer
Copy link
Collaborator Author

@sneumann , sorry to be a bit pushy here, but we should try to manage getting this PR into xcms before the next Bioconductor release. This contains some important bug fixes.

- `featureArea()` and `ChromPeakAreaParam()` gain additional parameter
  `minMzWidthPpm` that allows to define a minimal guaranteed m/z width of the
  reported feature areas respectively regions to integrate data for gap
  filling (issue #756).
@jorainer
Copy link
Collaborator Author

Note: added in the meantime also an additional parameter minMzWidthPpm for featureArea() and ChromPeakAreaParam() to address issue #756 .

Copy link
Owner

@sneumann sneumann left a comment

Choose a reason for hiding this comment

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

tiny cosmetic comments

R/DataClasses.R Outdated
)
mzmax = "function",
minMzWidthPpm = "numeric"),
contains = "Param",,
Copy link
Owner

Choose a reason for hiding this comment

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

what is the intention behind ,, here ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, wow! does not make any sense, true. I'll remove. Thanks!

mtch <- as.matrix(
findMatches(sps$chrom_peak_id,
rownames(.chromPeaks(object))[pindex]))
rownames(xcms:::.chromPeaks(object))[pindex]))
Copy link
Owner

Choose a reason for hiding this comment

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

::: should not be needed here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch - was a leftover from some tests. I'll remove.

## rtdiff = diff(range(fd$rtmed[z])))
## }) |> do.call(what = rbind)
##
## Thoughts on how to combine overlapping features:
Copy link
Owner

Choose a reason for hiding this comment

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

so within a file overlapping features would result from non-optimal feature detection.
Across samples overlapping features could come from non-optimal correspondence analysis.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes - we've had now a dataset where we've seen some strange overlap in features. the idea of this function would be sort of quality check of the correspondence settings. but I'm not yet sure whether that's helpful. so, I just jotted down the idea to not forget to look more into it.

Copy link
Owner

Choose a reason for hiding this comment

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

I like the idea of having a corner of QC methods being calculated, with later the option to export those as mzQC values. but indeed, not just yet.

@sneumann sneumann merged commit e2f76c8 into devel Oct 13, 2025
2 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