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

add peak info in manualChromPeaks output #788

Open
mar-garcia opened this issue Feb 12, 2025 · 0 comments
Open

add peak info in manualChromPeaks output #788

mar-garcia opened this issue Feb 12, 2025 · 0 comments

Comments

@mar-garcia
Copy link
Contributor

Hi!

With this issue I would like to make a request that I belive would be useful for the users of the manualChromPeaks() function :)
It would be great if in the output of this function there would also be a column referring to a sort of chromatographic peak ID (I mean, like it is for the sample).

For example:

## Read a test dataset.
fls <- c(system.file("microtofq/MM14.mzML", package = "msdata"),
         system.file("microtofq/MM8.mzML", package = "msdata"))

## Define a data frame with some sample annotations
ann <- data.frame(
  injection_index = 1:2,
  sample_id = c("MM14", "MM8"))

## Import the data
library(MsExperiment)
mse <- readMsExperiment(fls)

## Define some arbitrary peak areas
pks <- cbind(
  mzmin = c(216, 302.9), mzmax = c(216.2, 303.2),
  rtmin = c(55, 267), rtmax = c(67, 282)
)
pks
     mzmin mzmax rtmin rtmax
[1,] 216.0 216.2    55    67
[2,] 302.9 303.2   267   282

res <- manualChromPeaks(mse, pks)
chromPeaks(res)
          mz mzmin mzmax        rt rtmin rtmax      into sample  maxo sn
CP1 303.0486 302.9 303.2 273.02500   267   282 326965.59      1 80132 NA
CP2 216.0923 216.0 216.2  58.70598    55    67  51420.69      2 14936 NA

What I intend to ask is to add an additional column in the output of chromPeaks(res) indicating that the CP1 refers to the second item indicated in pks and that the CP2 refers to the first item indicated in the pks object.

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

1 participant