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] "formatRt"                 "gnps"                    
## [17] "group"                    "i2index"                 
## [19] "imputeMethods"            "impute_bpca"             
## [21] "impute_fun"               "impute_knn"              
## [23] "impute_matrix"            "impute_min"              
## [25] "impute_mixed"             "impute_mle"              
## [27] "impute_neighbour_average" "impute_with"             
## [29] "impute_zero"              "isPeaksMatrix"           
## [31] "join"                     "join_gnps"               
## [33] "localMaxima"              "medianPolish"            
## [35] "navdist"                  "ndotproduct"             
## [37] "neuclidean"               "noise"                   
## [39] "normalizeMethods"         "normalize_matrix"        
## [41] "nspectraangle"            "ppm"                     
## [43] "rbindFill"                "refineCentroids"         
## [45] "rla"                      "robustSummary"           
## [47] "rowRla"                   "rt2character"            
## [49] "rt2numeric"               "smooth"                  
## [51] "validPeaksMatrix"         "valleys"                 
## [53] "vapply1c"                 "vapply1d"                
## [55] "vapply1l"                 "which.first"             
## [57] "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.9476911 -0.8168058  0.8601832  0.4376460  1.0158673  0.9584214  1.6181180
## B -0.6782130  0.2467040 -0.2203937 -1.2393683 -1.5305806 -0.6535056 -0.2758719
## C -0.5203563 -1.2962291 -0.6031945  0.3048539  0.1914018 -0.6035963 -0.8236085
##            h           i          j
## A -0.8474737  2.14732565 -0.3251910
## B  0.3151171 -0.09080328 -0.6869315
## C -1.5353939  0.10600593  0.3622200
robustSummary(x)
##           a           b           c           d           e           f 
## -0.71542012 -0.81508676  0.01219833 -0.16562282 -0.02160628 -0.09956017 
##           g           h           i           j 
##  0.17287919 -0.95000923  0.72084277 -0.21663419

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.2.0 RC (2022-04-21 r82226)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.4 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.16-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.16-bioc/R/lib/libRlapack.so
## 
## 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       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] MsCoreUtils_1.9.0 BiocStyle_2.25.0 
## 
## loaded via a namespace (and not attached):
##  [1] knitr_1.38          cluster_2.1.3       magrittr_2.0.3     
##  [4] BiocGenerics_0.43.0 MASS_7.3-57         clue_0.3-60        
##  [7] R6_2.5.1            rlang_1.0.2         fastmap_1.1.0      
## [10] stringr_1.4.0       tools_4.2.0         xfun_0.30          
## [13] cli_3.3.0           jquerylib_0.1.4     htmltools_0.5.2    
## [16] yaml_2.3.5          digest_0.6.29       bookdown_0.26      
## [19] BiocManager_1.30.17 sass_0.4.1          S4Vectors_0.35.0   
## [22] evaluate_0.15       rmarkdown_2.14      stringi_1.7.6      
## [25] compiler_4.2.0      bslib_0.3.1         stats4_4.2.0       
## [28] jsonlite_1.8.0

References