Generates a data summary table that provides intensity-weighted averages for element ratios, mass accuracy, and additional parameters. Results can be grouped based on the specified grouping columns.
calc_data_summary(mfd, grp = "file_id", ...)A data.table containing the summarized results, with columns including:
Number of molecular formulas per group.
Median accuracy in parts-per-million (ppm) for the identified peaks.
Maximum ppm accuracy within a three-sigma range.
Weighted average m/z value.
Weighted average Double Bond Equivalent (DBE).
Weighted averages for elements (C, H, N, O, P, S) and ratios (O/C, H/C, N/C, S/C).
Weighted average nominal oxidation state of carbon.
Weighted average Gibbs free energy (Cox) in kJ/mol.
Weighted average aromaticity index.
Ratios derived from N/C and S/C.
Indices for degree of identification, as calculated by calc_ideg().
Iteration error indices from calc_iterr().
Median intensity value.
Intensity of the base peak.
Summed intensity of all peaks.
data.table with molecular formula data as derived from
ume::assign_formulas. Column names of elements/isotopes must match names in
the isotope column of ume::masses; values are integers representing
counts per formula.
Character vector. Names of columns (e.g., sample or file identifiers) used to aggregate results.
Additional arguments passed to methods.
This function computes a variety of weighted averages and summary statistics for mass spectrometry data
using the provided peak list (mfd). Calculated values include weighted averages for elemental counts
(e.g., Carbon, Hydrogen), elemental ratios (e.g., O/C, H/C), and additional parameters such as the base peak intensity
and summed intensities. It also calculates the aromaticity index (wa(AI)) based on the elemental composition.
If grouping columns are provided, the summary statistics are calculated for each group.
The function also joins additional indices (ideg, iterr) from related functions calc_ideg() and calc_iterr()
to the final summary table.
Other calculations:
calc_dbe(),
calc_eval_params(),
calc_exact_mass(),
calc_ideg(),
calc_ma(),
calc_neutral_mass(),
calc_nm(),
calc_norm_int(),
calc_number_assignment(),
calc_number_occurrence(),
calc_recalibrate_ms()
# Example using demo data, grouping by file ID
calc_data_summary(mfd = mf_data_demo, grp = c("file_id"))
Run the code above in your browser using DataLab