Skip to content

add peak info in manualChromPeaks output #788

@mar-garcia

Description

@mar-garcia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions