EuracBiomedicalResearch / lcms-standards

Measurements of standard compounds in LC/MS setups and configurations at Eurac Research
1 stars 0 forks source link

Extract isotope pattern for each feature. #54

Open jorainer opened 3 years ago

jorainer commented 3 years ago

Define a function that helps identifying/subsetting a Spectra to extract the isotopes.

Have: one spectrum (i.e. a peak matrix with m/z and intensity values). Want: indices of rows in the matrix that match isotopes (e.g. list(c(4, 5, 6), c(9, 10), c(23, 24, 25)) or c(NA, 1, 1, 1, NA, NA, 2, NA, 2, NA, NA, NA, 3, 3, 3, NA, NA), which would define the grouping of peaks into isotope groups).

Things to consider:

Approach:

jorainer commented 3 years ago

the m/z differences and expected signal proportion should be provided as a list or data.frame (columns mz and intensity). ideally there should be a function isotopes or similar that returns that data.frame and has a parameter to allow defining whether single or double charged ions are expected and other settings (number of isotopes?).

jorainer commented 3 years ago

TODOs:

jorainer commented 3 years ago
.isotope_peaks <- function(x, isotopeDefinition = isotopeDefinition()) {
}

#' @return `data.frame` with columns `mz` and `intensity`
isotopeDefinition <- function(charge = c(1L, 2L)) {
     data.frame(mz = c(1.0033, 0.99...), intensity = ....)
}