MsCoreUtils 1.2.0
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" "group"
## [13] "i2index" "imputeMethods"
## [15] "impute_bpca" "impute_knn"
## [17] "impute_matrix" "impute_min"
## [19] "impute_mixed" "impute_mle"
## [21] "impute_neighbour_average" "impute_with"
## [23] "impute_zero" "isPeaksMatrix"
## [25] "join" "localMaxima"
## [27] "medianPolish" "navdist"
## [29] "ndotproduct" "neuclidean"
## [31] "noise" "normalizeMethods"
## [33] "normalize_matrix" "nspectraangle"
## [35] "ppm" "rbindFill"
## [37] "refineCentroids" "rla"
## [39] "robustSummary" "rowRla"
## [41] "smooth" "validPeaksMatrix"
## [43] "valleys" "vapply1c"
## [45] "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.3470105 -1.0586825 0.6005437 -0.7324320 -0.4067380 -0.07051453 0.6699351
## B 0.1228877 -0.8760552 -0.8818618 -0.0865082 1.1137633 1.33603620 0.7894454
## C -0.1185074 0.3644178 1.3750451 1.1225026 0.6771452 -0.81227793 -0.5876608
## h i j
## A 0.62560551 -0.3940779 -0.06520374
## B 0.09095928 -0.7130372 0.23128401
## C -1.59714663 1.5477305 0.96367531
robustSummary(x)
## Warning in rlm.default(X, expression, ...): 'rlm' failed to converge in 20 steps
## a b c d e f
## 0.11713025 -0.52343994 0.45038000 0.10118748 0.46139017 0.12094303
## g h i j
## 0.31202324 -0.05912506 0.07977894 0.37658520
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.0.3 (2020-10-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.5 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.12-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.12-bioc/R/lib/libRlapack.so
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_US.UTF-8 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.2.0 BiocStyle_2.18.0
##
## loaded via a namespace (and not attached):
## [1] bookdown_0.21 digest_0.6.27 MASS_7.3-53
## [4] stats4_4.0.3 magrittr_1.5 evaluate_0.14
## [7] rlang_0.4.8 stringi_1.5.3 S4Vectors_0.28.0
## [10] rmarkdown_2.5 tools_4.0.3 stringr_1.4.0
## [13] parallel_4.0.3 xfun_0.18 yaml_2.2.1
## [16] compiler_4.0.3 BiocGenerics_0.36.0 BiocManager_1.30.10
## [19] htmltools_0.5.0 knitr_1.30