Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing column names of chromatogram data.frames #304

Closed
philouail opened this issue Jan 28, 2025 · 3 comments · Fixed by #306
Closed

Changing column names of chromatogram data.frames #304

philouail opened this issue Jan 28, 2025 · 3 comments · Fixed by #306
Assignees

Comments

@philouail
Copy link

Hi,

Would it be possible to have the chromatogram() data.frames column names changed to "rtime" and "intensity" ? instead of "time" and their respective IDs

Currently implementing a mzR backend in Chromatograms and this change would really help efficiency so i would not need to loop through all the data.frames in the list only to change the colnames. These names are also in xcms (rtime()/intensity()) and Spectra (spectraVariables) so it would be better for consistency.

> MRM_file <- system.file("proteomics", "MRM-standmix-5.mzML.gz", package = "msdata")
> chromFile <- mzR::openMSfile(MRM_file)
> chromatogram(chromFile, 1) |> head()
          time      TIC
1 1.666667e-05 45.37833
2 4.233333e-03 44.39301
3 8.450000e-03 45.33704
4 1.266667e-02 44.30909
5 1.686667e-02 45.40231
6 2.108333e-02 44.29813
> chromFile <- mzR::openMSfile(MRM_file)
> chromatogram(chromFile, 2) |> head()
      time X..SRM.SIC.Q1.89.Q3.40.996.start.5.21145.end.15.20321667
1 5.211450                                                 42.34048
2 5.220850                                                 41.97664
3 5.230250                                                 41.46709
4 5.239650                                                 41.26899
5 5.249033                                                 41.12252
6 5.258433                                                 41.24522
@lgatto
Copy link
Collaborator

lgatto commented Jan 28, 2025

I think this would be a good change, to align the headings with the spectra data.

@sneumann
Copy link
Owner

sneumann commented Feb 6, 2025

Would we know any users for which this would be a breaking change ? Yours, Steffen

@jorainer
Copy link
Collaborator

jorainer commented Feb 6, 2025

it would break a unit test of Nils @nilshoffmann :) - apart from that, the only place that I know uses the chromatogram functionality from mzR is MSnbase. and there we are ignoring the column names: https://github.com/lgatto/MSnbase/blob/master/R/readChromData.R#L145-L150

jorainer added a commit to jorainer/mzR that referenced this issue Feb 10, 2025
- data.frames returned by `chromatogram()` have column names `"rtime"` and
  `"intensity"` (issue sneumann#304).
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 a pull request may close this issue.

4 participants