View source: R/calc_number_assignments.R
| calc_number_assignment | R Documentation |
This function calculates the number of molecular formula (mf) assignments for each individual peak (peak_id) within a specified mass spectrum (ms_id). It counts the occurrences of molecular formulas assigned to each peak and returns a vector of counts corresponding to the number of assignments for each unique combination of mass spectrum ID, peak ID, and molecular formula.
calc_number_assignment(ms_id, peak_id, mf, ...)
ms_id |
A vector containing the mass spectrum ID for each peak. |
peak_id |
A vector containing the peak ID for each peak. |
mf |
Character vector of molecular formula(s)
(e.g., |
... |
Additional arguments passed to methods. |
A vector of integer counts representing the number of molecular formula assignments for each unique combination of mass spectrum ID, peak ID, and molecular formula.
Other calculations:
calc_data_summary(),
calc_dbe(),
calc_eval_params(),
calc_exact_mass(),
calc_ideg(),
calc_ma(),
calc_neutral_mass(),
calc_nm(),
calc_norm_int(),
calc_number_occurrence(),
calc_recalibrate_ms()
ms_ids <- c("file1", "file1", "file2", "file2", "file3")
peak_ids <- c(1, 2, 2, 3, 4)
mfs <- c("C10H10N2O8", "C10H12N2O8", "C10H10N2O8", "C10H11NOS4", "C10H24N4O2S")
n_assignments <- calc_number_assignment(ms_id = ms_ids, peak_id = peak_ids, mf = mfs)
print(n_assignments)
mf_data_demo[, calc_number_assignment(file_id, peak_id, mf)]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.