View source: R/calc_norm_int.R
| calc_norm_int | R Documentation |
Computes normalized peak intensities for a molecular formula dataset and adds the results
as additional columns to the input data.table (mfd). It also calculates:
the number of molecular formula assignments per peak (n_assignments)
the total occurrences of each formula across the dataset (n_occurrence)
Normalized intensities are stored in a new column norm_int, and the reference
intensity used for normalization is stored in int_ref.
Supported normalization methods:
"none" – no normalization; raw peak intensities are copied to norm_int
"bp" – normalized to the base peak intensity per spectrum
"sum" – normalized by the total sum of intensities per spectrum
"sum_ubiq" – normalized by the sum of intensities of ubiquitous peaks across the dataset
"sum_rank" – normalized by the sum of the top n_rank most intense peaks per spectrum
"euc" – Euclidean normalization (optional, not implemented in current version)
calc_norm_int(
mfd,
ms_id = "file_id",
peak_id = "peak_id",
peak_magnitude = "i_magnitude",
normalization = c("bp", "sum", "sum_ubiq", "sum_rank", "none"),
n_rank = 200,
verbose = FALSE,
...
)
mfd |
data.table with molecular formula data as derived from
|
ms_id |
Character; name of the column identifying individual spectra (default: |
peak_id |
Character; name of the column identifying unique peaks (default: |
peak_magnitude |
Character; name of the column containing peak intensity values (default: |
normalization |
Character; normalization method to apply. One of |
n_rank |
Integer; number of top-ranked peaks to use for |
verbose |
logical; if |
... |
Additional arguments (currently unused). |
A data.table identical to mfd but with additional columns:
Normalized peak intensity based on selected method.
Reference intensity used for normalization (e.g., sum, base peak).
Number of formula assignments per peak (calculated internally).
Number of occurrences of each formula across all spectra (calculated internally).
Other calculations:
calc_data_summary(),
calc_dbe(),
calc_eval_params(),
calc_exact_mass(),
calc_ideg(),
calc_ma(),
calc_neutral_mass(),
calc_nm(),
calc_number_assignment(),
calc_number_occurrence(),
calc_recalibrate_ms()
mfd_norm <- calc_norm_int(
mfd = mf_data_demo,
normalization = "sum_ubiq"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.