Date: 2026-04-28

# Core Utils for Mass Spectrometry Data

MsCoreUtils Package Maintainers

#### 28 April 2026

#### Package

MsCoreUtils 1.24.0

# 1 Introduction

The MsCoreUtils package provides low-level functions for mass spectrometry data and is independent of any high-level data structures [@rainer_modular_2022]. These functions include mass spectra processing functions (noise estimation, smoothing, binning), quantitative aggregation functions (median polish, robust summarisation, …), missing data imputation, data normalisation (quantiles, vsn, …) as well as misc helper functions, that are used across high level data structure within the R for Mass Spectrometry packages.

For a full list of function, see

    library("MsCoreUtils")
    ls(pos = "package:MsCoreUtils")

    ##  [1] "%between%"                  "aggregate_by_matrix"
    ##  [3] "aggregate_by_vector"        "asInteger"
    ##  [5] "between"                    "bin"
    ##  [7] "breaks_ppm"                 "closest"
    ##  [9] "coefMA"                     "coefSG"
    ## [11] "coefWMA"                    "colCounts"
    ## [13] "colMeansMat"                "colSumsMat"
    ## [15] "common"                     "common_path"
    ## [17] "entropy"                    "estimateBaseline"
    ## [19] "estimateBaselineConvexHull" "estimateBaselineMedian"
    ## [21] "estimateBaselineSnip"       "estimateBaselineTopHat"
    ## [23] "force_sorted"               "formatRt"
    ## [25] "getImputeMargin"            "gnps"
    ## [27] "gnps_chain_dp"              "gnps_r"
    ## [29] "group"                      "i2index"
    ## [31] "imputeMethods"              "impute_MinDet"
    ## [33] "impute_MinProb"             "impute_QRILC"
    ## [35] "impute_RF"                  "impute_bpca"
    ## [37] "impute_fun"                 "impute_knn"
    ## [39] "impute_matrix"              "impute_min"
    ## [41] "impute_mixed"               "impute_mle"
    ## [43] "impute_neighbour_average"   "impute_with"
    ## [45] "impute_zero"                "isPeaksMatrix"
    ## [47] "join"                       "join_gnps"
    ## [49] "join_gnps_r"                "localMaxima"
    ## [51] "maxi"                       "medianPolish"
    ## [53] "navdist"                    "ndotproduct"
    ## [55] "nentropy"                   "neuclidean"
    ## [57] "noise"                      "normalizeMethods"
    ## [59] "normalize_matrix"           "nspectraangle"
    ## [61] "ppm"                        "rbindFill"
    ## [63] "reduce"                     "refineCentroids"
    ## [65] "retry"                      "rla"
    ## [67] "robustSummary"              "rowRla"
    ## [69] "rt2character"               "rt2numeric"
    ## [71] "smooth"                     "sumi"
    ## [73] "validPeaksMatrix"           "valleys"
    ## [75] "vapply1c"                   "vapply1d"
    ## [77] "vapply1l"                   "which.first"
    ## [79] "which.last"

or the reference page on the package webpage.

# 2 Examples

The functions defined in this package utilise basic classes with the aim of being reused in packages that provide a more formal, high-level interface.

As an examples, let’s take the `robustSummary()` function, that calculates the robust summary of the columns of a matrix:

    x <- matrix(rnorm(30), nrow = 3)
    colnames(x) <- letters[1:10]
    rownames(x) <- LETTERS[1:3]
    x

    ##            a          b           c          d          e          f          g
    ## A  0.5029536  0.3716349 0.003296359  0.3923337 -1.4426905 -1.4040766 -0.5856976
    ## B -1.0866110 -0.9935338 0.253254157  1.4411539  0.4655745 -0.4938384  0.5803728
    ## C -0.8022119 -0.4810143 0.647444978 -1.5275173  1.6655954 -0.3120851  1.2970639
    ##            h         i         j
    ## A -0.7516804 0.7348984 0.3714583
    ## B  1.6298301 1.0183741 0.2332927
    ## C -0.5460432 1.6085089 0.6837507

    robustSummary(x)

    ## Warning in rlm.default(X, expression, ...): 'rlm' failed to converge in 20
    ## steps

    ##          a          b          c          d          e          f          g
    ## -0.8961354 -0.6889842  0.3013318  0.7450814  0.4152044 -0.7366667  0.5296595
    ##          h          i          j
    ## -0.3987883  1.1205938  0.4295006

This function is typicall to be used to summarise peptide quantitation values into protein intensities1 1 1 See Sticker et al. Robust summarization and inference in proteome-wide label-free quantification. https://doi.org/10.1101/668863.. This functionality is available in

- the MSnbase::combineFeatures() function for `MSnSet` objects and

- the QFeatures::aggregateFeatures() function for `QFeatures` objects.

# 3 Contributions

If you would like to contribute any low-level functionality, please open a GitHub issue to discuss it. Please note that any contributions should follow the style guide and will require an appropriate unit test.

If you wish to reuse any functions in this package, please just go ahead. If you would like any advice or seek help, please either open a GitHub issue.

# Session information

    ## R version 4.6.0 Patched (2026-04-24 r89963)
    ## Platform: aarch64-apple-darwin23
    ## Running under: macOS Tahoe 26.3.1
    ##
    ## Matrix products: default
    ## BLAS:   /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib
    ## LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
    ##
    ## locale:
    ## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
    ##
    ## time zone: America/New_York
    ## tzcode source: internal
    ##
    ## attached base packages:
    ## [1] stats     graphics  grDevices utils     datasets  methods   base
    ##
    ## other attached packages:
    ## [1] MsCoreUtils_1.24.0 BiocStyle_2.40.0
    ##
    ## loaded via a namespace (and not attached):
    ##  [1] cli_3.6.6           knitr_1.51          rlang_1.2.0
    ##  [4] xfun_0.57           otel_0.2.0          generics_0.1.4
    ##  [7] jsonlite_2.0.0      clue_0.3-68         S4Vectors_0.50.0
    ## [10] htmltools_0.5.9     sass_0.4.10         stats4_4.6.0
    ## [13] rmarkdown_2.31      evaluate_1.0.5      jquerylib_0.1.4
    ## [16] MASS_7.3-65         fastmap_1.2.0       yaml_2.3.12
    ## [19] lifecycle_1.0.5     bookdown_0.46       BiocManager_1.30.27
    ## [22] cluster_2.1.8.2     compiler_4.6.0      digest_0.6.39
    ## [25] R6_2.6.1            bslib_0.10.0        tools_4.6.0
    ## [28] BiocGenerics_0.58.0 cachem_1.1.0

# References