MsCoreUtils 1.12.0
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" "getImputeMargin"
## [17] "gnps" "group"
## [19] "i2index" "imputeMethods"
## [21] "impute_MinDet" "impute_MinProb"
## [23] "impute_QRILC" "impute_RF"
## [25] "impute_bpca" "impute_fun"
## [27] "impute_knn" "impute_matrix"
## [29] "impute_min" "impute_mixed"
## [31] "impute_mle" "impute_mle2"
## [33] "impute_neighbour_average" "impute_with"
## [35] "impute_zero" "isPeaksMatrix"
## [37] "join" "join_gnps"
## [39] "localMaxima" "maxi"
## [41] "medianPolish" "navdist"
## [43] "ndotproduct" "neuclidean"
## [45] "noise" "normalizeMethods"
## [47] "normalize_matrix" "nspectraangle"
## [49] "ppm" "rbindFill"
## [51] "refineCentroids" "rla"
## [53] "robustSummary" "rowRla"
## [55] "rt2character" "rt2numeric"
## [57] "smooth" "sumi"
## [59] "validPeaksMatrix" "valleys"
## [61] "vapply1c" "vapply1d"
## [63] "vapply1l" "which.first"
## [65] "which.last"
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.93852850 0.4040895 0.3227661 -0.07927765 -0.1611747 -0.5654801 0.1403653
## B 0.01367579 -0.9530040 -1.1692491 0.25618379 0.2021810 1.1592822 -1.1915827
## C 1.25353697 -1.2146097 -0.2654046 0.72902752 -0.5505567 0.2747421 -0.8298118
## h i j
## A 0.3934719 1.1543129 0.57905139
## B 0.4152480 0.8122693 0.05451396
## C 0.2207512 1.5703100 0.89759410
robustSummary(x)
## a b c d e f g
## 0.7352471 -0.6735121 -0.3706292 0.3019779 -0.1698501 0.2102488 -0.6270097
## h i j
## 0.3431571 1.1789641 0.5103865
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.3.0 RC (2023-04-13 r84269)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.2 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.17-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.12.0 BiocStyle_2.28.0
##
## loaded via a namespace (and not attached):
## [1] digest_0.6.31 R6_2.5.1 bookdown_0.33
## [4] fastmap_1.1.1 xfun_0.39 clue_0.3-64
## [7] cachem_1.0.7 knitr_1.42 BiocGenerics_0.46.0
## [10] htmltools_0.5.5 rmarkdown_2.21 stats4_4.3.0
## [13] cli_3.6.1 sass_0.4.5 jquerylib_0.1.4
## [16] compiler_4.3.0 tools_4.3.0 cluster_2.1.4
## [19] evaluate_0.20 bslib_0.4.2 yaml_2.3.7
## [22] BiocManager_1.30.20 S4Vectors_0.38.0 jsonlite_1.8.4
## [25] rlang_1.1.0 MASS_7.3-59