1 Introduction

The MsCoreUtils package low-level functions for mass spectrometry data and is independent of any high-level data structures. 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_vector"     
##  [3] "asInteger"                "between"                 
##  [5] "bin"                      "closest"                 
##  [7] "coefMA"                   "coefSG"                  
##  [9] "coefWMA"                  "colCounts"               
## [11] "common"                   "formatRt"                
## [13] "gnps"                     "group"                   
## [15] "i2index"                  "imputeMethods"           
## [17] "impute_bpca"              "impute_fun"              
## [19] "impute_knn"               "impute_matrix"           
## [21] "impute_min"               "impute_mixed"            
## [23] "impute_mle"               "impute_neighbour_average"
## [25] "impute_with"              "impute_zero"             
## [27] "isPeaksMatrix"            "join"                    
## [29] "join_gnps"                "localMaxima"             
## [31] "medianPolish"             "navdist"                 
## [33] "ndotproduct"              "neuclidean"              
## [35] "noise"                    "normalizeMethods"        
## [37] "normalize_matrix"         "nspectraangle"           
## [39] "ppm"                      "rbindFill"               
## [41] "refineCentroids"          "rla"                     
## [43] "robustSummary"            "rowRla"                  
## [45] "rt2character"             "rt2numeric"              
## [47] "smooth"                   "validPeaksMatrix"        
## [49] "valleys"                  "vapply1c"                
## [51] "vapply1d"                 "vapply1l"

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.0094141  0.37949508 -1.3158996 -0.04159733 -1.297954  0.0658578 -0.7109123
## B  0.6370473 -0.01623919  0.4134491 -0.22230950 -0.331680 -2.4746859  1.4463141
## C -0.9982134  0.37366263  1.1624491  1.15835474  0.683873  1.3618853 -0.3235129
##           h          i         j
## A 0.7566009 -0.7024123 -1.133037
## B 0.2224417 -1.7107719  1.735707
## C 0.4982889  0.5700782  1.544235
robustSummary(x)
##           a           b           c           d           e           f 
##  0.55589901  0.24563951  0.08666620  0.29814930 -0.31525373  0.12305019 
##           g           h           i           j 
## -0.04122993  0.49244384 -0.61436865  0.89794078

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.1.0 (2021-05-18)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.2 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.13-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.13-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.4.0 BiocStyle_2.20.0 
## 
## loaded via a namespace (and not attached):
##  [1] knitr_1.33          cluster_2.1.2       magrittr_2.0.1     
##  [4] BiocGenerics_0.38.0 MASS_7.3-54         clue_0.3-59        
##  [7] R6_2.5.0            rlang_0.4.11        stringr_1.4.0      
## [10] tools_4.1.0         parallel_4.1.0      xfun_0.23          
## [13] jquerylib_0.1.4     htmltools_0.5.1.1   yaml_2.2.1         
## [16] digest_0.6.27       bookdown_0.22       BiocManager_1.30.15
## [19] sass_0.4.0          S4Vectors_0.30.0    evaluate_0.14      
## [22] rmarkdown_2.8       stringi_1.6.2       compiler_4.1.0     
## [25] bslib_0.2.5.1       stats4_4.1.0        jsonlite_1.7.2