management of lower/upper m/z bounds
define lower and upper bounds depending on 1) peptide oligomerization, 2) polyphenol list, 3) ionization type
In the example (positive ionization mode):
aa1_mw is the list of the aa molecular weight
polyphenol is the list of the polyphenol molecular weight loaded by the user
the lower bounds: min_theo <- (min(aa1_mw) + min(polyphenols)) + H
the upper bounds: max_theo <- (max(aa1_mw) + max(polyphenols)) + H
the code
# study case -> here select the data
min_theo <- (min(aa1_mw) + min(polyphenols)) + H
max_theo <- (max(aa1_mw) + max(polyphenols)) + H
study_case <- feature_md %>%
select(name, mz) %>%
filter(mz >= min_theo & mz <= max_theo)
# Matching
study_case_extended <- pmap_dfr(
study_case,
function(name, mz) {
mz_obs <- mz
match <- match_near_mz_obs_with_tolerance(
mz_obs = mz_obs,
mode = "pos",
compounds = combined_compounds,
initial_ppm = 0,
max_ppm = 10000,
step = 100
)
# Ajouter les infos d’origine
match$name <- name
match$mz_theo <- mz_obs
print(match)
match %>%
select(name, mz_obs, mz_theo, ppm_error_value, ppm_used)
}
)
View(study_case_extended)