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

Open
philouail opened this issue Jan 28, 2025 · 1 comment
Open

Changing column names of chromatogram data.frames #304

philouail opened this issue Jan 28, 2025 · 1 comment
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.

@jorainer jorainer self-assigned this Jan 29, 2025
jorainer added a commit to jorainer/mzR that referenced this issue Jan 29, 2025
- Change the column names of the `data.frame` returned by `chromatogram()` to
  `"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

No branches or pull requests

3 participants