1 Introduction

The MsCoreUtils package 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] "closest"                  "coefMA"                  
##  [9] "coefSG"                   "coefWMA"                 
## [11] "colCounts"                "colMeansMat"             
## [13] "colSumsMat"               "common"                  
## [15] "entropy"                  "formatRt"                
## [17] "getImputeMargin"          "gnps"                    
## [19] "group"                    "i2index"                 
## [21] "imputeMethods"            "impute_MinDet"           
## [23] "impute_MinProb"           "impute_QRILC"            
## [25] "impute_RF"                "impute_bpca"             
## [27] "impute_fun"               "impute_knn"              
## [29] "impute_matrix"            "impute_min"              
## [31] "impute_mixed"             "impute_mle"              
## [33] "impute_neighbour_average" "impute_with"             
## [35] "impute_zero"              "isPeaksMatrix"           
## [37] "join"                     "join_gnps"               
## [39] "localMaxima"              "maxi"                    
## [41] "medianPolish"             "navdist"                 
## [43] "ndotproduct"              "nentropy"                
## [45] "neuclidean"               "noise"                   
## [47] "normalizeMethods"         "normalize_matrix"        
## [49] "nspectraangle"            "ppm"                     
## [51] "rbindFill"                "refineCentroids"         
## [53] "rla"                      "robustSummary"           
## [55] "rowRla"                   "rt2character"            
## [57] "rt2numeric"               "smooth"                  
## [59] "sumi"                     "validPeaksMatrix"        
## [61] "valleys"                  "vapply1c"                
## [63] "vapply1d"                 "vapply1l"                
## [65] "which.first"              "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  1.7669312  1.2298646 -1.067667 0.4286481  0.8211972  0.2179150  1.3048064
## B -1.7154889 -0.3577092  1.905307 1.1288369  0.8459668 -0.4307495 -0.5117094
## C  0.4133934 -1.2503281  1.983339 1.3623565 -1.2319845  0.1504698 -0.6441628
##           h           i          j
## A -1.481645 -0.00324188 -0.5239824
## B -1.621002  1.94224046  0.6789606
## C  1.882691 -0.06101210  0.8615792
robustSummary(x)
## Warning in rlm.default(X, expression, ...): 'rlm' failed to converge in 20
## steps
##           a           b           c           d           e           f 
##  0.44881457 -0.12605759  1.36932662  0.97328047  0.14920044 -0.02078823 
##           g           h           i           j 
##  0.04964472 -0.96856563  0.59388757  0.33885248

This function is typicall to be used to summarise peptide quantitation values into protein intensities1 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

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.3.2 (2023-10-31)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.3 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.18-bioc/R/lib/libRblas.so 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB              LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## time zone: America/New_York
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] MsCoreUtils_1.14.1 BiocStyle_2.30.0  
## 
## loaded via a namespace (and not attached):
##  [1] digest_0.6.33       R6_2.5.1            bookdown_0.36      
##  [4] fastmap_1.1.1       xfun_0.41           clue_0.3-65        
##  [7] cachem_1.0.8        knitr_1.45          BiocGenerics_0.48.1
## [10] htmltools_0.5.7     rmarkdown_2.25      stats4_4.3.2       
## [13] cli_3.6.1           sass_0.4.7          jquerylib_0.1.4    
## [16] compiler_4.3.2      tools_4.3.2         cluster_2.1.4      
## [19] evaluate_0.23       bslib_0.5.1         yaml_2.3.7         
## [22] BiocManager_1.30.22 S4Vectors_0.40.1    jsonlite_1.8.7     
## [25] rlang_1.1.1         MASS_7.3-60

References