MsCoreUtils 1.6.2
The MsCoreUtils
package low-level functions for mass spectrometry data and is
independent of any high-level data structures (Rainer et al. 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_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.
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.04878739 0.9844027 1.0124980 0.2119514 1.0274833 -0.5669369 -1.4734441
## B 0.44949315 0.3694720 -0.2901313 0.5540460 1.2082780 0.2299130 -0.4566249
## C -0.25168571 -0.9873657 1.2486298 -0.8043810 -0.7933826 0.7043847 -0.7594495
## h i j
## A 1.5490779 -1.8807822 -0.5486460
## B 2.1461282 -0.3847077 -0.9954360
## C -0.7950085 -0.5237942 -0.4964124
robustSummary(x)
## a b c d e f
## 0.04967335 0.12216969 0.79310806 -0.01279455 0.48260723 0.12245359
## g h i j
## -0.89650619 1.21237104 -0.92976134 -0.68016484
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
the
MSnbase::combineFeatures()
function for MSnSet
objects and
the
QFeatures::aggregateFeatures()
function for QFeatures
objects.
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.
## R version 4.1.2 (2021-11-01)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.3 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.14-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.14-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.6.2 BiocStyle_2.22.0
##
## loaded via a namespace (and not attached):
## [1] knitr_1.37 cluster_2.1.2 magrittr_2.0.2
## [4] BiocGenerics_0.40.0 MASS_7.3-55 clue_0.3-60
## [7] R6_2.5.1 rlang_1.0.1 fastmap_1.1.0
## [10] stringr_1.4.0 tools_4.1.2 xfun_0.29
## [13] cli_3.2.0 jquerylib_0.1.4 htmltools_0.5.2
## [16] yaml_2.3.5 digest_0.6.29 bookdown_0.24
## [19] BiocManager_1.30.16 sass_0.4.0 S4Vectors_0.32.3
## [22] evaluate_0.15 rmarkdown_2.11 stringi_1.7.6
## [25] compiler_4.1.2 bslib_0.3.1 stats4_4.1.2
## [28] jsonlite_1.8.0
Rainer, Johannes, Andrea Vicini, Liesa Salzer, Jan Stanstrup, Josep M. Badia, Steffen Neumann, Michael A. Stravs, et al. 2022. “A Modular and Expandable Ecosystem for Metabolomics Data Annotation in R.” Metabolites 12 (2): 173. https://doi.org/10.3390/metabo12020173.