diff --git a/articles/MsCoreUtils.html b/articles/MsCoreUtils.html index 3571ea7f..0f47e54d 100644 --- a/articles/MsCoreUtils.html +++ b/articles/MsCoreUtils.html @@ -165,20 +165,20 @@

Examplescolnames(x) <- letters[1:10] rownames(x) <- LETTERS[1:3] x -
##             a          b         c          d         e          f          g
-## A -0.46339304 0.01975971  0.162448  0.5049823 1.0239974 -0.4219314  0.6361069
-## B  0.49418853 0.17127790 -1.288225 -1.2631087 0.1822335 -0.8314057 -0.8196632
-## C -0.05107349 0.19072298 -1.558514 -0.8334451 0.8316873  0.7105504 -1.2842138
-##            h           i          j
-## A  0.3831507 -0.07130045  0.9514283
-## B -0.9280957 -0.52592054  2.1732882
-## C -1.3443066 -0.12794852 -0.5325772
+
##           a          b          c         d         e          f         g
+## A 0.7786362  0.9855785  0.5897485 0.3732384  1.663485 -1.5751422  1.339675
+## B 1.4115361 -0.2538868 -0.1390220 0.3026787 -1.897538 -0.4812638 -1.017238
+## C 0.7171656  0.4444280 -1.9245409 1.1007164  1.106173 -0.9821474 -1.544728
+##            h          i          j
+## A  0.2568210 -0.5381242 -0.1942551
+## B -0.1092041  0.3106737  1.3392343
+## C -1.6788085 -0.3711854  0.2933841
 robustSummary(x)
-
##           a           b           c           d           e           f 
-##  0.04629287  0.12725353 -0.89476393 -0.53052382  0.67930606 -0.35683411 
-##           g           h           i           j 
-## -0.48925668 -0.62975052 -0.24172317  0.52262812
+
##          a          b          c          d          e          f          g 
+##  0.9691126  0.3920399 -0.3547146  0.5922112  1.0063147 -1.0128511 -0.7501852 
+##          h          i          j 
+## -0.5063034 -0.1995453  0.4915649

This function is typicall to be used to summarise peptide quantitation values into protein intensities1. This functionality is diff --git a/pkgdown.yml b/pkgdown.yml index 72252897..88932341 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: MsCoreUtils: MsCoreUtils.html -last_built: 2024-01-24T07:43Z +last_built: 2024-01-24T07:44Z urls: reference: https://rformassspectrometry.github.io/MsCoreUtils/reference article: https://rformassspectrometry.github.io/MsCoreUtils/articles diff --git a/search.json b/search.json index a3d5397e..93789b98 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://rformassspectrometry.github.io/MsCoreUtils/articles/MsCoreUtils.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Core Utils for Mass Spectrometry Data","text":"MsCoreUtils package low-level functions mass spectrometry data independent high-level data structures [@rainer_modular_2022]. functions include mass spectra processing functions (noise estimation, smoothing, binning), quantitative aggregation functions (median polish, robust summarisation, …), missing data imputation, data normalisation (quantiles, vsn, …) well misc helper functions, used across high level data structure within R Mass Spectrometry packages. full list function, see reference page package webpage.","code":"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] \"entropy\" \"estimateBaseline\" ## [17] \"estimateBaselineConvexHull\" \"estimateBaselineMedian\" ## [19] \"estimateBaselineSnip\" \"estimateBaselineTopHat\" ## [21] \"formatRt\" \"getImputeMargin\" ## [23] \"gnps\" \"group\" ## [25] \"i2index\" \"impute_bpca\" ## [27] \"impute_fun\" \"impute_knn\" ## [29] \"impute_matrix\" \"impute_min\" ## [31] \"impute_MinDet\" \"impute_MinProb\" ## [33] \"impute_mixed\" \"impute_mle\" ## [35] \"impute_neighbour_average\" \"impute_QRILC\" ## [37] \"impute_RF\" \"impute_with\" ## [39] \"impute_zero\" \"imputeMethods\" ## [41] \"isPeaksMatrix\" \"join\" ## [43] \"join_gnps\" \"localMaxima\" ## [45] \"maxi\" \"medianPolish\" ## [47] \"navdist\" \"ndotproduct\" ## [49] \"nentropy\" \"neuclidean\" ## [51] \"noise\" \"normalize_matrix\" ## [53] \"normalizeMethods\" \"nspectraangle\" ## [55] \"ppm\" \"rbindFill\" ## [57] \"refineCentroids\" \"rla\" ## [59] \"robustSummary\" \"rowRla\" ## [61] \"rt2character\" \"rt2numeric\" ## [63] \"smooth\" \"sumi\" ## [65] \"validPeaksMatrix\" \"valleys\" ## [67] \"vapply1c\" \"vapply1d\" ## [69] \"vapply1l\" \"which.first\" ## [71] \"which.last\""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/articles/MsCoreUtils.html","id":"examples","dir":"Articles","previous_headings":"","what":"Examples","title":"Core Utils for Mass Spectrometry Data","text":"functions defined package utilise basic classes aim reused packages provide formal, high-level interface. examples, let’s take robustSummary() function, calculates robust summary columns matrix: function typicall used summarise peptide quantitation values protein intensities1. functionality available MSnbase::combineFeatures() function MSnSet objects QFeatures::aggregateFeatures() function QFeatures objects.","code":"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.46339304 0.01975971 0.162448 0.5049823 1.0239974 -0.4219314 0.6361069 ## B 0.49418853 0.17127790 -1.288225 -1.2631087 0.1822335 -0.8314057 -0.8196632 ## C -0.05107349 0.19072298 -1.558514 -0.8334451 0.8316873 0.7105504 -1.2842138 ## h i j ## A 0.3831507 -0.07130045 0.9514283 ## B -0.9280957 -0.52592054 2.1732882 ## C -1.3443066 -0.12794852 -0.5325772 robustSummary(x) ## a b c d e f ## 0.04629287 0.12725353 -0.89476393 -0.53052382 0.67930606 -0.35683411 ## g h i j ## -0.48925668 -0.62975052 -0.24172317 0.52262812"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/articles/MsCoreUtils.html","id":"contributions","dir":"Articles","previous_headings":"","what":"Contributions","title":"Core Utils for Mass Spectrometry Data","text":"like contribute low-level functionality, please open GitHub issue discuss . Please note contributions follow style guide require appropriate unit test. wish reuse functions package, please just go ahead. like advice seek help, please either open GitHub issue.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/articles/MsCoreUtils.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Core Utils for Mass Spectrometry Data","text":"","code":"## R Under development (unstable) (2024-01-17 r85813) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.3 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [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: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] MsCoreUtils_1.15.2 BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] vctrs_0.6.5 cli_3.6.2 knitr_1.45 ## [4] rlang_1.1.3 xfun_0.41 stringi_1.8.3 ## [7] purrr_1.0.2 textshaping_0.3.7 clue_0.3-65 ## [10] jsonlite_1.8.8 glue_1.7.0 S4Vectors_0.41.3 ## [13] htmltools_0.5.7 stats4_4.4.0 ragg_1.2.7 ## [16] sass_0.4.8 rmarkdown_2.25 evaluate_0.23 ## [19] jquerylib_0.1.4 MASS_7.3-60.2 fastmap_1.1.1 ## [22] yaml_2.3.8 lifecycle_1.0.4 memoise_2.0.1 ## [25] bookdown_0.37 BiocManager_1.30.22 stringr_1.5.1 ## [28] cluster_2.1.6 compiler_4.4.0 fs_1.6.3 ## [31] systemfonts_1.0.5 digest_0.6.34 R6_2.5.1 ## [34] magrittr_2.0.3 bslib_0.6.1 tools_4.4.0 ## [37] BiocGenerics_0.49.1 pkgdown_2.0.7 cachem_1.0.8 ## [40] desc_1.4.3"},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"RforMassSpectrometry Package Maintainer. Maintainer. Laurent Gatto. Author. Johannes Rainer. Author. Sebastian Gibb. Author. Adriaan Sticker. Contributor. Sigurdur Smarason. Contributor. Thomas Naake. Contributor. Josep Maria Badia Aparicio. Contributor. Michael Witting. Contributor. Samuel Wieczorek. Contributor. Roger Gine Bertomeu. Contributor. Mar Garcia-Aloy. Contributor.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rainer J, Vicini , Salzer L, Stanstrup J, Badia JM, Neumann S, Stravs MA, Verri Hernandes V, Gatto L, Gibb S Wittin M. Modular Expandable Ecosystem Metabolomics Data Annotation R Metabolites 2022, 12, 173. https://doi.org/10.3390/metabo12020173","code":"@Article{, title = {A Modular and Expandable Ecosystem for Metabolomics Data Annotation in R}, author = {Johannes Rainer and Andrea Vicini and Liesa Salzer and Jan Stanstrup and Josep M. Badia and Steffen Neumann and Michael A. Stravs and Vinicius {Verri Hernandes} and Laurent Gatto and Sebastian Gibb and Michael Witting}, journal = {Metabolites}, year = {2022}, doi = {10.3390/metabo12020173}, url = {https://www.mdpi.com/2218-1989/12/2/173}, volume = {12}, pages = {173}, }"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/index.html","id":"low-level-functions-for-ms-data","dir":"","previous_headings":"","what":"Core Utils for Mass Spectrometry Data","title":"Core Utils for Mass Spectrometry Data","text":"MsCoreUtils defines low-level functions mass spectrometry data independent high-level data structures. functions include mass spectra processing functions (noise estimation, smoothing, binning, baseline estimation), quantitative aggregation functions (median polish, robust summarisation, …), missing data imputation, data normalisation (quantiles, vsn, …) well misc helper functions, used across high-level data structure within R Mass Spectrometry packages. See package homepage information.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Core Utils for Mass Spectrometry Data","text":"package can installed ","code":"install.packages(\"BiocManager\") BiocManager::install(\"MsCoreUtils\")"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/index.html","id":"contributions","dir":"","previous_headings":"","what":"Contributions","title":"Core Utils for Mass Spectrometry Data","text":"Contributions highly welcome follow contribution guidelines. Also, please check coding style guidelines RforMassSpectrometry vignette.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/index.html","id":"previous-external-contributions","dir":"","previous_headings":"","what":"Previous external contributions","title":"Core Utils for Mass Spectrometry Data","text":"Sigurdur Smarason (@SiggiSmara): weighted moving average (https://github.com/sgibb/MALDIquant/pull/54) Thomas Naake (@tnaake): dotproduct calculation (https://github.com/rformassspectrometry/MsCoreUtils/pull/17) Adriaan Sticker: robustSummary aggregation function (originally contributed MSnbase)","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Aggreagate quantitative features — aggregate","title":"Aggreagate quantitative features — aggregate","text":"functions take matrix quantitative features x aggregate features (rows) according either vector (factor) INDEX adjacency matrix MAT. aggregation method defined function FUN. Adjacency matrices elegant way explicitly encode shared peptides (see example ) aggregation.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Aggreagate quantitative features — aggregate","text":"","code":"colMeansMat(x, MAT, na.rm = FALSE) colSumsMat(x, MAT, na.rm = FALSE) aggregate_by_matrix(x, MAT, FUN, ...) aggregate_by_vector(x, INDEX, FUN, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Aggreagate quantitative features — aggregate","text":"x matrix mode numeric HDF5Matrix object type numeric. MAT adjacency matrix defines peptide-protein relations nrow(MAT) == nrow(x): non-missing/non-null value position (,j) indicates peptide belong protein j. matrix tyically binary can also contain weighted relations. na.rm logical(1) indicating whether missing values (including NaN) omitted calculations . Defaults FALSE. FUN function applied subsets x. ... Additional arguments passed FUN. INDEX vector factor length nrow(x).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Aggreagate quantitative features — aggregate","text":"aggregate_by_matrix() returns matrix (Matrix) dimensions ncol(MAT) ncol(x), dimnamesequal tocolnames(x)andrownames(MAT)`. aggregate_by_vector() returns new matrix (x matrix) HDF5Matrix (x HDF5Matrix) dimensions length(INDEX) ncol(x), dimnames equal tocolnames(x)andINDEX`.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"vector-based-aggregation-functions","dir":"Reference","previous_headings":"","what":"Vector-based aggregation functions","title":"Aggreagate quantitative features — aggregate","text":"aggregating vector/factor, user-defined functions must return vector length equal ncol(x) level INDEX. Examples thereof : medianPolish() fits additive model (two way decomposition) using Tukey's median polish procedure using stats::medpolish(); robustSummary() calculate robust aggregation using MASS::rlm(); base::colMeans() use mean column; base::colSums() use sum column; matrixStats::colMedians() use median column.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"matrix-based-aggregation-functions","dir":"Reference","previous_headings":"","what":"Matrix-based aggregation functions","title":"Aggreagate quantitative features — aggregate","text":"aggregating adjacency matrix, user-defined functions must return new matrix. Examples thereof : colSumsMat(x, MAT) aggregates summing peptide intensities protein. Shared peptides re-used multiple times. colMeansMat(x, MAT) aggregation calculating mean peptide intensities. Shared peptides re-used multiple times.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"handling-missing-values","dir":"Reference","previous_headings":"","what":"Handling missing values","title":"Aggreagate quantitative features — aggregate","text":"default, missing values quantitative data propagate aggregated data. can provide na.rm = TRUE functions listed ignore missing values, except robustSummary() supply na.action = na.omit (see ?MASS::rlm).","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Aggreagate quantitative features — aggregate","text":"Laurent Gatto Samuel Wieczorek (aggregation adjacency matrix).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Aggreagate quantitative features — aggregate","text":"","code":"x <- matrix(c(10.39, 17.16, 14.10, 12.85, 10.63, 7.52, 3.91, 11.13, 16.53, 14.17, 11.94, 11.51, 7.69, 3.97, 11.93, 15.37, 14.24, 11.21, 12.29, 9.00, 3.83, 12.90, 14.37, 14.16, 10.12, 13.33, 9.75, 3.81), nrow = 7, dimnames = list(paste0(\"Pep\", 1:7), paste0(\"Sample\", 1:4))) x #> Sample1 Sample2 Sample3 Sample4 #> Pep1 10.39 11.13 11.93 12.90 #> Pep2 17.16 16.53 15.37 14.37 #> Pep3 14.10 14.17 14.24 14.16 #> Pep4 12.85 11.94 11.21 10.12 #> Pep5 10.63 11.51 12.29 13.33 #> Pep6 7.52 7.69 9.00 9.75 #> Pep7 3.91 3.97 3.83 3.81 ## ------------------------- ## Aggregation by vector ## ------------------------- (k <- paste0(\"Prot\", c(\"B\", \"E\", \"X\", \"E\", \"B\", \"B\", \"E\"))) #> [1] \"ProtB\" \"ProtE\" \"ProtX\" \"ProtE\" \"ProtB\" \"ProtB\" \"ProtE\" aggregate_by_vector(x, k, colMeans) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 9.513333 10.11000 11.07333 11.993333 #> ProtE 11.306667 10.81333 10.13667 9.433333 #> ProtX 14.100000 14.17000 14.24000 14.160000 aggregate_by_vector(x, k, robustSummary) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 9.513333 10.15800 11.07333 11.99333 #> ProtE 11.451493 10.81333 10.13667 9.22360 #> ProtX 14.100000 14.17000 14.24000 14.16000 aggregate_by_vector(x, k, medianPolish) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 10.39 11.13 11.93 12.90 #> ProtE 12.85 11.94 11.21 10.12 #> ProtX 14.10 14.17 14.24 14.16 ## ------------------------- ## Aggregation by matrix ## ------------------------- adj <- matrix(c(1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1), nrow = 7, dimnames = list(paste0(\"Pep\", 1:7), paste0(\"Prot\", c(\"B\", \"E\", \"X\")))) adj #> ProtB ProtE ProtX #> Pep1 1 0 0 #> Pep2 0 1 0 #> Pep3 0 0 1 #> Pep4 1 1 0 #> Pep5 1 0 0 #> Pep6 1 0 0 #> Pep7 0 1 1 ## Peptide 4 is shared by 2 proteins (has a rowSums of 2), ## namely proteins B and E rowSums(adj) #> Pep1 Pep2 Pep3 Pep4 Pep5 Pep6 Pep7 #> 1 1 1 2 1 1 2 aggregate_by_matrix(x, adj, colSumsMat) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 41.39 42.27 44.43 46.10 #> ProtE 33.92 32.44 30.41 28.30 #> ProtX 18.01 18.14 18.07 17.97 aggregate_by_matrix(x, adj, colMeansMat) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 10.34750 10.56750 11.10750 11.525000 #> ProtE 11.30667 10.81333 10.13667 9.433333 #> ProtX 9.00500 9.07000 9.03500 8.985000 ## --------------- ## Missing values ## --------------- x <- matrix(c(NA, 2:6), ncol = 2, dimnames = list(paste0(\"Pep\", 1:3), c(\"S1\", \"S2\"))) x #> S1 S2 #> Pep1 NA 4 #> Pep2 2 5 #> Pep3 3 6 ## simply use na.rm = TRUE to ignore missing values ## during the aggregation (k <- LETTERS[c(1, 1, 2)]) #> [1] \"A\" \"A\" \"B\" aggregate_by_vector(x, k, colSums) #> S1 S2 #> A NA 9 #> B 3 6 aggregate_by_vector(x, k, colSums, na.rm = TRUE) #> S1 S2 #> A 2 9 #> B 3 6 (adj <- matrix(c(1, 1, 0, 0, 0, 1), ncol = 2, dimnames = list(paste0(\"Pep\", 1:3), c(\"A\", \"B\")))) #> A B #> Pep1 1 0 #> Pep2 1 0 #> Pep3 0 1 aggregate_by_matrix(x, adj, colSumsMat, na.rm = FALSE) #> S1 S2 #> A NA 9 #> B 3 6 aggregate_by_matrix(x, adj, colSumsMat, na.rm = TRUE) #> S1 S2 #> A 2 9 #> B 3 6"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":null,"dir":"Reference","previous_headings":"","what":"Binning — bin","title":"Binning — bin","text":"Aggregate values x bins defined y: values x values y falling bin (defined y) aggregated provided function FUN.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Binning — bin","text":"","code":"bin( x, y, size = 1, breaks = seq(floor(min(y)), ceiling(max(y)), by = size), FUN = max, returnMids = TRUE, .check = TRUE )"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Binning — bin","text":"x numeric values aggregated/binned. y numeric length x values used binning. y must increasingly sorted, else error thrown. size numeric(1) size bin. breaks numeric defining breaks (bins). FUN function used aggregate values x falling bins defined breaks. FUN expected return numeric(1). returnMids logical(1) whether midpoints breaks returned addition binned (aggregated) values x. Setting returnMids = FALSE might useful breaks defined hand binning needs performed large set values (.e. within loop multiple pairs x y values). .check logical(1) whether check y ordered vector. Setting .check = FALSE improve performance, provided sure y always ordered.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Binning — bin","text":"Depending value returnMids: returnMids = TRUE (default): returns list elements x (aggregated values x) mids (bin mid points). returnMids = FALSE: returns numeric just binned values x.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Binning — bin","text":"Johannes Rainer, Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Binning — bin","text":"","code":"## Define example intensities and m/z values ints <- abs(rnorm(20, mean = 40)) mz <- seq(1:length(ints)) + rnorm(length(ints), sd = 0.001) ## Bin intensities by m/z bins with a bin size of 2 bin(ints, mz, size = 2) #> $x #> [1] 40.25532 39.99443 41.14841 39.75580 39.71729 40.62898 42.06502 40.51243 #> [9] 40.54300 39.08593 #> #> $mids #> [1] 2 4 6 8 10 12 14 16 18 20 #> ## Repeat but summing up intensities instead of taking the max bin(ints, mz, size = 2, FUN = sum) #> $x #> [1] 116.41801 39.99443 119.94815 79.50848 39.71729 80.07528 80.43404 #> [8] 118.12740 80.49039 39.08593 #> #> $mids #> [1] 2 4 6 8 10 12 14 16 18 20 #> ## Get only the binned values without the bin mid points. bin(ints, mz, size = 2, returnMids = FALSE) #> [1] 40.25532 39.99443 41.14841 39.75580 39.71729 40.62898 42.06502 40.51243 #> [9] 40.54300 39.08593"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":null,"dir":"Reference","previous_headings":"","what":"Check functions — isPeaksMatrix","title":"Check functions — isPeaksMatrix","text":"functions used check input arguments.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check functions — isPeaksMatrix","text":"","code":"isPeaksMatrix(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check functions — isPeaksMatrix","text":"x object test.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check functions — isPeaksMatrix","text":"logical(1), TRUE checks successful otherwise FALSE.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check functions — isPeaksMatrix","text":"isPeaksMatrix: test numeric matrix two columns named \"mz\" \"intensity\". \"mz\" column sorted increasingly.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Check functions — isPeaksMatrix","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check functions — isPeaksMatrix","text":"","code":"isPeaksMatrix(1:2) #> [1] FALSE isPeaksMatrix(cbind(mz = 2:1, intensity = 1:2)) #> [1] FALSE isPeaksMatrix(cbind(mz = 1:2, intensity = 1:2)) #> [1] TRUE"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce functions — coerce","title":"Coerce functions — coerce","text":"asInteger: convert x integer throw error x numeric.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce functions — coerce","text":"","code":"asInteger(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce functions — coerce","text":"x input argument.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Coerce functions — coerce","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce functions — coerce","text":"","code":"## Convert numeric to integer asInteger(3.4) #> [1] 3 asInteger(3) #> [1] 3"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":null,"dir":"Reference","previous_headings":"","what":"Counts the number of features — colCounts","title":"Counts the number of features — colCounts","text":"Returns number non-NA features features sample matrix.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Counts the number of features — colCounts","text":"","code":"colCounts(x, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Counts the number of features — colCounts","text":"x matrix mode numeric. ... Currently ignored.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Counts the number of features — colCounts","text":"numeric vector length identical ncol(x).","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Counts the number of features — colCounts","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Counts the number of features — colCounts","text":"","code":"m <- matrix(c(1, NA, 2, 3, NA, NA, 4, 5, 6), nrow = 3) colCounts(m) #> [1] 2 1 3 m <- matrix(rnorm(30), nrow = 3) colCounts(m) #> [1] 3 3 3 3 3 3 3 3 3 3"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Spectra Distance/Similarity Measurements — distance","title":"Spectra Distance/Similarity Measurements — distance","text":"functions provide different normalized similariy/distance measurements.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spectra Distance/Similarity Measurements — distance","text":"","code":"ndotproduct(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...) dotproduct(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...) neuclidean(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...) navdist(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...) nspectraangle(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spectra Distance/Similarity Measurements — distance","text":"x matrix, two-columns e.g. m/z, intensity y matrix, two-columns e.g. m/z, intensity m numeric, weighting first column x y (e.g. \"mz\"), default: 0 means weight first column. details see ndotproduct details section. n numeric, weighting second column x y (e.g. \"intensity\"), default: 0.5 means effectly using sqrt(x[,2]) sqrt(y[,2]). details see ndotproduct details section. na.rm logical(1), NA removed prior calculation (default TRUE). ... ignored.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spectra Distance/Similarity Measurements — distance","text":"double(1) value 0:1, 0 completely different 1 identically.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Spectra Distance/Similarity Measurements — distance","text":"functions calculate normalized similarity/distance measurements prefixed n. ndotproduct: normalized dot product described Stein Scott 1994 : \\(NDP = \\frac{\\sum(W_1 W_2)^2}{\\sum(W_1)^2 \\sum(W_2)^2}\\); \\(W_i = x^m * y^n\\), \\(x\\) \\(y\\) m/z intensity values, respectively. Please note also \\(NDP = NCos^2\\); NCos cosine value (.e. orthodox normalized dot product) intensity vectors described Yilmaz et al. 2017. Stein Scott 1994 empirically determined optimal exponents m = 3 n = 0.6 analyzing ca. 12000 EI-MS data 8000 organic compounds NIST Mass Spectral Library. MassBank (Horai et al. 2010) uses m = 2 n = 0.5 small compounds. general increasing values m, high m/z values taken account similarity calculation. Especially working small molecules, value n > 0 can set give weight m/z values accommodate shared fragments higher m/z less likely mean molecules might similar. Increasing n result higher importance intensity values. commonly m = 0 n = 0.5 used. neuclidean: normalized euclidean distance described Stein Scott 1994 : \\(NED = (1 + \\frac{\\sum((W_1 - W_2)^2)}{sum((W_2)^2)})^{-1}\\); \\(W_i = x^m * y^n\\), \\(x\\) \\(y\\) m/z intensity values, respectively. See details section ndotproduct explanation set m n. navdist: normalized absolute values distance described Stein Scott 1994 : \\(NED = (1 + \\frac{\\sum(|W_1 - W_2|)}{sum((W_2))})^{-1}\\); \\(W_i = x^m * y^n\\), \\(x\\) \\(y\\) m/z intensity values, respectively. See details section ndotproduct explanation set m n. nspectraangle: normalized spectra angle described Toprak et al 2014 : \\(NSA = 1 - \\frac{2*\\cos^{-1}(W_1 \\cdot W_2)}{\\pi}\\); \\(W_i = x^m * y^n\\), \\(x\\) \\(y\\) m/z intensity values, respectively. weighting originally proposed Toprak et al. 2014. See details section ndotproduct explanation set m n.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Spectra Distance/Similarity Measurements — distance","text":"methods implemented described Stein Scott 1994 (navdist, ndotproduct, neuclidean) Toprak et al. 2014 (nspectraangle) reference implementation available unable guarantee results identical. Note Stein Scott 1994 normalized dot product method (extension ndotproduct) corresponds square orthodox normalized dot product (cosine distance) used also commonly spectrum similarity measure (Yilmaz et al. 2017). Please see also corresponding discussion github pull request linked . find problems reference implementation please open issue https://github.com/rformassspectrometry/MsCoreUtils/issues.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Spectra Distance/Similarity Measurements — distance","text":"Stein, S. E., Scott, D. R. (1994). Optimization testing mass spectral library search algorithms compound identification. Journal American Society Mass Spectrometry, 5(9), 859--866. doi:10.1016/1044-0305(94)87009-8 . Yilmaz, S., Vandermarliere, E., Lennart Martens (2017). Methods Calculate Spectrum Similarity. S. Keerthikumar S. Mathivanan (eds.), Proteome Bioinformatics: Methods Molecular Biology, vol. 1549 (pp. 81). doi:10.1007/978-1-4939-6740-7_7 . Horai et al. (2010). MassBank: public repository sharing mass spectral data life sciences. Journal mass spectrometry, 45(7), 703--714. doi:10.1002/jms.1777 . Toprak et al. (2014). Conserved peptide fragmentation benchmarking tool mass spectrometers discriminating feature targeted proteomics. Molecular & Cellular Proteomics : MCP, 13(8), 2056--2071. doi:10.1074/mcp.O113.036475 . Pull Request distance/similarity measurements: https://github.com/rformassspectrometry/MsCoreUtils/pull/33","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Spectra Distance/Similarity Measurements — distance","text":"navdist, neuclidean, nspectraangle: Sebastian Gibb ndotproduct: Sebastian Gibb Thomas Naake, thomasnaake@googlemail.com","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spectra Distance/Similarity Measurements — distance","text":"","code":"x <- matrix(c(1:5, 1:5), ncol = 2, dimnames = list(c(), c(\"mz\", \"intensity\"))) y <- matrix(c(1:5, 5:1), ncol = 2, dimnames = list(c(), c(\"mz\", \"intensity\"))) ndotproduct(x, y) #> [1] 0.7660906 ndotproduct(x, y, m = 2, n = 0.5) #> [1] 0.9074293 ndotproduct(x, y, m = 3, n = 0.6) #> [1] 0.9127553 neuclidean(x, y) #> [1] 0.8003406 navdist(x, y) #> [1] 0.6970151 nspectraangle(x, y) #> [1] 0.5556013"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Spectral entropy — entropy","title":"Spectral entropy — entropy","text":"functions allow calculate entropy measurements MS/MS spectrum based metrics suggested Li et al. (https://doi.org/10.1038/s41592-021-01331-z). Spectral entropy normalized entropy used measure complexity spectra. MassBank North America (MoNA) defines spectra entropy intensity weighted spectral peak number (https://mona.fiehnlab.ucdavis.edu/documentation/entropy). Additionally suggested consider spectra normalized entropy larger 0.8, spectral entropy larger 3 low-quality spectra.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spectral entropy — entropy","text":"","code":"entropy(x) nentropy(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spectral entropy — entropy","text":"x numeric, intensities fragment ions.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spectral entropy — entropy","text":"numeric: (normalized) entropy x.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Spectral entropy — entropy","text":"Mar Garcia-Aloy","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spectral entropy — entropy","text":"","code":"spectrum <- rbind(c(41.04, 37.16), c(69.07, 66.83), c(86.1, 999.0)) entropy(spectrum[,2]) #> [1] 0.3737888 nentropy(spectrum[,2]) #> [1] 0.3402372"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"function estimates baseline mass spectrometry data, represented numeric vectors masses intensities identical lengths.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"","code":"estimateBaseline( x, y, method = c(\"SNIP\", \"TopHat\", \"ConvexHull\", \"median\"), ... ) estimateBaselineConvexHull(x, y) estimateBaselineMedian(x, y, halfWindowSize = 100L) estimateBaselineSnip(x, y, iterations = 100L, decreasing = TRUE) estimateBaselineTopHat(x, y, halfWindowSize = 100L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"x numeric() vector masses. y numeric() vector intensities. method character(1) specifying estimation method. One \"SNIP\" (default), \"TopHat\", \"ConvexHull\" \"median\". See details . ... Additional parameters passed respective functions. halfWindowSize integer() defining half window size. Default 100L. resulting window reaches x[cur_index - halfWindowSize] x[cur_index + halfWindowSize]. iterations integer() controling window size (k, similar halfWindowSize \"TopHat\", \"median\") algorithm. resulting window reaches x[cur_index - iterations] x[cur_index + iterations]. decreasing logical(1) whether cliping window decreasing, defined Morhac (2009). decreasing clipping window suggested get smoother baseline. TRUE (FALSE) k=iterations decreased (increased) one zero (iterations) reached. default setting decreasing = TRUE.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"numeric() estimated baseline intensities.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"SNIP: baseline estimation based Statistics-sensitive Non-linear Iterative Peak-clipping algorithm (SNIP) described Ryan et al 1988. algorithm based following equation: $$y_i(k) = \\min \\{ y_i, \\frac{(y_{-k}+y_{+k})}{2} \\}$$ two additional arguments namely integer iterations logical decreasing. TopHat: algorithm applies moving minimum (erosion filter) subsequently moving maximum (dilation filter) filter intensity values. implementation based van Herk (1996). additional halfWindowSize argument determining half size moving window TopHat filter. ConvexHull: baseline estimation based convex hull constructed spectrum. Median: baseline estimation uses moving median. based stats::runmed(). additional argument halfWindowSize corresponds k argument stats::runmed() (k = 2 * halfWindowSize + 1) controls half size moving window.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"functions ported MALDIqaunt package. SNIP: C.G. Ryan, E. Clayton, W.L. Griffin, S.H. Sie, D.R. Cousens (1988). Snip, statistics-sensitive background treatment quantitative analysis pixe spectra geoscience applications. Nuclear Instruments Methods Physics Research Section B: Beam Interactions Materials Atoms, 34(3): 396-402. M. Morhac (2009). algorithm determination peak regions baseline elimination spectroscopic data. Nuclear Instruments Methods Physics Research Section : Accelerators, Spectrometers, Detectors Associated Equipment, 600(2), 478-487. TopHat: M. van Herk (1992). Fast Algorithm Local Minimum Maximum Filters Rectangular Octagonal Kernels. Pattern Recognition Letters 13.7: 517-521. J. Y. Gil M. Werman (1996). Computing 2-Dimensional Min, Median Max Filters. IEEE Transactions: 504-507. ConvexHull: Andrew, . M. (1979). Another efficient algorithm convex hulls two dimensions. Information Processing Letters, 9(5), 216-219.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"","code":"## ---------------------------- ## Simulation example data nmz <- 5000 mz <- seq(1000, length.out = nmz) ## create peaks center <- seq(50, nmz, by = 500) peaks <- lapply(center, function(cc)1000 * dpois(0:100, (1000 + cc) / 75)) ## create baseline intensity <- 100 * exp(-seq_len(nmz)/2000) ## add peaks to baseline for (i in seq(along = center)) { intensity[center[i]:(center[i] + 100)] <- intensity[center[i]:(center[i] + 100)] + peaks[[i]] } ## add noise intensity <- intensity + rnorm(nmz, mean = 0, sd = 1) plot(mz, intensity, type = \"l\") ## ---------------------------- ## SNIP baseline base_SNIP <- estimateBaseline(mz, intensity, method = \"SNIP\", iterations = 20L) ## same as estimateBaselineSnip(mz, intensity, iterations = 20L) lines(mz, base_SNIP, col = \"red\") ## ---------------------------- ## TopHat baseline base_TH25 <- estimateBaseline(mz, intensity, method = \"TopHat\", halfWindowSize = 25L) ## same as estimateBaselineTopHat(mz, intenstity, halfWindowSize = 25L) lines(mz, base_TH25, col = \"blue\") base_TH15 <- estimateBaseline(mz, intensity, method = \"TopHat\", halfWindowSize = 15L) lines(mz, base_TH15, col = \"steelblue\") ## ---------------------------- ## Convex hull baseline base_CH <- estimateBaseline(mz, intensity, method = \"ConvexHull\") ## same as estimateBaselineConvexHull(mz, intensity) lines(mz, base_CH, col = \"green\") ## ---------------------------- ## Median baseline base_med <- estimateBaseline(mz, intensity, method = \"median\") ## same as estimateBaselineMedian(mz, intensity) lines(mz, base_med, col = \"orange\") legend(\"topright\", lwd = 1, legend = c(\"SNIP\", \"TopHat (hws = 25)\", \"TopHat (hws = 15)\", \"ConvexHull\", \"Median\"), col = c(\"red\", \"blue\", \"steelblue\", \"green\", \"orange\"))"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":null,"dir":"Reference","previous_headings":"","what":"Format Retention Time — rt2numeric","title":"Format Retention Time — rt2numeric","text":"vectorised functions convert retention times numeric seconds /character \"mm:ss\". rt2character() performs numeric character conversion rt2numeric() performs character numeric conversion. formatRt() one depending input type.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format Retention Time — rt2numeric","text":"","code":"rt2numeric(rt) rt2character(rt) formatRt(rt)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format Retention Time — rt2numeric","text":"rt vector retention times length > 1. Either numeric() seconds character() \"mm:ss\" depending function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format Retention Time — rt2numeric","text":"reformatted retention time.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Format Retention Time — rt2numeric","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Format Retention Time — rt2numeric","text":"","code":"## rt2numeric rt2numeric(\"25:24\") #> [1] 1524 rt2numeric(c(\"25:24\", \"25:25\", \"25:26\")) #> [1] 1524 1525 1526 ## rt2character rt2character(1524) #> [1] \"25:24\" rt2character(1) #> [1] \"0:01\" rt2character(1:10) #> [1] \"0:01\" \"0:02\" \"0:03\" \"0:04\" \"0:05\" \"0:06\" \"0:07\" \"0:08\" \"0:09\" \"0:10\" ## formatRt formatRt(1524) #> [1] \"25:24\" formatRt(1) #> [1] \"0:01\" formatRt(1:10) #> [1] \"0:01\" \"0:02\" \"0:03\" \"0:04\" \"0:05\" \"0:06\" \"0:07\" \"0:08\" \"0:09\" \"0:10\" formatRt(\"25:24\") #> [1] 1524 formatRt(c(\"25:24\", \"25:25\", \"25:26\")) #> [1] 1524 1525 1526"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":null,"dir":"Reference","previous_headings":"","what":"GNPS spectrum similarity scores — gnps","title":"GNPS spectrum similarity scores — gnps","text":"join_gnps gnps functions allow calculate spectra similarity scores used GNPS. approach matches first peaks two spectra directly using user-defined ppm /tolerance well using fixed delta m/z (considering ppm tolerance) defined difference two spectras' precursor m/z values. peaks match multiple peaks spectrum matching peak pair higher value/similarity considered final similarity score calculation. Note GNPS similarity scores calculated two functions used together. join_gnps: matches/maps peaks spectra approach GNPS: peaks considered matching ) difference m/z values smaller defined tolerance ppm (joinPeaks) b) difference m/z adjusted difference spectras' precursor smaller defined tolerance ppm. Based definition, peaks x can match two peaks y hence returned peak indices might duplicated. Note one xPrecursorMz yPrecursorMz NA , results join(). function returns list two integer vectors indices peaks matching peaks spectrum NA otherwise. gnps: calculates GNPS similarity score peak matrices' previously aligned (matched) join_gnps. multi-mapping peaks pair higher similarity considered final score calculation.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GNPS spectrum similarity scores — gnps","text":"","code":"gnps(x, y, ...) join_gnps( x, y, xPrecursorMz = NA_real_, yPrecursorMz = NA_real_, tolerance = 0, ppm = 0, type = \"outer\", ... )"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GNPS spectrum similarity scores — gnps","text":"x join_gnps: numeric m/z values spectrum. gnps: matrix two columns \"mz\" \"intensity\" containing peaks aligned peaks y (join_gnps). y join_gnps: numeric m/z values spectrum. gnps: matrix two columns \"mz\" \"intensity\" containing peaks aligned peaks x (join_gnps). ... join_gnps: optional parameters passed join() function. gnps: ignored. xPrecursorMz join_gnps: numeric(1) precursor m/z spectrum x. yPrecursorMz join_gnps: numeric(1) precursor m/z spectrum y. tolerance join_gnps: numeric(1) defining constant maximal accepted difference m/z values peaks two spectra matched/mapped. ppm join_gnps: numeric(1) defining relative, m/z-dependent, maximal accepted difference m/z values peaks two spectra matched/mapped. type join_gnps: character(1) specifying type join performed. See join() details options. Defaults type = \"outer\".","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GNPS spectrum similarity scores — gnps","text":"See function definition description section.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"GNPS spectrum similarity scores — gnps","text":"implementation gnps bases R code publication listed references.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"GNPS spectrum similarity scores — gnps","text":"Xing S, Hu Y, Yin Z, Liu M, Tang X, Fang M, Huan T. Retrieving Utilizing Hypothetical Neutral Losses Tandem Mass Spectra Spectral Similarity Analysis Unknown Metabolite Annotation. Anal Chem. 2020 Nov 3;92(21):14476-14483. doi:10.1021/acs.analchem.0c02521 .","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"GNPS spectrum similarity scores — gnps","text":"Johannes Rainer, Michael Witting, based code Xing et al. (2020).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"GNPS spectrum similarity scores — gnps","text":"","code":"## Define spectra x <- cbind(mz = c(10, 36, 63, 91, 93), intensity = c(14, 15, 999, 650, 1)) y <- cbind(mz = c(10, 12, 50, 63, 105), intensity = c(35, 5, 16, 999, 450)) ## The precursor m/z pmz_x <- 91 pmz_y <- 105 ## Plain join identifies only 2 matching peaks join(x[, 1], y[, 1]) #> $x #> [1] 1 NA 2 NA 3 4 5 NA #> #> $y #> [1] 1 2 NA 3 4 NA NA 5 #> ## join_gnps finds 4 matches join_gnps(x[, 1], y[, 1], pmz_x, pmz_y) #> $x #> [1] 1 2 2 3 4 4 5 NA NA NA #> #> $y #> [1] 1 NA 3 4 NA 5 NA 2 3 5 #> ## with one of the two precursor m/z being NA, the result are the same as ## with join. join_gnps(x[, 1], y[, 1], pmz_x, yPrecursorMz = NA) #> $x #> [1] 1 NA 2 NA 3 4 5 NA #> #> $y #> [1] 1 2 NA 3 4 NA NA 5 #> ## Calculate GNPS similarity score: map <- join_gnps(x[, 1], y[, 1], pmz_x, pmz_y) gnps(x[map[[1]], ], y[map[[2]], ]) #> [1] 0.9923501"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":null,"dir":"Reference","previous_headings":"","what":"Grouping of numeric values by similarity — group","title":"Grouping of numeric values by similarity — group","text":"group function groups numeric values first ordering putting values group difference smaller defined parameters tolerance (constant value) ppm (value-specific relative value expressed parts-per-million).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Grouping of numeric values by similarity — group","text":"","code":"group(x, tolerance = 0, ppm = 0)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Grouping of numeric values by similarity — group","text":"x increasingly ordered numeric values grouped. tolerance numeric(1) maximal accepted difference values x grouped entity. ppm numeric(1) defining value-dependent maximal accepted difference values x expressed parts-per-million.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Grouping of numeric values by similarity — group","text":"integer length equal x groups.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Grouping of numeric values by similarity — group","text":"Since grouping performed pairwise differences consecutive values (ordering x), difference smallest largest value group can larger tolerance ppm.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Grouping of numeric values by similarity — group","text":"Johannes Rainer, Sebastin Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Grouping of numeric values by similarity — group","text":"","code":"## Define a (sorted) numeric vector x <- c(34, 35, 35, 35 + ppm(35, 10), 56, 56.05, 56.1) ## With `ppm = 0` and `tolerance = 0` only identical values are grouped group(x) #> [1] 1 2 2 3 4 5 6 ## With `tolerance = 0.05` group(x, tolerance = 0.05) #> [1] 1 2 2 2 3 3 3 ## Also values 56, 56.05 and 56.1 were grouped into a single group, ## although the difference between the smallest 56 and largest value in ## this group (56.1) is 0.1. The (pairwise) difference between the ordered ## values is however 0.05. ## With ppm group(x, ppm = 10) #> [1] 1 2 2 2 3 4 5 ## Same on an unsorted vector x <- c(65, 34, 65.1, 35, 66, 65.2) group(x, tolerance = 0.1) #> [1] 3 1 3 2 4 3 ## Values 65, 65.1 and 65.2 have been grouped into the same group."},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":null,"dir":"Reference","previous_headings":"","what":"Input parameter check for subsetting operations — i2index","title":"Input parameter check for subsetting operations — i2index","text":"i2index simple helper function used subsetting functions. checks converts parameter , can type integer, logical character integer vector can used index subsetting.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Input parameter check for subsetting operations — i2index","text":"","code":"i2index(i, length = length(i), names = NULL)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Input parameter check for subsetting operations — i2index","text":"character logical integer used [] subsetting. length integer representing length object subsetted. names character names (rownames similar) object. required type character.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Input parameter check for subsetting operations — i2index","text":"integer indices","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Input parameter check for subsetting operations — i2index","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Input parameter check for subsetting operations — i2index","text":"","code":"## With `i` being an `integer` i2index(c(4, 1, 3), length = 10) #> [1] 4 1 3 ## With `i` being a `logical` i2index(c(TRUE, FALSE, FALSE, TRUE, FALSE), length = 5) #> [1] 1 4 ## With `i` being a `character` i2index(c(\"b\", \"a\", \"d\"), length = 5, names = c(\"a\", \"b\", \"c\", \"d\", \"e\")) #> [1] 2 1 4"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":null,"dir":"Reference","previous_headings":"","what":"Quantitative mass spectrometry data imputation — impute_matrix","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"impute_matrix function performs data imputation matrix objects instance using variety methods (see ). Users proceed care imputing data take precautions assure imputation produces valid results, particular naive imputations replacing missing values 0.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"","code":"impute_matrix(x, method, FUN, ...) imputeMethods() impute_neighbour_average(x, k = min(x, na.rm = TRUE), MARGIN = 1L) impute_knn(x, MARGIN = 1L, ...) impute_mle(x, MARGIN = 2L, ...) impute_bpca(x, MARGIN = 1L, ...) impute_RF(x, MARGIN = 2L, ...) impute_mixed(x, randna, mar, mnar, MARGIN = 1L, ...) impute_min(x) impute_MinDet(x, q = 0.01, MARGIN = 2L) impute_MinProb(x, q = 0.01, sigma = 1, MARGIN = 2L) impute_QRILC(x, sigma = 1, MARGIN = 2L) impute_zero(x) impute_with(x, val) impute_fun(x, FUN, MARGIN = 1L, ...) getImputeMargin(fun)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"x matrix HDF5Matrix object imputed. method character(1) defining imputation method. See imputeMethods() available ones. FUN user-provided function takes matrix input returns imputed matrix identical dimensions. ... Additional parameters passed inner imputation function. k numeric(1) providing imputation value used first last samples contain NA. default use smallest value data. MARGIN integer(1) defining margin along apply imputation, 1L rows 2L columns. default value depend imputation method. Use getImputeMargin(fun) get default margin imputation function fun. function take margin argument, NA returned. randna logical length equal nrow(object) defining rows missing random. ones considered missing random. relevant methods mixed. mar Imputation method values missing random. See method . mnar Imputation method values missing random. See method . q numeric(1) indicating quantile used estimate minimum MinDet MinProb. Default 0.01. sigma numeric(1) controling standard deviation MNAR distribution MinProb QRILC. Default 1. val numeric(1) used replace missing values. fun imputation function get default margin .","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"matrix class x dimensions dim(x).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"types-of-missing-values","dir":"Reference","previous_headings":"","what":"Types of missing values","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"two types mechanisms resulting missing values LC/MSMS experiments. Missing values resulting absence detection feature, despite ions present detectable concentrations. example case ion suppression result stochastic, data-dependent nature DDA MS acquisition method. missing value expected randomly distributed data defined, statistical terms, missing random (MAR) missing completely random (MCAR). Biologically relevant missing values resulting absence low abundance ions (.e. limit detection instrument). missing values expected randomly distributed data defined missing random (MNAR). MNAR features ideally imputed left-censor method, QRILC . Conversely, recommended use hot deck methods nearest neighbours, Bayesian missing value imputation maximum likelihood methods values missing random.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"imputing-by-rows-or-columns","dir":"Reference","previous_headings":"","what":"Imputing by rows or columns","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"assume input matrix x contains features along rows samples along columns, generally case omics data analysis. performing imputation, missing values taken feature-specific property: feature x missing absent (sample group), missed acquisition (selected data dependent acquisition) data processing (identified identification score chosen false discovery threshold). , imputation default performed feature level. cases, imputation zero global minimum value, matter. cases, matter much, example using minimum value computed margin (.e. row column) MinDet method (see ) - want use minimum sample feature? KNN another example: consider similar features impute feature missing values, similar samples impute missing sample. MARGIN argument can used change imputation margin features/rows (MARGIN = 1) samples/columns (MARGIN = 2). Different imputations different default values, changing parameter can major impact imputation results downstream results.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"imputation-methods","dir":"Reference","previous_headings":"","what":"Imputation methods","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"Currently, following imputation methods available. MLE: Maximum likelihood-based imputation method using EM algorithm. impute_mle() function relies norm::imp.norm(). function. See norm::imp.norm() details additional parameters. Note , ... passed norm::em.norm() function, rather actual imputation function imp.norm. bpca: Bayesian missing value imputation available, implemented pcaMethods::pca() function. See pcaMethods::pca() details additional parameters. RF: Random Forest imputation, implemented missForest::missForest function. See missForest::missForest()] details additional parameters. knn: Nearest neighbour averaging, implemented impute::impute.knn function. See impute::impute.knn()] details additional parameters. QRILC: missing data imputation method performs imputation left-censored missing data using random draws truncated distribution parameters estimated using quantile regression. impute_QRILC() function calls imputeLCMD::impute.QRILC() imputeLCMD package. MinDet: Performs imputation left-censored missing data using deterministic minimal value approach. Considering expression data n samples p features, sample, missing entries replaced minimal value observed sample. minimal value observed estimated q-th quantile (default q = 0.01) observed values sample. implementation based imputeLCMD::impute.MinDet() function. MinProb: Performs imputation left-censored missing data random draws Gaussian distribution centred minimal value. Considering expression data matrix n samples p features, sample, mean value Gaussian distribution set minimal observed value sample. minimal value observed estimated q-th quantile (default q = 0.01) observed values sample. standard deviation estimated median feature (sample) standard deviations. Note estimating standard deviation Gaussian distribution, peptides/proteins present 50\\ values considered. impute_MinProb() function calls imputeLCMD::impute.MinProb() imputeLCMD package. min: Replaces missing values smallest non-missing value data. zero: Replaces missing values 0. mixed: mixed imputation applying two methods (defined user mar values missing random mnar values missing random, see example) two MCAR/MNAR subsets data (defined user randna logical, length equal nrow(object)). nbavg: Average neighbour imputation fractions collected along fractionation/separation gradient, sub-cellular fractions. method assumes fraction ordered along gradient invalid otherwise. Continuous sets NA value beginning end quantitation vectors set lowest observed value data user defined value passed argument k. , missing value flanked two non-missing neighbouring values, imputed mean direct neighbours. : Replaces missing values user-provided value. none: imputation performed missing values left untouched. Implemented case one wants impute value missing random random mixed method. imputeMethods() function returns vector valid imputation method names. Use getImputeMargin() get default margin imputation function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"Olga Troyanskaya, Michael Cantor, Gavin Sherlock, Pat Brown, Trevor Hastie, Robert Tibshirani, David Botstein Russ B. Altman, Missing value estimation methods DNA microarrays Bioinformatics (2001) 17 (6): 520-525. Oba et al., Bayesian missing value estimation method gene expression profile data, Bioinformatics (2003) 19 (16): 2088-2096. Cosmin Lazar (2015). imputeLCMD: collection methods left-censored missing data imputation. R package version 2.0. http://CRAN.R-project.org/package=imputeLCMD. Lazar C, Gatto L, Ferro M, Bruley C, Burger T. Accounting Multiple Natures Missing Values Label-Free Quantitative Proteomics Data Sets Compare Imputation Strategies. J Proteome Res. 2016 Apr 1;15(4):1116-25. doi: 10.1021/acs.jproteome.5b00981. PubMed PMID:26906401.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"","code":"## test data set.seed(42) m <- matrix(rlnorm(60), 10) dimnames(m) <- list(letters[1:10], LETTERS[1:6]) m[sample(60, 10)] <- NA ## available methods imputeMethods() #> [1] \"bpca\" \"knn\" \"QRILC\" \"MLE\" \"MLE2\" \"MinDet\" \"MinProb\" #> [8] \"min\" \"zero\" \"mixed\" \"nbavg\" \"with\" \"RF\" \"none\" impute_matrix(m, method = \"zero\") #> A B C D E F #> a 3.9391243 3.6872085 0.0000000 1.57688302 1.2287515 1.37978165 #> b 0.5685317 9.8418666 0.1684176 0.00000000 0.6969391 0.45664959 #> c 1.4378205 0.2493592 0.8420488 2.81539768 0.0000000 4.83425736 #> d 1.8829931 0.7566997 3.3691979 0.54393454 0.0000000 0.00000000 #> e 1.4982059 0.8751838 6.6538355 1.65691116 0.2545441 1.09391242 #> f 0.8993127 0.0000000 0.6502040 0.17960259 1.5415957 1.31857387 #> g 4.5336257 0.0000000 0.7731599 0.45636653 0.4442387 1.97247444 #> h 0.9096830 0.0701966 0.1715015 0.42702719 4.2380415 1.09399145 #> i 0.0000000 0.0000000 0.0000000 0.08943818 0.6495690 0.05013228 #> j 0.9392120 3.7438457 0.5272951 1.03678296 1.9263902 1.32960639 impute_matrix(m, method = \"min\") #> A B C D E F #> a 3.93912433 3.68720845 0.05013228 1.57688302 1.22875148 1.37978165 #> b 0.56853172 9.84186664 0.16841764 0.05013228 0.69693906 0.45664959 #> c 1.43782048 0.24935924 0.84204876 2.81539768 0.05013228 4.83425736 #> d 1.88299314 0.75669973 3.36919788 0.54393454 0.05013228 0.05013228 #> e 1.49820590 0.87518382 6.65383554 1.65691116 0.25454413 1.09391242 #> f 0.89931266 0.05013228 0.65020399 0.17960259 1.54159566 1.31857387 #> g 4.53362571 0.05013228 0.77315991 0.45636653 0.44423873 1.97247444 #> h 0.90968305 0.07019660 0.17150153 0.42702719 4.23804154 1.09399145 #> i 0.05013228 0.05013228 0.05013228 0.08943818 0.64956901 0.05013228 #> j 0.93921196 3.74384570 0.52729513 1.03678296 1.92639019 1.32960639 impute_matrix(m, method = \"knn\") #> Loading required namespace: impute #> Imputing along margin 1 (features/rows). #> A B C D E F #> a 3.9391243 3.6872085 1.8777229 1.57688302 1.2287515 1.37978165 #> b 0.5685317 9.8418666 0.1684176 0.93096390 0.6969391 0.45664959 #> c 1.4378205 0.2493592 0.8420488 2.81539768 1.3352059 4.83425736 #> d 1.8829931 0.7566997 3.3691979 0.54393454 1.3352059 1.54557696 #> e 1.4982059 0.8751838 6.6538355 1.65691116 0.2545441 1.09391242 #> f 0.8993127 2.5204465 0.6502040 0.17960259 1.5415957 1.31857387 #> g 4.5336257 2.5204465 0.7731599 0.45636653 0.4442387 1.97247444 #> h 0.9096830 0.0701966 0.1715015 0.42702719 4.2380415 1.09399145 #> i 1.6608509 2.5204465 1.8777229 0.08943818 0.6495690 0.05013228 #> j 0.9392120 3.7438457 0.5272951 1.03678296 1.9263902 1.32960639 ## same as impute_zero impute_matrix(m, method = \"with\", val = 0) #> A B C D E F #> a 3.9391243 3.6872085 0.0000000 1.57688302 1.2287515 1.37978165 #> b 0.5685317 9.8418666 0.1684176 0.00000000 0.6969391 0.45664959 #> c 1.4378205 0.2493592 0.8420488 2.81539768 0.0000000 4.83425736 #> d 1.8829931 0.7566997 3.3691979 0.54393454 0.0000000 0.00000000 #> e 1.4982059 0.8751838 6.6538355 1.65691116 0.2545441 1.09391242 #> f 0.8993127 0.0000000 0.6502040 0.17960259 1.5415957 1.31857387 #> g 4.5336257 0.0000000 0.7731599 0.45636653 0.4442387 1.97247444 #> h 0.9096830 0.0701966 0.1715015 0.42702719 4.2380415 1.09399145 #> i 0.0000000 0.0000000 0.0000000 0.08943818 0.6495690 0.05013228 #> j 0.9392120 3.7438457 0.5272951 1.03678296 1.9263902 1.32960639 ## impute with half of the smalles value impute_matrix(m, method = \"with\", val = min(m, na.rm = TRUE) * 0.5) #> A B C D E F #> a 3.93912433 3.68720845 0.02506614 1.57688302 1.22875148 1.37978165 #> b 0.56853172 9.84186664 0.16841764 0.02506614 0.69693906 0.45664959 #> c 1.43782048 0.24935924 0.84204876 2.81539768 0.02506614 4.83425736 #> d 1.88299314 0.75669973 3.36919788 0.54393454 0.02506614 0.02506614 #> e 1.49820590 0.87518382 6.65383554 1.65691116 0.25454413 1.09391242 #> f 0.89931266 0.02506614 0.65020399 0.17960259 1.54159566 1.31857387 #> g 4.53362571 0.02506614 0.77315991 0.45636653 0.44423873 1.97247444 #> h 0.90968305 0.07019660 0.17150153 0.42702719 4.23804154 1.09399145 #> i 0.02506614 0.02506614 0.02506614 0.08943818 0.64956901 0.05013228 #> j 0.93921196 3.74384570 0.52729513 1.03678296 1.92639019 1.32960639 ## all but third and fourth features' missing values ## are the result of random missing values randna <- rep(TRUE, 10) randna[c(3, 9)] <- FALSE impute_matrix(m, method = \"mixed\", randna = randna, mar = \"knn\", mnar = \"min\") #> Imputing along margin 1 (features/rows). #> A B C D E F #> a 3.93912433 3.68720845 2.35451487 1.57688302 1.22875148 1.37978165 #> b 0.56853172 9.84186664 0.16841764 0.74593934 0.69693906 0.45664959 #> c 1.43782048 0.24935924 0.84204876 2.81539768 0.05013228 4.83425736 #> d 1.88299314 0.75669973 3.36919788 0.54393454 1.34408497 1.44241604 #> e 1.49820590 0.87518382 6.65383554 1.65691116 0.25454413 1.09391242 #> f 0.89931266 2.42140409 0.65020399 0.17960259 1.54159566 1.31857387 #> g 4.53362571 2.42140409 0.77315991 0.45636653 0.44423873 1.97247444 #> h 0.90968305 0.07019660 0.17150153 0.42702719 4.23804154 1.09399145 #> i 0.05013228 0.05013228 0.05013228 0.08943818 0.64956901 0.05013228 #> j 0.93921196 3.74384570 0.52729513 1.03678296 1.92639019 1.32960639 ## user provided (random) imputation function random_imp <- function(x) { m <- mean(x, na.rm = TRUE) sdev <- sd(x, na.rm = TRUE) n <- sum(is.na(x)) x[is.na(x)] <- rnorm(n, mean = m, sd = sdev) x } impute_matrix(m, FUN = random_imp) #> Imputing along margin 1 (features/rows). #> A B C D E F #> a 3.9391243 3.6872085 -0.9827978 1.57688302 1.2287515 1.37978165 #> b 0.5685317 9.8418666 0.1684176 3.34043209 0.6969391 0.45664959 #> c 1.4378205 0.2493592 0.8420488 2.81539768 4.6343602 4.83425736 #> d 1.8829931 0.7566997 3.3691979 0.54393454 -0.3031275 0.79093969 #> e 1.4982059 0.8751838 6.6538355 1.65691116 0.2545441 1.09391242 #> f 0.8993127 2.0228995 0.6502040 0.17960259 1.5415957 1.31857387 #> g 4.5336257 -0.6151082 0.7731599 0.45636653 0.4442387 1.97247444 #> h 0.9096830 0.0701966 0.1715015 0.42702719 4.2380415 1.09399145 #> i 4.5173132 2.2355807 3.0879489 0.08943818 0.6495690 0.05013228 #> j 0.9392120 3.7438457 0.5272951 1.03678296 1.9263902 1.32960639 ## get the default margin getImputeMargin(impute_knn) ## default imputes along features #> [1] 1 getImputeMargin(impute_mle) ## default imputes along samples #> [1] 2 getImputeMargin(impute_zero) ## NA: no margin here #> [1] NA ## default margin for all MsCoreUtils::impute_* functions sapply(ls(\"package:MsCoreUtils\", pattern = \"impute_\"), getImputeMargin) #> impute_MinDet impute_MinProb impute_QRILC #> 2 2 2 #> impute_RF impute_bpca impute_fun #> 2 1 1 #> impute_knn impute_matrix impute_min #> 1 NA NA #> impute_mixed impute_mle impute_neighbour_average #> 1 2 1 #> impute_with impute_zero #> NA NA"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":null,"dir":"Reference","previous_headings":"","what":"Local Maxima — localMaxima","title":"Local Maxima — localMaxima","text":"function finds local maxima numeric vector. local maximum defined maximum window current index +/- hws.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Local Maxima — localMaxima","text":"","code":"localMaxima(x, hws = 1L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Local Maxima — localMaxima","text":"x numeric, vector searched local maxima. hws integer(1), half window size, resulting window reaches (- hws):(+ hws).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Local Maxima — localMaxima","text":"logical length x TRUE local maxima.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Local Maxima — localMaxima","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Local Maxima — localMaxima","text":"","code":"x <- c(1:5, 4:1, 1:10, 9:1, 1:5, 4:1) localMaxima(x) #> [1] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [13] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE #> [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE #> [37] FALSE localMaxima(x, hws = 10) #> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [13] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE #> [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [37] FALSE"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":null,"dir":"Reference","previous_headings":"","what":"Relaxed Value Matching — closest","title":"Relaxed Value Matching — closest","text":"functions offer relaxed matching one vector another. contrast similar match() %% functions just accept numeric arguments additional tolerance argument allows relaxed matching.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Relaxed Value Matching — closest","text":"","code":"closest( x, table, tolerance = Inf, ppm = 0, duplicates = c(\"keep\", \"closest\", \"remove\"), nomatch = NA_integer_, .check = TRUE ) common( x, table, tolerance = Inf, ppm = 0, duplicates = c(\"keep\", \"closest\", \"remove\"), .check = TRUE ) join( x, y, tolerance = 0, ppm = 0, type = c(\"outer\", \"left\", \"right\", \"inner\"), .check = TRUE, ... )"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Relaxed Value Matching — closest","text":"x numeric, values matched. contrast match() x sorted increasing order must contain NA. table numeric, values matched . contrast match() table sorted increasing order must contain NA. tolerance numeric, accepted tolerance. length one length x. ppm numeric(1) representing relative, value-specific parts-per-million (PPM) tolerance added tolerance. duplicates character(1), handle duplicated matches. one c(\"keep\", \"closest\", \"remove\"). abbreviations allowed. nomatch integer(1), difference value x table larger tolerance nomatch returned. .check logical(1) turn checks increasingly sorted x y. just done ensured methods x y sorted, see also closest(). y numeric, values joined. sorted. type character(1), defines x y joined. See details join. ... ignored.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Relaxed Value Matching — closest","text":"closest returns integer vector length x giving closest position table first match nomatch match. common returns logical vector length x TRUE element x found table. similar %%. join returns matrix two columns, namely x y, representing index values x matching corresponding value y (NA value match).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Relaxed Value Matching — closest","text":"closest/common tolerance argument set 0 get results match()/%%. set Inf (default) index closest values returned without restriction. guaranteed one--one matching neither x table table x matching. multiple elements x match single element table corresponding indices returned duplicates=\"keep\" set (default). behaviour identical match(). duplicates=\"closest\" just closest element x gets corresponding index table duplicates=\"remove\" elements x match element table set nomatch. single element x matches multiple elements table closest returned duplicates=\"keep\" duplicates=\"closest\" (keeping multiple matches possible case return value length x). differences x corresponding matches table identical lower index (smaller element table) returned. one exception: lower index already returned another x smaller difference index higher one returned duplicates = \"closer\" (x closer higher one). duplicates=\"remove\" multiple matches returned nomatch . .checks = TRUE tests among input validation checks increasingly sorted x table arguments mandatory assumptions closest algorithm. checks require loop vectors compare element precursor. Depending length distribution x table checks take equal/time whole closest algorithm. ensured methods arguments x table sorted tests skipped .check = FALSE. case .check = FALSE used one x table sorted (decreasingly sorted) output incorrect best case result infinity loop average worst case. join: joins two numeric vectors mapping values x values y vice versa similar enough (provided tolerance ppm specified). function returns matrix indices mapped values x y. Parameter type allows define vectors joined: type = \"left\": values x mapped values y, elements y matching value x discarded. type = \"right\": type = \"left\" y. type = \"outer\": return matches values x y. type = \"inner\": report indices values mapped.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Relaxed Value Matching — closest","text":"join based closest(x, y, tolerance, duplicates = \"closest\"). means multiple matches just closest one reported.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Relaxed Value Matching — closest","text":"Sebastian Gibb, Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Relaxed Value Matching — closest","text":"","code":"## Define two vectors to match x <- c(1, 3, 5) y <- 1:10 ## Compare match and closest match(x, y) #> [1] 1 3 5 closest(x, y) #> [1] 1 3 5 ## If there is no exact match x <- x + 0.1 match(x, y) # no match #> [1] NA NA NA closest(x, y) #> [1] 1 3 5 ## Some new values x <- c(1.11, 45.02, 556.45) y <- c(3.01, 34.12, 45.021, 46.1, 556.449) ## Using a single tolerance value closest(x, y, tolerance = 0.01) #> [1] NA 3 5 ## Using a value-specific tolerance accepting differences of 20 ppm closest(x, y, ppm = 20) #> [1] 1 3 5 ## Same using 50 ppm closest(x, y, ppm = 50) #> [1] 1 3 5 ## Sometimes multiple elements in `x` match to `table` x <- c(1.6, 1.75, 1.8) y <- 1:2 closest(x, y, tolerance = 0.5) #> [1] 2 2 2 closest(x, y, tolerance = 0.5, duplicates = \"closest\") #> [1] NA NA 2 closest(x, y, tolerance = 0.5, duplicates = \"remove\") #> [1] NA NA NA ## Are there any common values? x <- c(1.6, 1.75, 1.8) y <- 1:2 common(x, y, tolerance = 0.5) #> [1] TRUE TRUE TRUE common(x, y, tolerance = 0.5, duplicates = \"closest\") #> [1] FALSE FALSE TRUE common(x, y, tolerance = 0.5, duplicates = \"remove\") #> [1] FALSE FALSE FALSE ## Join two vectors x <- c(1, 2, 3, 6) y <- c(3, 4, 5, 6, 7) jo <- join(x, y, type = \"outer\") jo #> $x #> [1] 1 2 3 NA NA 4 NA #> #> $y #> [1] NA NA 1 2 3 4 5 #> x[jo$x] #> [1] 1 2 3 NA NA 6 NA y[jo$y] #> [1] NA NA 3 4 5 6 7 jl <- join(x, y, type = \"left\") jl #> $x #> [1] 1 2 3 4 #> #> $y #> [1] NA NA 1 4 #> x[jl$x] #> [1] 1 2 3 6 y[jl$y] #> [1] NA NA 3 6 jr <- join(x, y, type = \"right\") jr #> $x #> [1] 3 NA NA 4 NA #> #> $y #> [1] 1 2 3 4 5 #> x[jr$x] #> [1] 3 NA NA 6 NA y[jr$y] #> [1] 3 4 5 6 7 ji <- join(x, y, type = \"inner\") ji #> $x #> [1] 3 4 #> #> $y #> [1] 1 4 #> x[ji$x] #> [1] 3 6 y[ji$y] #> [1] 3 6"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":null,"dir":"Reference","previous_headings":"","what":"Maximum MS Intensity Value — maxi","title":"Maximum MS Intensity Value — maxi","text":"maxi determines maximum mass spectrometry intensity values, e.g. spectrum chromatogram. contrast base R max() function function returns NA_real_ intensity values NA length(x) 0 (base R max function returns -Inf cases).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Maximum MS Intensity Value — maxi","text":"","code":"maxi(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Maximum MS Intensity Value — maxi","text":"x numeric intensity values maximum reported. coerced numeric.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Maximum MS Intensity Value — maxi","text":"numeric(1) representing maximum values x. Returns always numeric (double) even x integer.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Maximum MS Intensity Value — maxi","text":"Johannes Rainer, Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Maximum MS Intensity Value — maxi","text":"","code":"x <- c(3.2, 34.4, 1.3, NA) maxi(x) #> [1] 34.4 ## Compared to base R max: max(x) #> [1] NA max(x, na.rm = TRUE) #> [1] 34.4 max(numeric(), na.rm = TRUE) #> Warning: no non-missing arguments to max; returning -Inf #> [1] -Inf maxi(numeric()) #> [1] NA max(c(NA, NA), na.rm = TRUE) #> Warning: no non-missing arguments to max; returning -Inf #> [1] -Inf maxi(c(NA, NA)) #> [1] NA"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"Fits additive model (two way decomposition) using Tukey's median polish procedure using stats::medpolish().","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"","code":"medianPolish(x, verbose = FALSE, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"x matrix mode numeric. verbose Default FALSE. ... Additional arguments passed stats::medpolish().","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"numeric vector length identical ncol(x).","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"","code":"x <- matrix(rnorm(30), nrow = 3) medianPolish(x) #> [1] -0.26776266 -0.15710481 -0.75996920 -0.33338980 0.45164953 0.38219408 #> [7] -0.55997060 -1.49835829 0.00120463 -0.03864196"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":null,"dir":"Reference","previous_headings":"","what":"Noise Estimation — noise","title":"Noise Estimation — noise","text":"functions estimate noise data.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Noise Estimation — noise","text":"","code":"noise(x, y, method = c(\"MAD\", \"SuperSmoother\"), ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Noise Estimation — noise","text":"x numeric, x values noise estimation (e.g. mz) y numeric, y values noise estimation (e.g. intensity) method character(1) used method. Currently MAD (median absolute deviation) Friedman's SuperSmoother supported. ... arguments passed method.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Noise Estimation — noise","text":"numeric length x estimated noise.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Noise Estimation — noise","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Noise Estimation — noise","text":"","code":"x <- 1:20 y <- c(1:10, 10:1) noise(x, y) #> [1] 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 #> [11] 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 noise(x, y, method = \"SuperSmoother\", span = 1 / 3) #> [1] 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 7.857143 #> [9] 8.428571 8.714286 8.714286 8.428571 7.857143 7.000000 6.000000 5.000000 #> [17] 4.000000 3.000000 2.000000 1.000000"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":null,"dir":"Reference","previous_headings":"","what":"Quantitative data normalisation — normalizeMethods","title":"Quantitative data normalisation — normalizeMethods","text":"Function normalise matrix quantitative omics data. nature normalisation controlled method argument, described .","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quantitative data normalisation — normalizeMethods","text":"","code":"normalizeMethods() normalize_matrix(x, method, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quantitative data normalisation — normalizeMethods","text":"x matrix HDF5Matrix object normalised. method character(1) defining normalisation method. See normalizeMethods() available ones. ... Additional parameters passed inner normalisation function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quantitative data normalisation — normalizeMethods","text":"matrix class x dimensions dim(x).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Quantitative data normalisation — normalizeMethods","text":"method parameter can one \"sum\", \"max\", \"center.mean\", \"center.median\", \"div.mean\", \"div.median\", \"diff.meda\", \"quantiles\", \"quantiles.robust\" \"vsn\". normalizeMethods() function returns vector available normalisation methods. \"sum\" \"max\", feature's intensity divided maximum sum feature respectively. two methods applied along features (rows). \"center.mean\" \"center.median\" center respective sample (column) intensities subtracting respective column means medians. \"div.mean\" \"div.median\" divide column means medians. \"diff.median\" centers samples (columns) match grand median subtracting respective columns medians differences grand median. Using \"quantiles\" \"quantiles.robust\" applies (robust) quantile normalisation, implemented preprocessCore::normalize.quantiles() preprocessCore::normalize.quantiles.robust(). \"vsn\" uses vsn::vsn2() function. Note latter also glog-transforms intensities. See respective manuals details function arguments.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Quantitative data normalisation — normalizeMethods","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quantitative data normalisation — normalizeMethods","text":"","code":"normalizeMethods() #> [1] \"sum\" \"max\" \"center.mean\" \"center.median\" #> [5] \"div.mean\" \"div.median\" \"diff.median\" \"quantiles\" #> [9] \"quantiles.robust\" \"vsn\" ## test data set.seed(42) m <- matrix(rlnorm(60), 10) normalize_matrix(m, method = \"sum\") #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 0.31393285 0.293856133 0.05864968 0.125671426 0.09792670 0.109963217 #> [2,] 0.04132996 0.715463967 0.01224328 0.147101553 0.05066466 0.033196581 #> [3,] 0.11677032 0.020251317 0.06838566 0.228648076 0.17333805 0.392606576 #> [4,] 0.21066540 0.084658010 0.37693894 0.060854278 0.05409294 0.212790434 #> [5,] 0.12451231 0.072734432 0.55298434 0.137701921 0.02115455 0.090912443 #> [6,] 0.13882341 0.291569272 0.10036947 0.027724557 0.23797015 0.203543139 #> [7,] 0.50754608 0.084252023 0.08655639 0.051090905 0.04973318 0.220821420 #> [8,] 0.13163892 0.010158049 0.02481774 0.061794488 0.61328088 0.158309924 #> [9,] 0.75362945 0.008723409 0.15863000 0.008955514 0.06504185 0.005019784 #> [10,] 0.09883183 0.393959126 0.05548646 0.109099076 0.20271108 0.139912436 normalize_matrix(m, method = \"max\") #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 1.00000000 0.93604775 0.18682236 0.40031309 0.31193519 0.350276239 #> [2,] 0.05776666 1.00000000 0.01711237 0.20560302 0.07081371 0.046398677 #> [3,] 0.29742324 0.05158171 0.17418369 0.58238473 0.44150573 1.000000000 #> [4,] 0.55888470 0.22459344 1.00000000 0.16144333 0.14350584 0.564522299 #> [5,] 0.22516425 0.13153073 1.00000000 0.24901595 0.03825525 0.164403285 #> [6,] 0.47612497 1.00000000 0.34423885 0.09508737 0.81617020 0.698095301 #> [7,] 1.00000000 0.16599877 0.17053898 0.10066259 0.09798752 0.435076596 #> [8,] 0.21464703 0.01656345 0.04046717 0.10076050 1.00000000 0.258136084 #> [9,] 1.00000000 0.01157520 0.21048806 0.01188318 0.08630481 0.006660813 #> [10,] 0.25086823 1.00000000 0.14084318 0.27692994 0.51454850 0.355144549 normalize_matrix(m, method = \"quantiles\") #> Loading required namespace: preprocessCore #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 2.4493083 2.4493083 0.9149807 1.5186864 1.1236151 1.5186864 #> [2,] 0.2002101 5.9849751 0.2002101 2.9628356 0.9149807 0.3730709 #> [3,] 0.9149807 0.6151294 1.5186864 5.9849751 2.9628356 5.9849751 #> [4,] 1.5186864 0.9149807 2.9628356 0.9149807 0.6151294 2.4493083 #> [5,] 1.1236151 1.1236151 5.9849751 2.4493083 0.2002101 0.6151294 #> [6,] 0.3730709 1.5186864 0.7569865 0.3730709 1.5186864 0.9149807 #> [7,] 2.9628356 0.7569865 1.1236151 0.7569865 0.3730709 2.9628356 #> [8,] 0.6151294 0.2002101 0.3730709 0.6151294 5.9849751 0.7569865 #> [9,] 5.9849751 0.3730709 2.4493083 0.2002101 0.7569865 0.2002101 #> [10,] 0.7569865 2.9628356 0.6151294 1.1236151 2.4493083 1.1236151 normalize_matrix(m, method = \"center.mean\") #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 1.5256283 1.4919211 -0.8116640 0.49629688 -0.1310407 -0.1633550 #> [2,] -1.8449643 7.6465793 -1.3791629 0.94293137 -0.6628531 -1.0864871 #> [3,] -0.9756756 -1.9459281 -0.7055318 1.73481154 0.7745601 3.2911207 #> [4,] -0.5305029 -1.4385876 1.8216174 -0.53665160 -0.8762926 0.3588507 #> [5,] -0.9152902 -1.3201035 5.1062550 0.57632503 -1.1052480 -0.4492243 #> [6,] -1.5141834 -0.3064709 -0.8973765 -0.90098354 0.1818035 -0.2245628 #> [7,] 2.1201296 -1.4427110 -0.7744206 -0.62421961 -0.9155534 0.4293378 #> [8,] -1.5038130 -2.1250907 -1.3760790 -0.65355895 2.8782494 -0.4491452 #> [9,] 5.1129557 -2.1081671 0.0366477 -0.99114796 -0.7102232 -1.4930044 #> [10,] -1.4742841 1.5485584 -1.0202854 -0.04380318 0.5665980 -0.2135303"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":null,"dir":"Reference","previous_headings":"","what":"Peak Region Mask — .peakRegionMask","title":"Peak Region Mask — .peakRegionMask","text":"function finds mz region spanning peak. creates 0/1 matrix used multiplications functions.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Peak Region Mask — .peakRegionMask","text":"","code":".peakRegionMask(x, p, k = 30L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Peak Region Mask — .peakRegionMask","text":"x numeric, e.g. intensity values. p integer, indices identified peaks/local maxima. k integer(1): maximum number values left right peak looked valleys.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Peak Region Mask — .peakRegionMask","text":"matrix column peak p 2 * k + 1 rows middle row k + 1 peak centroid. values 1 index belongs peak region.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Peak Region Mask — .peakRegionMask","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Peak Region Mask — .peakRegionMask","text":"","code":"ints <- c(5, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 2, 9, 12, 14, 13, 8, 3) mzs <- seq_along(ints) peaks <- which(localMaxima(ints, hws = 3L)) m <- MsCoreUtils:::.peakRegionMask(ints, peaks, k = 5L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":null,"dir":"Reference","previous_headings":"","what":"PPM - Parts per Million — ppm","title":"PPM - Parts per Million — ppm","text":"ppm small helper function determine parts-per-million user-provided value ppm.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PPM - Parts per Million — ppm","text":"","code":"ppm(x, ppm)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"PPM - Parts per Million — ppm","text":"x numeric, value(s) used ppm calculation, e.g. mz value(s). ppm numeric, parts-per-million (ppm) value(s).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"PPM - Parts per Million — ppm","text":"numeric: parts-per-million x (always positive value).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"PPM - Parts per Million — ppm","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"PPM - Parts per Million — ppm","text":"","code":"ppm(c(1000, 2000), 5) #> [1] 0.005 0.010 ppm(c(-300, 200), 5) #> [1] 0.0015 0.0010"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":null,"dir":"Reference","previous_headings":"","what":"Range helper functions — between","title":"Range helper functions — between","text":"functions help work numeric ranges.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Range helper functions — between","text":"","code":"between(x, range) x %between% range"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Range helper functions — between","text":"x numeric, input values. range numeric(2), range compare .","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Range helper functions — between","text":"logical vector length length(x).","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Range helper functions — between","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Range helper functions — between","text":"","code":"between(1:4, 2:3) #> [1] FALSE TRUE TRUE FALSE 1:4 %between% 2:3 #> [1] FALSE TRUE TRUE FALSE"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine R Objects by Row — rbindFill","title":"Combine R Objects by Row — rbindFill","text":"function combines instances matrix, data.frame DataFrame objects single instance adding eventually missing columns (filling NAs).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine R Objects by Row — rbindFill","text":"","code":"rbindFill(...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine R Objects by Row — rbindFill","text":"... 2 : matrix, data.frame DataFrame.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine R Objects by Row — rbindFill","text":"Depending input single matrix, data.frame DataFrame.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Combine R Objects by Row — rbindFill","text":"rbindFill might work one columns contains S4 classes.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Combine R Objects by Row — rbindFill","text":"Johannes Rainer, Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine R Objects by Row — rbindFill","text":"","code":"## Combine matrices a <- matrix(1:9, nrow = 3, ncol = 3) colnames(a) <- c(\"a\", \"b\", \"c\") b <- matrix(1:12, nrow = 3, ncol = 4) colnames(b) <- c(\"b\", \"a\", \"d\", \"e\") rbindFill(a, b) #> a b c d e #> [1,] 1 4 7 NA NA #> [2,] 2 5 8 NA NA #> [3,] 3 6 9 NA NA #> [4,] 4 1 NA 7 10 #> [5,] 5 2 NA 8 11 #> [6,] 6 3 NA 9 12 rbindFill(b, a, b) #> b a d e c #> [1,] 1 4 7 10 NA #> [2,] 2 5 8 11 NA #> [3,] 3 6 9 12 NA #> [4,] 4 1 NA NA 7 #> [5,] 5 2 NA NA 8 #> [6,] 6 3 NA NA 9 #> [7,] 1 4 7 10 NA #> [8,] 2 5 8 11 NA #> [9,] 3 6 9 12 NA"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":null,"dir":"Reference","previous_headings":"","what":"Refine Peak Centroids — refineCentroids","title":"Refine Peak Centroids — refineCentroids","text":"function refines centroided values peak weighting y values neighbourhood belong likely peak.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Refine Peak Centroids — refineCentroids","text":"","code":"refineCentroids(x, y, p, k = 2L, threshold = 0.33, descending = FALSE)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Refine Peak Centroids — refineCentroids","text":"x numeric, .e. m/z values. y numeric, .e. intensity values. p integer, indices identified peaks/local maxima. k integer(1), number values left right peak considered weighted mean calculation. threshold double(1), proportion maximal peak intensity. Just values used weighted mean calclulation. descending logical, TRUE just values nearest valleys around peak centroids used.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Refine Peak Centroids — refineCentroids","text":"descending = FALSE function looks k nearest neighbouring data points use x weighted mean corresponding y values weights calculation new peak centroid. k chosen large result skewed peak centroids, see example . descending = TRUE used k general larger trimmed automatically nearest valleys sides peak problem skewed centroids rare.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Refine Peak Centroids — refineCentroids","text":"Sebastian Gibb, Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Refine Peak Centroids — refineCentroids","text":"","code":"ints <- c(5, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 9, 12, 14, 13, 8, 3) mzs <- seq_along(ints) plot(mzs, ints, type = \"h\") pidx <- as.integer(c(3, 8, 16)) points(mzs[pidx], ints[pidx], pch = 16) ## Use the weighted average considering the adjacent mz mzs1 <- refineCentroids(mzs, ints, pidx, k = 2L, descending = FALSE, threshold = 0) mzs2 <- refineCentroids(mzs, ints, pidx, k = 5L, descending = FALSE, threshold = 0) mzs3 <- refineCentroids(mzs, ints, pidx, k = 5L, descending = TRUE, threshold = 0) points(mzs1, ints[pidx], col = \"red\", type = \"h\") ## please recognize the artificial moved centroids of the first peak caused ## by a too large k, here points(mzs2, ints[pidx], col = \"blue\", type = \"h\") points(mzs3, ints[pidx], col = \"green\", type = \"h\") legend(\"topright\", legend = paste0(\"k = \", c(2, 5, 5), \", descending =\", c(\"FALSE\", \"FALSE\", \"TRUE\")), col = c(\"red\", \"blue\", \"green\"), lwd = 1)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate relative log abundances — rla","title":"Calculate relative log abundances — rla","text":"rla calculates relative log abundances (RLA, see reference) numeric vector. rowRla performs row-wise RLA calculations numeric matrix.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate relative log abundances — rla","text":"","code":"rla( x, f = rep_len(1, length(x)), transform = c(\"log2\", \"log10\", \"identity\"), na.rm = TRUE ) rowRla(x, f = rep_len(1, ncol(x)), transform = c(\"log2\", \"log10\", \"identity\"))"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate relative log abundances — rla","text":"x numeric (rla) matrix (rowRla) abundances (natural scale) RLA calculated. f factor, numeric character length x (, rowRla equal number columns x) allowing define grouping values x. omitted values considered group. transform character(1) defining function transform x. Defaults transform = \"log2\" log2 transforms x prior calculation. x already log scale use transform = \"identity\" avoid transformation values. na.rm logical(1) whether NA values removed prior calculation group-wise medians.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate relative log abundances — rla","text":"numeric relative log abundances (log2 scale) length x (rla) matrix dimensions x (rowRla).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate relative log abundances — rla","text":"RLA defined (log2) abundance analyte relative median across abundances analyte samples group. grouping values can defined parameter f.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate relative log abundances — rla","text":"De Livera , Dias DA, De Souza D, Rupasinghe T, Pyke J, Tull D, Roessner U, McConville M, Speed TP. Normalizing integrating metabolomics data. Anal Chem 2012 Dec 18;84(24):10768-76.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate relative log abundances — rla","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate relative log abundances — rla","text":"","code":"x <- c(3, 4, 5, 1, 2, 3, 7, 8, 9) grp <- c(1, 1, 1, 2, 2, 2, 3, 3, 3) rla(x, grp) #> [1] -0.4150375 0.0000000 0.3219281 -1.0000000 0.0000000 0.5849625 -0.1926451 #> [8] 0.0000000 0.1699250 x <- rbind(c(324, 4542, 3422, 3232, 5432, 6535, 3321, 1121), c(12, 3341, 3034, 6540, 34, 4532, 56, 1221)) grp <- c(\"a\", \"b\", \"b\", \"b\", \"a\", \"b\", \"a\", \"b\") ## row-wise RLA values rowRla(x, grp) #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] -3.357552 0.4084879 0.0000000 -0.08241256 0.7098658 0.9333475 0.0000000 #> [2,] -1.502500 0.0000000 -0.1390589 0.96901065 0.0000000 0.4398679 0.7198921 #> [,8] #> [1,] -1.610053 #> [2,] -1.452217"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the Robust Expression Summary of a matrix — robustSummary","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"function calculates robust summarisation feature (protein). Note function assumes intensities input e already log-transformed.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"","code":"robustSummary(x, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"x feature sample matrix containing quantitative data mandatory colnames rownames. ... Additional arguments passed MASS::rlm().","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"numeric() vector length ncol(x) robust summarised values.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"Adriaan Sticker, Sebastian Gibb Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"","code":"x <- matrix(rnorm(30), nrow = 3) colnames(x) <- letters[1:10] rownames(x) <- LETTERS[1:3] robustSummary(x) #> a b c d e f #> 0.13327322 0.91145468 0.76502760 -0.23239400 -0.41392131 0.60431427 #> g h i j #> -0.51182415 0.07515504 -0.39439300 0.52412091"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":null,"dir":"Reference","previous_headings":"","what":"Smoothing — smooth","title":"Smoothing — smooth","text":"function smoothes numeric vector.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Smoothing — smooth","text":"","code":"smooth(x, cf) coefMA(hws) coefWMA(hws) coefSG(hws, k = 3L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Smoothing — smooth","text":"x numeric, .e. m/z values. cf matrix, coefficient matrix generated coefMA, coefWMA coefSG. hws integer(1), half window size, resulting window reaches (- hws):(+ hws). k integer(1), set order polynomial used calculate coefficients.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Smoothing — smooth","text":"smooth: numeric length x. coefMA: matrix coefficients simple moving average. coefWMA: matrix coefficients weighted moving average. coefSG: matrix Savitzky-Golay-Filter coefficients.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Smoothing — smooth","text":"Savitzky-Golay-Filter hws smaller FWHM peaks (full width half maximum; please find details Bromba Ziegler 1981). general hws (weighted) moving average (coefMA/coefWMA) bemuch smaller Savitzky-Golay-Filter conserve peak shape.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Smoothing — smooth","text":"coefMA(): Simple Moving Average function calculates coefficients simple moving average. coefWMA(): Weighted Moving Average function calculates coefficients weighted moving average weights depending distance center calculated 1/2^abs(-hws:hws) sum weigths normalized 1. coefSG(): Savitzky-Golay-Filter function calculates Savitzky-Golay-Coefficients. additional argument k controls order used polynomial. k set zero yield simple moving average.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Smoothing — smooth","text":"hws depends used method ((weighted) moving average/Savitzky-Golay).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Smoothing — smooth","text":". Savitzky M. J. Golay. 1964. Smoothing differentiation data simplified least squares procedures. Analytical chemistry, 36(8), 1627-1639. M. U. Bromba H. Ziegler. 1981. Application hints Savitzky-Golay digital smoothing filters. Analytical Chemistry, 53(11), 1583-1586. Implementation based : Steinier, J., Termonia, Y., & Deltour, J. (1972). Comments Smoothing differentiation data simplified least square procedure. Analytical Chemistry, 44(11), 1906-1909.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Smoothing — smooth","text":"Sebastian Gibb, Sigurdur Smarason (weighted moving average)","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Smoothing — smooth","text":"","code":"x <- c(1:10, 9:1) plot(x, type = \"b\", pch = 20) cf <- list(MovingAverage = coefMA(2), WeightedMovingAverage = coefWMA(2), SavitzkyGolay = coefSG(2)) for (i in seq_along(cf)) { lines(smooth(x, cf[[i]]), col = i + 1, pch = 20, type = \"b\") } legend(\"bottom\", legend = c(\"x\", names(cf)), pch = 20, col = seq_len(length(cf) + 1))"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":null,"dir":"Reference","previous_headings":"","what":"Summing MS Intensity Values — sumi","title":"Summing MS Intensity Values — sumi","text":"sumi sums mass spectrometry intensity values, e.g. spectrum chromatogram. contrast base R sum() function function returns NA_real_ intensity values NA length(x) 0.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summing MS Intensity Values — sumi","text":"","code":"sumi(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summing MS Intensity Values — sumi","text":"x numeric intensity values summed . coerced numeric using .double.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summing MS Intensity Values — sumi","text":"numeric(1) representing sum values x. Always returns numeric (double) even x integer.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Summing MS Intensity Values — sumi","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summing MS Intensity Values — sumi","text":"","code":"x <- c(3.2, 34.4, 1.3, NA) sumi(x) #> [1] 38.9 ## Compared to base R sum: sum(x) #> [1] NA sum(x, na.rm = TRUE) #> [1] 38.9 sum(numeric(), na.rm = TRUE) #> [1] 0 sumi(numeric()) #> [1] NA sum(c(NA, NA), na.rm = TRUE) #> [1] 0 sumi(c(NA, NA)) #> [1] NA"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":null,"dir":"Reference","previous_headings":"","what":"Validation functions — validPeaksMatrix","title":"Validation functions — validPeaksMatrix","text":"functions used validate input arguments. general just wrapper around corresponding * function error message.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validation functions — validPeaksMatrix","text":"","code":"validPeaksMatrix(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validation functions — validPeaksMatrix","text":"x object test.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validation functions — validPeaksMatrix","text":"logical(1), TRUE validation successful otherwise error thrown.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validation functions — validPeaksMatrix","text":"validPeaksMatrix: see isPeaksMatrix.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Validation functions — validPeaksMatrix","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validation functions — validPeaksMatrix","text":"","code":"try(validPeaksMatrix(1:2)) #> Error in validPeaksMatrix(1:2) : #> 'x' has to be a 'numeric' matrix with two columns named 'mz' and 'intensity'. The 'mz' column has to be sorted increasingly. validPeaksMatrix(cbind(mz = 1:2, intensity = 1:2)) #> [1] TRUE"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":null,"dir":"Reference","previous_headings":"","what":"Find Peak Valleys — valleys","title":"Find Peak Valleys — valleys","text":"function finds valleys around peaks.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find Peak Valleys — valleys","text":"","code":"valleys(x, p)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find Peak Valleys — valleys","text":"x numeric, e.g. intensity values. p integer, indices identified peaks/local maxima.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find Peak Valleys — valleys","text":"matrix three columns representing index left valley, peak centroid, right valley.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Find Peak Valleys — valleys","text":"detection valleys based localMaxima. returns first occurence local maximum (specific case minimum). plateaus, e.g. c(0, 0, 0, 1:3, 2:1, 0) results wrongly reported left valley index 1 (instead 3, see example section well). real data real problem. x[x == min(x)] <- Inf used running valleys circumvent specific problem really tested cause different problems.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find Peak Valleys — valleys","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find Peak Valleys — valleys","text":"","code":"ints <- c(5, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 2, 9, 12, 14, 13, 8, 3) mzs <- seq_along(ints) peaks <- which(localMaxima(ints, hws = 3)) cols <- seq_along(peaks) + 1 plot(mzs, ints, type = \"h\", ylim = c(0, 16)) points(mzs[peaks], ints[peaks], col = cols, pch = 20) v <- valleys(ints, peaks) segments(mzs[v[, \"left\"]], 0, mzs[v[, \"right\"]], col = cols, lwd = 2) ## Known limitations for plateaus y <- c(0, 0, 0, 0, 0, 1:5, 4:1, 0) valleys(y, 10L) # left should be 5 here but is 1 #> left centroid right #> [1,] 1 10 15 ## a possible workaround that may cause other problems y[min(y) == y] <- Inf valleys(y, 10L) #> left centroid right #> [1,] 6 10 14"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":null,"dir":"Reference","previous_headings":"","what":"vapply wrappers — vapply1c","title":"vapply wrappers — vapply1c","text":"functions short wrappers around typical vapply calls easier development.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"vapply wrappers — vapply1c","text":"","code":"vapply1c(X, FUN, ..., USE.NAMES = FALSE) vapply1d(X, FUN, ..., USE.NAMES = FALSE) vapply1l(X, FUN, ..., USE.NAMES = FALSE)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"vapply wrappers — vapply1c","text":"X vector (atomic list). FUN function applied element X. ... optional arguments FUN. USE.NAMES logical, return value named.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"vapply wrappers — vapply1c","text":"vapply1c returns vector characters length X. vapply1d returns vector doubles length X. vapply1l returns vector logicals length X.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"vapply wrappers — vapply1c","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"vapply wrappers — vapply1c","text":"","code":"l <- list(a=1:3, b=4:6) vapply1d(l, sum) #> [1] 6 15"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":null,"dir":"Reference","previous_headings":"","what":"Which is the first/last TRUE value. — which.first","title":"Which is the first/last TRUE value. — which.first","text":"Determines location, .e., index first last TRUE value logical vector.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which is the first/last TRUE value. — which.first","text":"","code":"which.first(x) which.last(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which is the first/last TRUE value. — which.first","text":"x logical, vector.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which is the first/last TRUE value. — which.first","text":"integer, index first/last TRUE value. integer(0) TRUE (everything FALSE NA) found.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Which is the first/last TRUE value. — which.first","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which is the first/last TRUE value. — which.first","text":"","code":"l <- 2 <= 1:3 which.first(l) #> [1] 2 which.last(l) #> [1] 3"},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-15","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.15.2","title":"MsCoreUtils 1.15","text":"Porting baseline baseline estimation function (see issue 119).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-15-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.15.1","title":"MsCoreUtils 1.15","text":"Remove impute_mle2() since norm2 removed CRAN (see issue 117).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-15-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.15.0","title":"MsCoreUtils 1.15","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-13","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.13.1","title":"MsCoreUtils 1.13","text":"Add functions entropy nentropy.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.6","title":"MsCoreUtils 1.11","text":"Fix bug impute_MinDet(MARGIN = 1) add unit test. Check package available namespace loaded adding stopifnot() calling requireNamespace().","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.5","title":"MsCoreUtils 1.11","text":"Add function maxi determine maximal intensity value. function returns NA_real_ instead -Inf values missing length input parameter 0.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.4","title":"MsCoreUtils 1.11","text":"Check parameter y increasingly ordered bin: issue #108.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-3","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.3","title":"MsCoreUtils 1.11","text":"Add function sumi sum intensity values correct NA handling.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-4","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.2","title":"MsCoreUtils 1.11","text":"Reimplement C (see issue #105). Use symbols call registered C methods faster lookup (see PR #106 Writing R extensions: Converting package use registration). Documentation improvement: explicitly mention impute_mle2() MLE imputation paragraph.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-5","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.1","title":"MsCoreUtils 1.11","text":"Add MARGIN argument (relevant) imputation functions support (make explicit) along dimensions (row columns) imputation performed. New impute_mle2() function uses norm2 (see issue #100).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-6","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.0","title":"MsCoreUtils 1.11","text":"New Bioconductor 3.17 (devel) release","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-10","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.10.0","title":"MsCoreUtils 1.10","text":"New Bioconductor 3.16 (stable) release","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-9","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.9.2","title":"MsCoreUtils 1.9","text":"feat: imputation compatible HDF5Matrix objects feat: normalization compatible HDF5Matrix objects feat: matrix aggregation compatible HDF5Matrix objects fix+feat: aggregate_by_matrix now correctly handles missing data implements ‘na.rm’ Fix rla/rowRla man page.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-9-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.9.1","title":"MsCoreUtils 1.9","text":"Random forest imputation (using missForest) now available (`method = “RF”)","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-9-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.9.0","title":"MsCoreUtils 1.9","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.5","title":"MsCoreUtils 1.7","text":"Function bin gains parameter returnMids choose whether bin mid-points returned result list.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.4","title":"MsCoreUtils 1.7","text":"Fix ppm always return positive value (issue #94).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.3","title":"MsCoreUtils 1.7","text":"Add citation.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-3","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.2","title":"MsCoreUtils 1.7","text":"Use Matrix::colSums() default handle sparce ‘Matrix’ ‘matrix’ adjacency matrices.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-4","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.1","title":"MsCoreUtils 1.7","text":"New aggregate_by_matrix() uses adjacency matrix aggregate quantitative features. Set colnames outputs aggregate_by_matrix() aggregate_by_vector() make sure always set reply underlying function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-5","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.0","title":"MsCoreUtils 1.7","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-5","dir":"Changelog","previous_headings":"","what":"Changes in 1.5.1","title":"MsCoreUtils 1.5","text":"Add .first .last.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-5-1","dir":"Changelog","previous_headings":"","what":"Changes in 1.5.0","title":"MsCoreUtils 1.5","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-3","dir":"Changelog","previous_headings":"","what":"Changes in 1.3.3","title":"MsCoreUtils 1.3","text":"Add join_gnps gnps allow calculation GNPS spectra similarity scores.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-3-1","dir":"Changelog","previous_headings":"","what":"Changes in 1.3.2","title":"MsCoreUtils 1.3","text":"Add rt2numeric(), rt2character() formatRt(). New impute_fun() function user-provide imputation function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-3-2","dir":"Changelog","previous_headings":"","what":"Changes in 1.3.1","title":"MsCoreUtils 1.3","text":"Add Josep Badia Aparicio contributor","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-3-3","dir":"Changelog","previous_headings":"","what":"Changes in 1.3.0","title":"MsCoreUtils 1.3","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.7","title":"MsCoreUtils 1.1","text":"Rewrite c(\"left\", \"right\", \"inner\", \"outer\") join C <2020-10-06 Tue>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-1","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.6","title":"MsCoreUtils 1.1","text":"Rewrite closest C <2020-09-24 Thu>. Fix #65 #66.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-2","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.5","title":"MsCoreUtils 1.1","text":"Add ... functions join compare peaks; see also #131.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-3","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.4","title":"MsCoreUtils 1.1","text":"Change references Feature QFeatures <2020-07-14 Tue> Ensure closest accept just argument tolerance length 1 length(x); see also #61, PR #62 <2020-08-07 Thu>. tolerance argument closest now length 1 length(x) (length(table) ) <2020-08-20 Thu>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-4","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.3","title":"MsCoreUtils 1.1","text":"empty table closest common return vector length x NA FALSE, respectively (instead 1 TRUE). Fixes #55 <2020-06-18 Thu>. closest common ignore NA table <2020-06-19 Fri>. Fix rbindFill single data.frame DataFrame input <2020-06-23 Tue>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-5","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.2","title":"MsCoreUtils 1.1","text":"New colCounts() aggregation function <2020-05-27 Wed>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-6","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.1","title":"MsCoreUtils 1.1","text":"Add popular distance/similarity metrices: ndotproduct neuclidean navdist nspectraangle; see also PR #33. Add deprecation note dotproduct <2020-05-22 Fri>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-7","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.0","title":"MsCoreUtils 1.1","text":"Bioconductor devel version (Bioc 3.12)","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-0","dir":"Changelog","previous_headings":"","what":"Changes in 1.0.0.","title":"MsCoreUtils 1.0","text":"Bioconductor release version (Bioc 3.11)","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-0-99","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 0.99.3","title":"MsCoreUtils 0.99","text":"Trigger build.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-0-99-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 0.99.2","title":"MsCoreUtils 0.99","text":"Provide comprehensive description. Add vignette.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-0-99-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 0.99.1","title":"MsCoreUtils 0.99","text":"Additional functions, using Author@R specify (unique) RforMassSpectrometry Package Maintainer.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-0-99-3","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 0.99.0","title":"MsCoreUtils 0.99","text":"First release MsCoreUtils core function get extreme values, grouping/matching, noise/smoothing, similarity measurements, various helper function, function process (impute normalise) quantitative features.","code":""}] +[{"path":"https://rformassspectrometry.github.io/MsCoreUtils/articles/MsCoreUtils.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Core Utils for Mass Spectrometry Data","text":"MsCoreUtils package low-level functions mass spectrometry data independent high-level data structures [@rainer_modular_2022]. functions include mass spectra processing functions (noise estimation, smoothing, binning), quantitative aggregation functions (median polish, robust summarisation, …), missing data imputation, data normalisation (quantiles, vsn, …) well misc helper functions, used across high level data structure within R Mass Spectrometry packages. full list function, see reference page package webpage.","code":"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] \"entropy\" \"estimateBaseline\" ## [17] \"estimateBaselineConvexHull\" \"estimateBaselineMedian\" ## [19] \"estimateBaselineSnip\" \"estimateBaselineTopHat\" ## [21] \"formatRt\" \"getImputeMargin\" ## [23] \"gnps\" \"group\" ## [25] \"i2index\" \"impute_bpca\" ## [27] \"impute_fun\" \"impute_knn\" ## [29] \"impute_matrix\" \"impute_min\" ## [31] \"impute_MinDet\" \"impute_MinProb\" ## [33] \"impute_mixed\" \"impute_mle\" ## [35] \"impute_neighbour_average\" \"impute_QRILC\" ## [37] \"impute_RF\" \"impute_with\" ## [39] \"impute_zero\" \"imputeMethods\" ## [41] \"isPeaksMatrix\" \"join\" ## [43] \"join_gnps\" \"localMaxima\" ## [45] \"maxi\" \"medianPolish\" ## [47] \"navdist\" \"ndotproduct\" ## [49] \"nentropy\" \"neuclidean\" ## [51] \"noise\" \"normalize_matrix\" ## [53] \"normalizeMethods\" \"nspectraangle\" ## [55] \"ppm\" \"rbindFill\" ## [57] \"refineCentroids\" \"rla\" ## [59] \"robustSummary\" \"rowRla\" ## [61] \"rt2character\" \"rt2numeric\" ## [63] \"smooth\" \"sumi\" ## [65] \"validPeaksMatrix\" \"valleys\" ## [67] \"vapply1c\" \"vapply1d\" ## [69] \"vapply1l\" \"which.first\" ## [71] \"which.last\""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/articles/MsCoreUtils.html","id":"examples","dir":"Articles","previous_headings":"","what":"Examples","title":"Core Utils for Mass Spectrometry Data","text":"functions defined package utilise basic classes aim reused packages provide formal, high-level interface. examples, let’s take robustSummary() function, calculates robust summary columns matrix: function typicall used summarise peptide quantitation values protein intensities1. functionality available MSnbase::combineFeatures() function MSnSet objects QFeatures::aggregateFeatures() function QFeatures objects.","code":"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.7786362 0.9855785 0.5897485 0.3732384 1.663485 -1.5751422 1.339675 ## B 1.4115361 -0.2538868 -0.1390220 0.3026787 -1.897538 -0.4812638 -1.017238 ## C 0.7171656 0.4444280 -1.9245409 1.1007164 1.106173 -0.9821474 -1.544728 ## h i j ## A 0.2568210 -0.5381242 -0.1942551 ## B -0.1092041 0.3106737 1.3392343 ## C -1.6788085 -0.3711854 0.2933841 robustSummary(x) ## a b c d e f g ## 0.9691126 0.3920399 -0.3547146 0.5922112 1.0063147 -1.0128511 -0.7501852 ## h i j ## -0.5063034 -0.1995453 0.4915649"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/articles/MsCoreUtils.html","id":"contributions","dir":"Articles","previous_headings":"","what":"Contributions","title":"Core Utils for Mass Spectrometry Data","text":"like contribute low-level functionality, please open GitHub issue discuss . Please note contributions follow style guide require appropriate unit test. wish reuse functions package, please just go ahead. like advice seek help, please either open GitHub issue.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/articles/MsCoreUtils.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Core Utils for Mass Spectrometry Data","text":"","code":"## R Under development (unstable) (2024-01-17 r85813) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 22.04.3 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [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: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] MsCoreUtils_1.15.2 BiocStyle_2.31.0 ## ## loaded via a namespace (and not attached): ## [1] vctrs_0.6.5 cli_3.6.2 knitr_1.45 ## [4] rlang_1.1.3 xfun_0.41 stringi_1.8.3 ## [7] purrr_1.0.2 textshaping_0.3.7 clue_0.3-65 ## [10] jsonlite_1.8.8 glue_1.7.0 S4Vectors_0.41.3 ## [13] htmltools_0.5.7 stats4_4.4.0 ragg_1.2.7 ## [16] sass_0.4.8 rmarkdown_2.25 evaluate_0.23 ## [19] jquerylib_0.1.4 MASS_7.3-60.2 fastmap_1.1.1 ## [22] yaml_2.3.8 lifecycle_1.0.4 memoise_2.0.1 ## [25] bookdown_0.37 BiocManager_1.30.22 stringr_1.5.1 ## [28] cluster_2.1.6 compiler_4.4.0 fs_1.6.3 ## [31] systemfonts_1.0.5 digest_0.6.34 R6_2.5.1 ## [34] magrittr_2.0.3 bslib_0.6.1 tools_4.4.0 ## [37] BiocGenerics_0.49.1 pkgdown_2.0.7 cachem_1.0.8 ## [40] desc_1.4.3"},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"RforMassSpectrometry Package Maintainer. Maintainer. Laurent Gatto. Author. Johannes Rainer. Author. Sebastian Gibb. Author. Adriaan Sticker. Contributor. Sigurdur Smarason. Contributor. Thomas Naake. Contributor. Josep Maria Badia Aparicio. Contributor. Michael Witting. Contributor. Samuel Wieczorek. Contributor. Roger Gine Bertomeu. Contributor. Mar Garcia-Aloy. Contributor.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rainer J, Vicini , Salzer L, Stanstrup J, Badia JM, Neumann S, Stravs MA, Verri Hernandes V, Gatto L, Gibb S Wittin M. Modular Expandable Ecosystem Metabolomics Data Annotation R Metabolites 2022, 12, 173. https://doi.org/10.3390/metabo12020173","code":"@Article{, title = {A Modular and Expandable Ecosystem for Metabolomics Data Annotation in R}, author = {Johannes Rainer and Andrea Vicini and Liesa Salzer and Jan Stanstrup and Josep M. Badia and Steffen Neumann and Michael A. Stravs and Vinicius {Verri Hernandes} and Laurent Gatto and Sebastian Gibb and Michael Witting}, journal = {Metabolites}, year = {2022}, doi = {10.3390/metabo12020173}, url = {https://www.mdpi.com/2218-1989/12/2/173}, volume = {12}, pages = {173}, }"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/index.html","id":"low-level-functions-for-ms-data","dir":"","previous_headings":"","what":"Core Utils for Mass Spectrometry Data","title":"Core Utils for Mass Spectrometry Data","text":"MsCoreUtils defines low-level functions mass spectrometry data independent high-level data structures. functions include mass spectra processing functions (noise estimation, smoothing, binning, baseline estimation), quantitative aggregation functions (median polish, robust summarisation, …), missing data imputation, data normalisation (quantiles, vsn, …) well misc helper functions, used across high-level data structure within R Mass Spectrometry packages. See package homepage information.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Core Utils for Mass Spectrometry Data","text":"package can installed ","code":"install.packages(\"BiocManager\") BiocManager::install(\"MsCoreUtils\")"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/index.html","id":"contributions","dir":"","previous_headings":"","what":"Contributions","title":"Core Utils for Mass Spectrometry Data","text":"Contributions highly welcome follow contribution guidelines. Also, please check coding style guidelines RforMassSpectrometry vignette.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/index.html","id":"previous-external-contributions","dir":"","previous_headings":"","what":"Previous external contributions","title":"Core Utils for Mass Spectrometry Data","text":"Sigurdur Smarason (@SiggiSmara): weighted moving average (https://github.com/sgibb/MALDIquant/pull/54) Thomas Naake (@tnaake): dotproduct calculation (https://github.com/rformassspectrometry/MsCoreUtils/pull/17) Adriaan Sticker: robustSummary aggregation function (originally contributed MSnbase)","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":null,"dir":"Reference","previous_headings":"","what":"Aggreagate quantitative features — aggregate","title":"Aggreagate quantitative features — aggregate","text":"functions take matrix quantitative features x aggregate features (rows) according either vector (factor) INDEX adjacency matrix MAT. aggregation method defined function FUN. Adjacency matrices elegant way explicitly encode shared peptides (see example ) aggregation.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Aggreagate quantitative features — aggregate","text":"","code":"colMeansMat(x, MAT, na.rm = FALSE) colSumsMat(x, MAT, na.rm = FALSE) aggregate_by_matrix(x, MAT, FUN, ...) aggregate_by_vector(x, INDEX, FUN, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Aggreagate quantitative features — aggregate","text":"x matrix mode numeric HDF5Matrix object type numeric. MAT adjacency matrix defines peptide-protein relations nrow(MAT) == nrow(x): non-missing/non-null value position (,j) indicates peptide belong protein j. matrix tyically binary can also contain weighted relations. na.rm logical(1) indicating whether missing values (including NaN) omitted calculations . Defaults FALSE. FUN function applied subsets x. ... Additional arguments passed FUN. INDEX vector factor length nrow(x).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Aggreagate quantitative features — aggregate","text":"aggregate_by_matrix() returns matrix (Matrix) dimensions ncol(MAT) ncol(x), dimnamesequal tocolnames(x)andrownames(MAT)`. aggregate_by_vector() returns new matrix (x matrix) HDF5Matrix (x HDF5Matrix) dimensions length(INDEX) ncol(x), dimnames equal tocolnames(x)andINDEX`.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"vector-based-aggregation-functions","dir":"Reference","previous_headings":"","what":"Vector-based aggregation functions","title":"Aggreagate quantitative features — aggregate","text":"aggregating vector/factor, user-defined functions must return vector length equal ncol(x) level INDEX. Examples thereof : medianPolish() fits additive model (two way decomposition) using Tukey's median polish procedure using stats::medpolish(); robustSummary() calculate robust aggregation using MASS::rlm(); base::colMeans() use mean column; base::colSums() use sum column; matrixStats::colMedians() use median column.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"matrix-based-aggregation-functions","dir":"Reference","previous_headings":"","what":"Matrix-based aggregation functions","title":"Aggreagate quantitative features — aggregate","text":"aggregating adjacency matrix, user-defined functions must return new matrix. Examples thereof : colSumsMat(x, MAT) aggregates summing peptide intensities protein. Shared peptides re-used multiple times. colMeansMat(x, MAT) aggregation calculating mean peptide intensities. Shared peptides re-used multiple times.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"handling-missing-values","dir":"Reference","previous_headings":"","what":"Handling missing values","title":"Aggreagate quantitative features — aggregate","text":"default, missing values quantitative data propagate aggregated data. can provide na.rm = TRUE functions listed ignore missing values, except robustSummary() supply na.action = na.omit (see ?MASS::rlm).","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Aggreagate quantitative features — aggregate","text":"Laurent Gatto Samuel Wieczorek (aggregation adjacency matrix).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/aggregate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Aggreagate quantitative features — aggregate","text":"","code":"x <- matrix(c(10.39, 17.16, 14.10, 12.85, 10.63, 7.52, 3.91, 11.13, 16.53, 14.17, 11.94, 11.51, 7.69, 3.97, 11.93, 15.37, 14.24, 11.21, 12.29, 9.00, 3.83, 12.90, 14.37, 14.16, 10.12, 13.33, 9.75, 3.81), nrow = 7, dimnames = list(paste0(\"Pep\", 1:7), paste0(\"Sample\", 1:4))) x #> Sample1 Sample2 Sample3 Sample4 #> Pep1 10.39 11.13 11.93 12.90 #> Pep2 17.16 16.53 15.37 14.37 #> Pep3 14.10 14.17 14.24 14.16 #> Pep4 12.85 11.94 11.21 10.12 #> Pep5 10.63 11.51 12.29 13.33 #> Pep6 7.52 7.69 9.00 9.75 #> Pep7 3.91 3.97 3.83 3.81 ## ------------------------- ## Aggregation by vector ## ------------------------- (k <- paste0(\"Prot\", c(\"B\", \"E\", \"X\", \"E\", \"B\", \"B\", \"E\"))) #> [1] \"ProtB\" \"ProtE\" \"ProtX\" \"ProtE\" \"ProtB\" \"ProtB\" \"ProtE\" aggregate_by_vector(x, k, colMeans) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 9.513333 10.11000 11.07333 11.993333 #> ProtE 11.306667 10.81333 10.13667 9.433333 #> ProtX 14.100000 14.17000 14.24000 14.160000 aggregate_by_vector(x, k, robustSummary) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 9.513333 10.15800 11.07333 11.99333 #> ProtE 11.451493 10.81333 10.13667 9.22360 #> ProtX 14.100000 14.17000 14.24000 14.16000 aggregate_by_vector(x, k, medianPolish) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 10.39 11.13 11.93 12.90 #> ProtE 12.85 11.94 11.21 10.12 #> ProtX 14.10 14.17 14.24 14.16 ## ------------------------- ## Aggregation by matrix ## ------------------------- adj <- matrix(c(1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1), nrow = 7, dimnames = list(paste0(\"Pep\", 1:7), paste0(\"Prot\", c(\"B\", \"E\", \"X\")))) adj #> ProtB ProtE ProtX #> Pep1 1 0 0 #> Pep2 0 1 0 #> Pep3 0 0 1 #> Pep4 1 1 0 #> Pep5 1 0 0 #> Pep6 1 0 0 #> Pep7 0 1 1 ## Peptide 4 is shared by 2 proteins (has a rowSums of 2), ## namely proteins B and E rowSums(adj) #> Pep1 Pep2 Pep3 Pep4 Pep5 Pep6 Pep7 #> 1 1 1 2 1 1 2 aggregate_by_matrix(x, adj, colSumsMat) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 41.39 42.27 44.43 46.10 #> ProtE 33.92 32.44 30.41 28.30 #> ProtX 18.01 18.14 18.07 17.97 aggregate_by_matrix(x, adj, colMeansMat) #> Sample1 Sample2 Sample3 Sample4 #> ProtB 10.34750 10.56750 11.10750 11.525000 #> ProtE 11.30667 10.81333 10.13667 9.433333 #> ProtX 9.00500 9.07000 9.03500 8.985000 ## --------------- ## Missing values ## --------------- x <- matrix(c(NA, 2:6), ncol = 2, dimnames = list(paste0(\"Pep\", 1:3), c(\"S1\", \"S2\"))) x #> S1 S2 #> Pep1 NA 4 #> Pep2 2 5 #> Pep3 3 6 ## simply use na.rm = TRUE to ignore missing values ## during the aggregation (k <- LETTERS[c(1, 1, 2)]) #> [1] \"A\" \"A\" \"B\" aggregate_by_vector(x, k, colSums) #> S1 S2 #> A NA 9 #> B 3 6 aggregate_by_vector(x, k, colSums, na.rm = TRUE) #> S1 S2 #> A 2 9 #> B 3 6 (adj <- matrix(c(1, 1, 0, 0, 0, 1), ncol = 2, dimnames = list(paste0(\"Pep\", 1:3), c(\"A\", \"B\")))) #> A B #> Pep1 1 0 #> Pep2 1 0 #> Pep3 0 1 aggregate_by_matrix(x, adj, colSumsMat, na.rm = FALSE) #> S1 S2 #> A NA 9 #> B 3 6 aggregate_by_matrix(x, adj, colSumsMat, na.rm = TRUE) #> S1 S2 #> A 2 9 #> B 3 6"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":null,"dir":"Reference","previous_headings":"","what":"Binning — bin","title":"Binning — bin","text":"Aggregate values x bins defined y: values x values y falling bin (defined y) aggregated provided function FUN.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Binning — bin","text":"","code":"bin( x, y, size = 1, breaks = seq(floor(min(y)), ceiling(max(y)), by = size), FUN = max, returnMids = TRUE, .check = TRUE )"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Binning — bin","text":"x numeric values aggregated/binned. y numeric length x values used binning. y must increasingly sorted, else error thrown. size numeric(1) size bin. breaks numeric defining breaks (bins). FUN function used aggregate values x falling bins defined breaks. FUN expected return numeric(1). returnMids logical(1) whether midpoints breaks returned addition binned (aggregated) values x. Setting returnMids = FALSE might useful breaks defined hand binning needs performed large set values (.e. within loop multiple pairs x y values). .check logical(1) whether check y ordered vector. Setting .check = FALSE improve performance, provided sure y always ordered.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Binning — bin","text":"Depending value returnMids: returnMids = TRUE (default): returns list elements x (aggregated values x) mids (bin mid points). returnMids = FALSE: returns numeric just binned values x.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Binning — bin","text":"Johannes Rainer, Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/binning.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Binning — bin","text":"","code":"## Define example intensities and m/z values ints <- abs(rnorm(20, mean = 40)) mz <- seq(1:length(ints)) + rnorm(length(ints), sd = 0.001) ## Bin intensities by m/z bins with a bin size of 2 bin(ints, mz, size = 2) #> $x #> [1] 40.25532 39.99443 41.14841 39.75580 39.71729 40.62898 42.06502 40.51243 #> [9] 40.54300 39.08593 #> #> $mids #> [1] 2 4 6 8 10 12 14 16 18 20 #> ## Repeat but summing up intensities instead of taking the max bin(ints, mz, size = 2, FUN = sum) #> $x #> [1] 116.41801 39.99443 119.94815 79.50848 39.71729 80.07528 80.43404 #> [8] 118.12740 80.49039 39.08593 #> #> $mids #> [1] 2 4 6 8 10 12 14 16 18 20 #> ## Get only the binned values without the bin mid points. bin(ints, mz, size = 2, returnMids = FALSE) #> [1] 40.25532 39.99443 41.14841 39.75580 39.71729 40.62898 42.06502 40.51243 #> [9] 40.54300 39.08593"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":null,"dir":"Reference","previous_headings":"","what":"Check functions — isPeaksMatrix","title":"Check functions — isPeaksMatrix","text":"functions used check input arguments.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check functions — isPeaksMatrix","text":"","code":"isPeaksMatrix(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check functions — isPeaksMatrix","text":"x object test.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check functions — isPeaksMatrix","text":"logical(1), TRUE checks successful otherwise FALSE.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check functions — isPeaksMatrix","text":"isPeaksMatrix: test numeric matrix two columns named \"mz\" \"intensity\". \"mz\" column sorted increasingly.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Check functions — isPeaksMatrix","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/check.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check functions — isPeaksMatrix","text":"","code":"isPeaksMatrix(1:2) #> [1] FALSE isPeaksMatrix(cbind(mz = 2:1, intensity = 1:2)) #> [1] FALSE isPeaksMatrix(cbind(mz = 1:2, intensity = 1:2)) #> [1] TRUE"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce functions — coerce","title":"Coerce functions — coerce","text":"asInteger: convert x integer throw error x numeric.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce functions — coerce","text":"","code":"asInteger(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce functions — coerce","text":"x input argument.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Coerce functions — coerce","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/coerce.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce functions — coerce","text":"","code":"## Convert numeric to integer asInteger(3.4) #> [1] 3 asInteger(3) #> [1] 3"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":null,"dir":"Reference","previous_headings":"","what":"Counts the number of features — colCounts","title":"Counts the number of features — colCounts","text":"Returns number non-NA features features sample matrix.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Counts the number of features — colCounts","text":"","code":"colCounts(x, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Counts the number of features — colCounts","text":"x matrix mode numeric. ... Currently ignored.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Counts the number of features — colCounts","text":"numeric vector length identical ncol(x).","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Counts the number of features — colCounts","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/colCounts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Counts the number of features — colCounts","text":"","code":"m <- matrix(c(1, NA, 2, 3, NA, NA, 4, 5, 6), nrow = 3) colCounts(m) #> [1] 2 1 3 m <- matrix(rnorm(30), nrow = 3) colCounts(m) #> [1] 3 3 3 3 3 3 3 3 3 3"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":null,"dir":"Reference","previous_headings":"","what":"Spectra Distance/Similarity Measurements — distance","title":"Spectra Distance/Similarity Measurements — distance","text":"functions provide different normalized similariy/distance measurements.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spectra Distance/Similarity Measurements — distance","text":"","code":"ndotproduct(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...) dotproduct(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...) neuclidean(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...) navdist(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...) nspectraangle(x, y, m = 0L, n = 0.5, na.rm = TRUE, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spectra Distance/Similarity Measurements — distance","text":"x matrix, two-columns e.g. m/z, intensity y matrix, two-columns e.g. m/z, intensity m numeric, weighting first column x y (e.g. \"mz\"), default: 0 means weight first column. details see ndotproduct details section. n numeric, weighting second column x y (e.g. \"intensity\"), default: 0.5 means effectly using sqrt(x[,2]) sqrt(y[,2]). details see ndotproduct details section. na.rm logical(1), NA removed prior calculation (default TRUE). ... ignored.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spectra Distance/Similarity Measurements — distance","text":"double(1) value 0:1, 0 completely different 1 identically.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Spectra Distance/Similarity Measurements — distance","text":"functions calculate normalized similarity/distance measurements prefixed n. ndotproduct: normalized dot product described Stein Scott 1994 : \\(NDP = \\frac{\\sum(W_1 W_2)^2}{\\sum(W_1)^2 \\sum(W_2)^2}\\); \\(W_i = x^m * y^n\\), \\(x\\) \\(y\\) m/z intensity values, respectively. Please note also \\(NDP = NCos^2\\); NCos cosine value (.e. orthodox normalized dot product) intensity vectors described Yilmaz et al. 2017. Stein Scott 1994 empirically determined optimal exponents m = 3 n = 0.6 analyzing ca. 12000 EI-MS data 8000 organic compounds NIST Mass Spectral Library. MassBank (Horai et al. 2010) uses m = 2 n = 0.5 small compounds. general increasing values m, high m/z values taken account similarity calculation. Especially working small molecules, value n > 0 can set give weight m/z values accommodate shared fragments higher m/z less likely mean molecules might similar. Increasing n result higher importance intensity values. commonly m = 0 n = 0.5 used. neuclidean: normalized euclidean distance described Stein Scott 1994 : \\(NED = (1 + \\frac{\\sum((W_1 - W_2)^2)}{sum((W_2)^2)})^{-1}\\); \\(W_i = x^m * y^n\\), \\(x\\) \\(y\\) m/z intensity values, respectively. See details section ndotproduct explanation set m n. navdist: normalized absolute values distance described Stein Scott 1994 : \\(NED = (1 + \\frac{\\sum(|W_1 - W_2|)}{sum((W_2))})^{-1}\\); \\(W_i = x^m * y^n\\), \\(x\\) \\(y\\) m/z intensity values, respectively. See details section ndotproduct explanation set m n. nspectraangle: normalized spectra angle described Toprak et al 2014 : \\(NSA = 1 - \\frac{2*\\cos^{-1}(W_1 \\cdot W_2)}{\\pi}\\); \\(W_i = x^m * y^n\\), \\(x\\) \\(y\\) m/z intensity values, respectively. weighting originally proposed Toprak et al. 2014. See details section ndotproduct explanation set m n.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Spectra Distance/Similarity Measurements — distance","text":"methods implemented described Stein Scott 1994 (navdist, ndotproduct, neuclidean) Toprak et al. 2014 (nspectraangle) reference implementation available unable guarantee results identical. Note Stein Scott 1994 normalized dot product method (extension ndotproduct) corresponds square orthodox normalized dot product (cosine distance) used also commonly spectrum similarity measure (Yilmaz et al. 2017). Please see also corresponding discussion github pull request linked . find problems reference implementation please open issue https://github.com/rformassspectrometry/MsCoreUtils/issues.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Spectra Distance/Similarity Measurements — distance","text":"Stein, S. E., Scott, D. R. (1994). Optimization testing mass spectral library search algorithms compound identification. Journal American Society Mass Spectrometry, 5(9), 859--866. doi:10.1016/1044-0305(94)87009-8 . Yilmaz, S., Vandermarliere, E., Lennart Martens (2017). Methods Calculate Spectrum Similarity. S. Keerthikumar S. Mathivanan (eds.), Proteome Bioinformatics: Methods Molecular Biology, vol. 1549 (pp. 81). doi:10.1007/978-1-4939-6740-7_7 . Horai et al. (2010). MassBank: public repository sharing mass spectral data life sciences. Journal mass spectrometry, 45(7), 703--714. doi:10.1002/jms.1777 . Toprak et al. (2014). Conserved peptide fragmentation benchmarking tool mass spectrometers discriminating feature targeted proteomics. Molecular & Cellular Proteomics : MCP, 13(8), 2056--2071. doi:10.1074/mcp.O113.036475 . Pull Request distance/similarity measurements: https://github.com/rformassspectrometry/MsCoreUtils/pull/33","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Spectra Distance/Similarity Measurements — distance","text":"navdist, neuclidean, nspectraangle: Sebastian Gibb ndotproduct: Sebastian Gibb Thomas Naake, thomasnaake@googlemail.com","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/distance.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spectra Distance/Similarity Measurements — distance","text":"","code":"x <- matrix(c(1:5, 1:5), ncol = 2, dimnames = list(c(), c(\"mz\", \"intensity\"))) y <- matrix(c(1:5, 5:1), ncol = 2, dimnames = list(c(), c(\"mz\", \"intensity\"))) ndotproduct(x, y) #> [1] 0.7660906 ndotproduct(x, y, m = 2, n = 0.5) #> [1] 0.9074293 ndotproduct(x, y, m = 3, n = 0.6) #> [1] 0.9127553 neuclidean(x, y) #> [1] 0.8003406 navdist(x, y) #> [1] 0.6970151 nspectraangle(x, y) #> [1] 0.5556013"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":null,"dir":"Reference","previous_headings":"","what":"Spectral entropy — entropy","title":"Spectral entropy — entropy","text":"functions allow calculate entropy measurements MS/MS spectrum based metrics suggested Li et al. (https://doi.org/10.1038/s41592-021-01331-z). Spectral entropy normalized entropy used measure complexity spectra. MassBank North America (MoNA) defines spectra entropy intensity weighted spectral peak number (https://mona.fiehnlab.ucdavis.edu/documentation/entropy). Additionally suggested consider spectra normalized entropy larger 0.8, spectral entropy larger 3 low-quality spectra.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spectral entropy — entropy","text":"","code":"entropy(x) nentropy(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spectral entropy — entropy","text":"x numeric, intensities fragment ions.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spectral entropy — entropy","text":"numeric: (normalized) entropy x.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Spectral entropy — entropy","text":"Mar Garcia-Aloy","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/entropy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spectral entropy — entropy","text":"","code":"spectrum <- rbind(c(41.04, 37.16), c(69.07, 66.83), c(86.1, 999.0)) entropy(spectrum[,2]) #> [1] 0.3737888 nentropy(spectrum[,2]) #> [1] 0.3402372"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"function estimates baseline mass spectrometry data, represented numeric vectors masses intensities identical lengths.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"","code":"estimateBaseline( x, y, method = c(\"SNIP\", \"TopHat\", \"ConvexHull\", \"median\"), ... ) estimateBaselineConvexHull(x, y) estimateBaselineMedian(x, y, halfWindowSize = 100L) estimateBaselineSnip(x, y, iterations = 100L, decreasing = TRUE) estimateBaselineTopHat(x, y, halfWindowSize = 100L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"x numeric() vector masses. y numeric() vector intensities. method character(1) specifying estimation method. One \"SNIP\" (default), \"TopHat\", \"ConvexHull\" \"median\". See details . ... Additional parameters passed respective functions. halfWindowSize integer() defining half window size. Default 100L. resulting window reaches x[cur_index - halfWindowSize] x[cur_index + halfWindowSize]. iterations integer() controling window size (k, similar halfWindowSize \"TopHat\", \"median\") algorithm. resulting window reaches x[cur_index - iterations] x[cur_index + iterations]. decreasing logical(1) whether cliping window decreasing, defined Morhac (2009). decreasing clipping window suggested get smoother baseline. TRUE (FALSE) k=iterations decreased (increased) one zero (iterations) reached. default setting decreasing = TRUE.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"numeric() estimated baseline intensities.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"SNIP: baseline estimation based Statistics-sensitive Non-linear Iterative Peak-clipping algorithm (SNIP) described Ryan et al 1988. algorithm based following equation: $$y_i(k) = \\min \\{ y_i, \\frac{(y_{-k}+y_{+k})}{2} \\}$$ two additional arguments namely integer iterations logical decreasing. TopHat: algorithm applies moving minimum (erosion filter) subsequently moving maximum (dilation filter) filter intensity values. implementation based van Herk (1996). additional halfWindowSize argument determining half size moving window TopHat filter. ConvexHull: baseline estimation based convex hull constructed spectrum. Median: baseline estimation uses moving median. based stats::runmed(). additional argument halfWindowSize corresponds k argument stats::runmed() (k = 2 * halfWindowSize + 1) controls half size moving window.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"functions ported MALDIqaunt package. SNIP: C.G. Ryan, E. Clayton, W.L. Griffin, S.H. Sie, D.R. Cousens (1988). Snip, statistics-sensitive background treatment quantitative analysis pixe spectra geoscience applications. Nuclear Instruments Methods Physics Research Section B: Beam Interactions Materials Atoms, 34(3): 396-402. M. Morhac (2009). algorithm determination peak regions baseline elimination spectroscopic data. Nuclear Instruments Methods Physics Research Section : Accelerators, Spectrometers, Detectors Associated Equipment, 600(2), 478-487. TopHat: M. van Herk (1992). Fast Algorithm Local Minimum Maximum Filters Rectangular Octagonal Kernels. Pattern Recognition Letters 13.7: 517-521. J. Y. Gil M. Werman (1996). Computing 2-Dimensional Min, Median Max Filters. IEEE Transactions: 504-507. ConvexHull: Andrew, . M. (1979). Another efficient algorithm convex hulls two dimensions. Information Processing Letters, 9(5), 216-219.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/estimateBaseline.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimates the Baseline of a Mass Spectrum — estimateBaseline","text":"","code":"## ---------------------------- ## Simulation example data nmz <- 5000 mz <- seq(1000, length.out = nmz) ## create peaks center <- seq(50, nmz, by = 500) peaks <- lapply(center, function(cc)1000 * dpois(0:100, (1000 + cc) / 75)) ## create baseline intensity <- 100 * exp(-seq_len(nmz)/2000) ## add peaks to baseline for (i in seq(along = center)) { intensity[center[i]:(center[i] + 100)] <- intensity[center[i]:(center[i] + 100)] + peaks[[i]] } ## add noise intensity <- intensity + rnorm(nmz, mean = 0, sd = 1) plot(mz, intensity, type = \"l\") ## ---------------------------- ## SNIP baseline base_SNIP <- estimateBaseline(mz, intensity, method = \"SNIP\", iterations = 20L) ## same as estimateBaselineSnip(mz, intensity, iterations = 20L) lines(mz, base_SNIP, col = \"red\") ## ---------------------------- ## TopHat baseline base_TH25 <- estimateBaseline(mz, intensity, method = \"TopHat\", halfWindowSize = 25L) ## same as estimateBaselineTopHat(mz, intenstity, halfWindowSize = 25L) lines(mz, base_TH25, col = \"blue\") base_TH15 <- estimateBaseline(mz, intensity, method = \"TopHat\", halfWindowSize = 15L) lines(mz, base_TH15, col = \"steelblue\") ## ---------------------------- ## Convex hull baseline base_CH <- estimateBaseline(mz, intensity, method = \"ConvexHull\") ## same as estimateBaselineConvexHull(mz, intensity) lines(mz, base_CH, col = \"green\") ## ---------------------------- ## Median baseline base_med <- estimateBaseline(mz, intensity, method = \"median\") ## same as estimateBaselineMedian(mz, intensity) lines(mz, base_med, col = \"orange\") legend(\"topright\", lwd = 1, legend = c(\"SNIP\", \"TopHat (hws = 25)\", \"TopHat (hws = 15)\", \"ConvexHull\", \"Median\"), col = c(\"red\", \"blue\", \"steelblue\", \"green\", \"orange\"))"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":null,"dir":"Reference","previous_headings":"","what":"Format Retention Time — rt2numeric","title":"Format Retention Time — rt2numeric","text":"vectorised functions convert retention times numeric seconds /character \"mm:ss\". rt2character() performs numeric character conversion rt2numeric() performs character numeric conversion. formatRt() one depending input type.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format Retention Time — rt2numeric","text":"","code":"rt2numeric(rt) rt2character(rt) formatRt(rt)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format Retention Time — rt2numeric","text":"rt vector retention times length > 1. Either numeric() seconds character() \"mm:ss\" depending function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format Retention Time — rt2numeric","text":"reformatted retention time.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Format Retention Time — rt2numeric","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/formatRt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Format Retention Time — rt2numeric","text":"","code":"## rt2numeric rt2numeric(\"25:24\") #> [1] 1524 rt2numeric(c(\"25:24\", \"25:25\", \"25:26\")) #> [1] 1524 1525 1526 ## rt2character rt2character(1524) #> [1] \"25:24\" rt2character(1) #> [1] \"0:01\" rt2character(1:10) #> [1] \"0:01\" \"0:02\" \"0:03\" \"0:04\" \"0:05\" \"0:06\" \"0:07\" \"0:08\" \"0:09\" \"0:10\" ## formatRt formatRt(1524) #> [1] \"25:24\" formatRt(1) #> [1] \"0:01\" formatRt(1:10) #> [1] \"0:01\" \"0:02\" \"0:03\" \"0:04\" \"0:05\" \"0:06\" \"0:07\" \"0:08\" \"0:09\" \"0:10\" formatRt(\"25:24\") #> [1] 1524 formatRt(c(\"25:24\", \"25:25\", \"25:26\")) #> [1] 1524 1525 1526"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":null,"dir":"Reference","previous_headings":"","what":"GNPS spectrum similarity scores — gnps","title":"GNPS spectrum similarity scores — gnps","text":"join_gnps gnps functions allow calculate spectra similarity scores used GNPS. approach matches first peaks two spectra directly using user-defined ppm /tolerance well using fixed delta m/z (considering ppm tolerance) defined difference two spectras' precursor m/z values. peaks match multiple peaks spectrum matching peak pair higher value/similarity considered final similarity score calculation. Note GNPS similarity scores calculated two functions used together. join_gnps: matches/maps peaks spectra approach GNPS: peaks considered matching ) difference m/z values smaller defined tolerance ppm (joinPeaks) b) difference m/z adjusted difference spectras' precursor smaller defined tolerance ppm. Based definition, peaks x can match two peaks y hence returned peak indices might duplicated. Note one xPrecursorMz yPrecursorMz NA , results join(). function returns list two integer vectors indices peaks matching peaks spectrum NA otherwise. gnps: calculates GNPS similarity score peak matrices' previously aligned (matched) join_gnps. multi-mapping peaks pair higher similarity considered final score calculation.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GNPS spectrum similarity scores — gnps","text":"","code":"gnps(x, y, ...) join_gnps( x, y, xPrecursorMz = NA_real_, yPrecursorMz = NA_real_, tolerance = 0, ppm = 0, type = \"outer\", ... )"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GNPS spectrum similarity scores — gnps","text":"x join_gnps: numeric m/z values spectrum. gnps: matrix two columns \"mz\" \"intensity\" containing peaks aligned peaks y (join_gnps). y join_gnps: numeric m/z values spectrum. gnps: matrix two columns \"mz\" \"intensity\" containing peaks aligned peaks x (join_gnps). ... join_gnps: optional parameters passed join() function. gnps: ignored. xPrecursorMz join_gnps: numeric(1) precursor m/z spectrum x. yPrecursorMz join_gnps: numeric(1) precursor m/z spectrum y. tolerance join_gnps: numeric(1) defining constant maximal accepted difference m/z values peaks two spectra matched/mapped. ppm join_gnps: numeric(1) defining relative, m/z-dependent, maximal accepted difference m/z values peaks two spectra matched/mapped. type join_gnps: character(1) specifying type join performed. See join() details options. Defaults type = \"outer\".","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GNPS spectrum similarity scores — gnps","text":"See function definition description section.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"GNPS spectrum similarity scores — gnps","text":"implementation gnps bases R code publication listed references.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"GNPS spectrum similarity scores — gnps","text":"Xing S, Hu Y, Yin Z, Liu M, Tang X, Fang M, Huan T. Retrieving Utilizing Hypothetical Neutral Losses Tandem Mass Spectra Spectral Similarity Analysis Unknown Metabolite Annotation. Anal Chem. 2020 Nov 3;92(21):14476-14483. doi:10.1021/acs.analchem.0c02521 .","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"GNPS spectrum similarity scores — gnps","text":"Johannes Rainer, Michael Witting, based code Xing et al. (2020).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/gnps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"GNPS spectrum similarity scores — gnps","text":"","code":"## Define spectra x <- cbind(mz = c(10, 36, 63, 91, 93), intensity = c(14, 15, 999, 650, 1)) y <- cbind(mz = c(10, 12, 50, 63, 105), intensity = c(35, 5, 16, 999, 450)) ## The precursor m/z pmz_x <- 91 pmz_y <- 105 ## Plain join identifies only 2 matching peaks join(x[, 1], y[, 1]) #> $x #> [1] 1 NA 2 NA 3 4 5 NA #> #> $y #> [1] 1 2 NA 3 4 NA NA 5 #> ## join_gnps finds 4 matches join_gnps(x[, 1], y[, 1], pmz_x, pmz_y) #> $x #> [1] 1 2 2 3 4 4 5 NA NA NA #> #> $y #> [1] 1 NA 3 4 NA 5 NA 2 3 5 #> ## with one of the two precursor m/z being NA, the result are the same as ## with join. join_gnps(x[, 1], y[, 1], pmz_x, yPrecursorMz = NA) #> $x #> [1] 1 NA 2 NA 3 4 5 NA #> #> $y #> [1] 1 2 NA 3 4 NA NA 5 #> ## Calculate GNPS similarity score: map <- join_gnps(x[, 1], y[, 1], pmz_x, pmz_y) gnps(x[map[[1]], ], y[map[[2]], ]) #> [1] 0.9923501"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":null,"dir":"Reference","previous_headings":"","what":"Grouping of numeric values by similarity — group","title":"Grouping of numeric values by similarity — group","text":"group function groups numeric values first ordering putting values group difference smaller defined parameters tolerance (constant value) ppm (value-specific relative value expressed parts-per-million).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Grouping of numeric values by similarity — group","text":"","code":"group(x, tolerance = 0, ppm = 0)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Grouping of numeric values by similarity — group","text":"x increasingly ordered numeric values grouped. tolerance numeric(1) maximal accepted difference values x grouped entity. ppm numeric(1) defining value-dependent maximal accepted difference values x expressed parts-per-million.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Grouping of numeric values by similarity — group","text":"integer length equal x groups.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Grouping of numeric values by similarity — group","text":"Since grouping performed pairwise differences consecutive values (ordering x), difference smallest largest value group can larger tolerance ppm.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Grouping of numeric values by similarity — group","text":"Johannes Rainer, Sebastin Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/group.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Grouping of numeric values by similarity — group","text":"","code":"## Define a (sorted) numeric vector x <- c(34, 35, 35, 35 + ppm(35, 10), 56, 56.05, 56.1) ## With `ppm = 0` and `tolerance = 0` only identical values are grouped group(x) #> [1] 1 2 2 3 4 5 6 ## With `tolerance = 0.05` group(x, tolerance = 0.05) #> [1] 1 2 2 2 3 3 3 ## Also values 56, 56.05 and 56.1 were grouped into a single group, ## although the difference between the smallest 56 and largest value in ## this group (56.1) is 0.1. The (pairwise) difference between the ordered ## values is however 0.05. ## With ppm group(x, ppm = 10) #> [1] 1 2 2 2 3 4 5 ## Same on an unsorted vector x <- c(65, 34, 65.1, 35, 66, 65.2) group(x, tolerance = 0.1) #> [1] 3 1 3 2 4 3 ## Values 65, 65.1 and 65.2 have been grouped into the same group."},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":null,"dir":"Reference","previous_headings":"","what":"Input parameter check for subsetting operations — i2index","title":"Input parameter check for subsetting operations — i2index","text":"i2index simple helper function used subsetting functions. checks converts parameter , can type integer, logical character integer vector can used index subsetting.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Input parameter check for subsetting operations — i2index","text":"","code":"i2index(i, length = length(i), names = NULL)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Input parameter check for subsetting operations — i2index","text":"character logical integer used [] subsetting. length integer representing length object subsetted. names character names (rownames similar) object. required type character.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Input parameter check for subsetting operations — i2index","text":"integer indices","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Input parameter check for subsetting operations — i2index","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/i2index.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Input parameter check for subsetting operations — i2index","text":"","code":"## With `i` being an `integer` i2index(c(4, 1, 3), length = 10) #> [1] 4 1 3 ## With `i` being a `logical` i2index(c(TRUE, FALSE, FALSE, TRUE, FALSE), length = 5) #> [1] 1 4 ## With `i` being a `character` i2index(c(\"b\", \"a\", \"d\"), length = 5, names = c(\"a\", \"b\", \"c\", \"d\", \"e\")) #> [1] 2 1 4"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":null,"dir":"Reference","previous_headings":"","what":"Quantitative mass spectrometry data imputation — impute_matrix","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"impute_matrix function performs data imputation matrix objects instance using variety methods (see ). Users proceed care imputing data take precautions assure imputation produces valid results, particular naive imputations replacing missing values 0.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"","code":"impute_matrix(x, method, FUN, ...) imputeMethods() impute_neighbour_average(x, k = min(x, na.rm = TRUE), MARGIN = 1L) impute_knn(x, MARGIN = 1L, ...) impute_mle(x, MARGIN = 2L, ...) impute_bpca(x, MARGIN = 1L, ...) impute_RF(x, MARGIN = 2L, ...) impute_mixed(x, randna, mar, mnar, MARGIN = 1L, ...) impute_min(x) impute_MinDet(x, q = 0.01, MARGIN = 2L) impute_MinProb(x, q = 0.01, sigma = 1, MARGIN = 2L) impute_QRILC(x, sigma = 1, MARGIN = 2L) impute_zero(x) impute_with(x, val) impute_fun(x, FUN, MARGIN = 1L, ...) getImputeMargin(fun)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"x matrix HDF5Matrix object imputed. method character(1) defining imputation method. See imputeMethods() available ones. FUN user-provided function takes matrix input returns imputed matrix identical dimensions. ... Additional parameters passed inner imputation function. k numeric(1) providing imputation value used first last samples contain NA. default use smallest value data. MARGIN integer(1) defining margin along apply imputation, 1L rows 2L columns. default value depend imputation method. Use getImputeMargin(fun) get default margin imputation function fun. function take margin argument, NA returned. randna logical length equal nrow(object) defining rows missing random. ones considered missing random. relevant methods mixed. mar Imputation method values missing random. See method . mnar Imputation method values missing random. See method . q numeric(1) indicating quantile used estimate minimum MinDet MinProb. Default 0.01. sigma numeric(1) controling standard deviation MNAR distribution MinProb QRILC. Default 1. val numeric(1) used replace missing values. fun imputation function get default margin .","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"matrix class x dimensions dim(x).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"types-of-missing-values","dir":"Reference","previous_headings":"","what":"Types of missing values","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"two types mechanisms resulting missing values LC/MSMS experiments. Missing values resulting absence detection feature, despite ions present detectable concentrations. example case ion suppression result stochastic, data-dependent nature DDA MS acquisition method. missing value expected randomly distributed data defined, statistical terms, missing random (MAR) missing completely random (MCAR). Biologically relevant missing values resulting absence low abundance ions (.e. limit detection instrument). missing values expected randomly distributed data defined missing random (MNAR). MNAR features ideally imputed left-censor method, QRILC . Conversely, recommended use hot deck methods nearest neighbours, Bayesian missing value imputation maximum likelihood methods values missing random.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"imputing-by-rows-or-columns","dir":"Reference","previous_headings":"","what":"Imputing by rows or columns","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"assume input matrix x contains features along rows samples along columns, generally case omics data analysis. performing imputation, missing values taken feature-specific property: feature x missing absent (sample group), missed acquisition (selected data dependent acquisition) data processing (identified identification score chosen false discovery threshold). , imputation default performed feature level. cases, imputation zero global minimum value, matter. cases, matter much, example using minimum value computed margin (.e. row column) MinDet method (see ) - want use minimum sample feature? KNN another example: consider similar features impute feature missing values, similar samples impute missing sample. MARGIN argument can used change imputation margin features/rows (MARGIN = 1) samples/columns (MARGIN = 2). Different imputations different default values, changing parameter can major impact imputation results downstream results.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"imputation-methods","dir":"Reference","previous_headings":"","what":"Imputation methods","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"Currently, following imputation methods available. MLE: Maximum likelihood-based imputation method using EM algorithm. impute_mle() function relies norm::imp.norm(). function. See norm::imp.norm() details additional parameters. Note , ... passed norm::em.norm() function, rather actual imputation function imp.norm. bpca: Bayesian missing value imputation available, implemented pcaMethods::pca() function. See pcaMethods::pca() details additional parameters. RF: Random Forest imputation, implemented missForest::missForest function. See missForest::missForest()] details additional parameters. knn: Nearest neighbour averaging, implemented impute::impute.knn function. See impute::impute.knn()] details additional parameters. QRILC: missing data imputation method performs imputation left-censored missing data using random draws truncated distribution parameters estimated using quantile regression. impute_QRILC() function calls imputeLCMD::impute.QRILC() imputeLCMD package. MinDet: Performs imputation left-censored missing data using deterministic minimal value approach. Considering expression data n samples p features, sample, missing entries replaced minimal value observed sample. minimal value observed estimated q-th quantile (default q = 0.01) observed values sample. implementation based imputeLCMD::impute.MinDet() function. MinProb: Performs imputation left-censored missing data random draws Gaussian distribution centred minimal value. Considering expression data matrix n samples p features, sample, mean value Gaussian distribution set minimal observed value sample. minimal value observed estimated q-th quantile (default q = 0.01) observed values sample. standard deviation estimated median feature (sample) standard deviations. Note estimating standard deviation Gaussian distribution, peptides/proteins present 50\\ values considered. impute_MinProb() function calls imputeLCMD::impute.MinProb() imputeLCMD package. min: Replaces missing values smallest non-missing value data. zero: Replaces missing values 0. mixed: mixed imputation applying two methods (defined user mar values missing random mnar values missing random, see example) two MCAR/MNAR subsets data (defined user randna logical, length equal nrow(object)). nbavg: Average neighbour imputation fractions collected along fractionation/separation gradient, sub-cellular fractions. method assumes fraction ordered along gradient invalid otherwise. Continuous sets NA value beginning end quantitation vectors set lowest observed value data user defined value passed argument k. , missing value flanked two non-missing neighbouring values, imputed mean direct neighbours. : Replaces missing values user-provided value. none: imputation performed missing values left untouched. Implemented case one wants impute value missing random random mixed method. imputeMethods() function returns vector valid imputation method names. Use getImputeMargin() get default margin imputation function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"Olga Troyanskaya, Michael Cantor, Gavin Sherlock, Pat Brown, Trevor Hastie, Robert Tibshirani, David Botstein Russ B. Altman, Missing value estimation methods DNA microarrays Bioinformatics (2001) 17 (6): 520-525. Oba et al., Bayesian missing value estimation method gene expression profile data, Bioinformatics (2003) 19 (16): 2088-2096. Cosmin Lazar (2015). imputeLCMD: collection methods left-censored missing data imputation. R package version 2.0. http://CRAN.R-project.org/package=imputeLCMD. Lazar C, Gatto L, Ferro M, Bruley C, Burger T. Accounting Multiple Natures Missing Values Label-Free Quantitative Proteomics Data Sets Compare Imputation Strategies. J Proteome Res. 2016 Apr 1;15(4):1116-25. doi: 10.1021/acs.jproteome.5b00981. PubMed PMID:26906401.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/imputation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quantitative mass spectrometry data imputation — impute_matrix","text":"","code":"## test data set.seed(42) m <- matrix(rlnorm(60), 10) dimnames(m) <- list(letters[1:10], LETTERS[1:6]) m[sample(60, 10)] <- NA ## available methods imputeMethods() #> [1] \"bpca\" \"knn\" \"QRILC\" \"MLE\" \"MLE2\" \"MinDet\" \"MinProb\" #> [8] \"min\" \"zero\" \"mixed\" \"nbavg\" \"with\" \"RF\" \"none\" impute_matrix(m, method = \"zero\") #> A B C D E F #> a 3.9391243 3.6872085 0.0000000 1.57688302 1.2287515 1.37978165 #> b 0.5685317 9.8418666 0.1684176 0.00000000 0.6969391 0.45664959 #> c 1.4378205 0.2493592 0.8420488 2.81539768 0.0000000 4.83425736 #> d 1.8829931 0.7566997 3.3691979 0.54393454 0.0000000 0.00000000 #> e 1.4982059 0.8751838 6.6538355 1.65691116 0.2545441 1.09391242 #> f 0.8993127 0.0000000 0.6502040 0.17960259 1.5415957 1.31857387 #> g 4.5336257 0.0000000 0.7731599 0.45636653 0.4442387 1.97247444 #> h 0.9096830 0.0701966 0.1715015 0.42702719 4.2380415 1.09399145 #> i 0.0000000 0.0000000 0.0000000 0.08943818 0.6495690 0.05013228 #> j 0.9392120 3.7438457 0.5272951 1.03678296 1.9263902 1.32960639 impute_matrix(m, method = \"min\") #> A B C D E F #> a 3.93912433 3.68720845 0.05013228 1.57688302 1.22875148 1.37978165 #> b 0.56853172 9.84186664 0.16841764 0.05013228 0.69693906 0.45664959 #> c 1.43782048 0.24935924 0.84204876 2.81539768 0.05013228 4.83425736 #> d 1.88299314 0.75669973 3.36919788 0.54393454 0.05013228 0.05013228 #> e 1.49820590 0.87518382 6.65383554 1.65691116 0.25454413 1.09391242 #> f 0.89931266 0.05013228 0.65020399 0.17960259 1.54159566 1.31857387 #> g 4.53362571 0.05013228 0.77315991 0.45636653 0.44423873 1.97247444 #> h 0.90968305 0.07019660 0.17150153 0.42702719 4.23804154 1.09399145 #> i 0.05013228 0.05013228 0.05013228 0.08943818 0.64956901 0.05013228 #> j 0.93921196 3.74384570 0.52729513 1.03678296 1.92639019 1.32960639 impute_matrix(m, method = \"knn\") #> Loading required namespace: impute #> Imputing along margin 1 (features/rows). #> A B C D E F #> a 3.9391243 3.6872085 1.8777229 1.57688302 1.2287515 1.37978165 #> b 0.5685317 9.8418666 0.1684176 0.93096390 0.6969391 0.45664959 #> c 1.4378205 0.2493592 0.8420488 2.81539768 1.3352059 4.83425736 #> d 1.8829931 0.7566997 3.3691979 0.54393454 1.3352059 1.54557696 #> e 1.4982059 0.8751838 6.6538355 1.65691116 0.2545441 1.09391242 #> f 0.8993127 2.5204465 0.6502040 0.17960259 1.5415957 1.31857387 #> g 4.5336257 2.5204465 0.7731599 0.45636653 0.4442387 1.97247444 #> h 0.9096830 0.0701966 0.1715015 0.42702719 4.2380415 1.09399145 #> i 1.6608509 2.5204465 1.8777229 0.08943818 0.6495690 0.05013228 #> j 0.9392120 3.7438457 0.5272951 1.03678296 1.9263902 1.32960639 ## same as impute_zero impute_matrix(m, method = \"with\", val = 0) #> A B C D E F #> a 3.9391243 3.6872085 0.0000000 1.57688302 1.2287515 1.37978165 #> b 0.5685317 9.8418666 0.1684176 0.00000000 0.6969391 0.45664959 #> c 1.4378205 0.2493592 0.8420488 2.81539768 0.0000000 4.83425736 #> d 1.8829931 0.7566997 3.3691979 0.54393454 0.0000000 0.00000000 #> e 1.4982059 0.8751838 6.6538355 1.65691116 0.2545441 1.09391242 #> f 0.8993127 0.0000000 0.6502040 0.17960259 1.5415957 1.31857387 #> g 4.5336257 0.0000000 0.7731599 0.45636653 0.4442387 1.97247444 #> h 0.9096830 0.0701966 0.1715015 0.42702719 4.2380415 1.09399145 #> i 0.0000000 0.0000000 0.0000000 0.08943818 0.6495690 0.05013228 #> j 0.9392120 3.7438457 0.5272951 1.03678296 1.9263902 1.32960639 ## impute with half of the smalles value impute_matrix(m, method = \"with\", val = min(m, na.rm = TRUE) * 0.5) #> A B C D E F #> a 3.93912433 3.68720845 0.02506614 1.57688302 1.22875148 1.37978165 #> b 0.56853172 9.84186664 0.16841764 0.02506614 0.69693906 0.45664959 #> c 1.43782048 0.24935924 0.84204876 2.81539768 0.02506614 4.83425736 #> d 1.88299314 0.75669973 3.36919788 0.54393454 0.02506614 0.02506614 #> e 1.49820590 0.87518382 6.65383554 1.65691116 0.25454413 1.09391242 #> f 0.89931266 0.02506614 0.65020399 0.17960259 1.54159566 1.31857387 #> g 4.53362571 0.02506614 0.77315991 0.45636653 0.44423873 1.97247444 #> h 0.90968305 0.07019660 0.17150153 0.42702719 4.23804154 1.09399145 #> i 0.02506614 0.02506614 0.02506614 0.08943818 0.64956901 0.05013228 #> j 0.93921196 3.74384570 0.52729513 1.03678296 1.92639019 1.32960639 ## all but third and fourth features' missing values ## are the result of random missing values randna <- rep(TRUE, 10) randna[c(3, 9)] <- FALSE impute_matrix(m, method = \"mixed\", randna = randna, mar = \"knn\", mnar = \"min\") #> Imputing along margin 1 (features/rows). #> A B C D E F #> a 3.93912433 3.68720845 2.35451487 1.57688302 1.22875148 1.37978165 #> b 0.56853172 9.84186664 0.16841764 0.74593934 0.69693906 0.45664959 #> c 1.43782048 0.24935924 0.84204876 2.81539768 0.05013228 4.83425736 #> d 1.88299314 0.75669973 3.36919788 0.54393454 1.34408497 1.44241604 #> e 1.49820590 0.87518382 6.65383554 1.65691116 0.25454413 1.09391242 #> f 0.89931266 2.42140409 0.65020399 0.17960259 1.54159566 1.31857387 #> g 4.53362571 2.42140409 0.77315991 0.45636653 0.44423873 1.97247444 #> h 0.90968305 0.07019660 0.17150153 0.42702719 4.23804154 1.09399145 #> i 0.05013228 0.05013228 0.05013228 0.08943818 0.64956901 0.05013228 #> j 0.93921196 3.74384570 0.52729513 1.03678296 1.92639019 1.32960639 ## user provided (random) imputation function random_imp <- function(x) { m <- mean(x, na.rm = TRUE) sdev <- sd(x, na.rm = TRUE) n <- sum(is.na(x)) x[is.na(x)] <- rnorm(n, mean = m, sd = sdev) x } impute_matrix(m, FUN = random_imp) #> Imputing along margin 1 (features/rows). #> A B C D E F #> a 3.9391243 3.6872085 -0.9827978 1.57688302 1.2287515 1.37978165 #> b 0.5685317 9.8418666 0.1684176 3.34043209 0.6969391 0.45664959 #> c 1.4378205 0.2493592 0.8420488 2.81539768 4.6343602 4.83425736 #> d 1.8829931 0.7566997 3.3691979 0.54393454 -0.3031275 0.79093969 #> e 1.4982059 0.8751838 6.6538355 1.65691116 0.2545441 1.09391242 #> f 0.8993127 2.0228995 0.6502040 0.17960259 1.5415957 1.31857387 #> g 4.5336257 -0.6151082 0.7731599 0.45636653 0.4442387 1.97247444 #> h 0.9096830 0.0701966 0.1715015 0.42702719 4.2380415 1.09399145 #> i 4.5173132 2.2355807 3.0879489 0.08943818 0.6495690 0.05013228 #> j 0.9392120 3.7438457 0.5272951 1.03678296 1.9263902 1.32960639 ## get the default margin getImputeMargin(impute_knn) ## default imputes along features #> [1] 1 getImputeMargin(impute_mle) ## default imputes along samples #> [1] 2 getImputeMargin(impute_zero) ## NA: no margin here #> [1] NA ## default margin for all MsCoreUtils::impute_* functions sapply(ls(\"package:MsCoreUtils\", pattern = \"impute_\"), getImputeMargin) #> impute_MinDet impute_MinProb impute_QRILC #> 2 2 2 #> impute_RF impute_bpca impute_fun #> 2 1 1 #> impute_knn impute_matrix impute_min #> 1 NA NA #> impute_mixed impute_mle impute_neighbour_average #> 1 2 1 #> impute_with impute_zero #> NA NA"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":null,"dir":"Reference","previous_headings":"","what":"Local Maxima — localMaxima","title":"Local Maxima — localMaxima","text":"function finds local maxima numeric vector. local maximum defined maximum window current index +/- hws.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Local Maxima — localMaxima","text":"","code":"localMaxima(x, hws = 1L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Local Maxima — localMaxima","text":"x numeric, vector searched local maxima. hws integer(1), half window size, resulting window reaches (- hws):(+ hws).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Local Maxima — localMaxima","text":"logical length x TRUE local maxima.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Local Maxima — localMaxima","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/localMaxima.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Local Maxima — localMaxima","text":"","code":"x <- c(1:5, 4:1, 1:10, 9:1, 1:5, 4:1) localMaxima(x) #> [1] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [13] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE #> [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE #> [37] FALSE localMaxima(x, hws = 10) #> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [13] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE #> [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [37] FALSE"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":null,"dir":"Reference","previous_headings":"","what":"Relaxed Value Matching — closest","title":"Relaxed Value Matching — closest","text":"functions offer relaxed matching one vector another. contrast similar match() %% functions just accept numeric arguments additional tolerance argument allows relaxed matching.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Relaxed Value Matching — closest","text":"","code":"closest( x, table, tolerance = Inf, ppm = 0, duplicates = c(\"keep\", \"closest\", \"remove\"), nomatch = NA_integer_, .check = TRUE ) common( x, table, tolerance = Inf, ppm = 0, duplicates = c(\"keep\", \"closest\", \"remove\"), .check = TRUE ) join( x, y, tolerance = 0, ppm = 0, type = c(\"outer\", \"left\", \"right\", \"inner\"), .check = TRUE, ... )"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Relaxed Value Matching — closest","text":"x numeric, values matched. contrast match() x sorted increasing order must contain NA. table numeric, values matched . contrast match() table sorted increasing order must contain NA. tolerance numeric, accepted tolerance. length one length x. ppm numeric(1) representing relative, value-specific parts-per-million (PPM) tolerance added tolerance. duplicates character(1), handle duplicated matches. one c(\"keep\", \"closest\", \"remove\"). abbreviations allowed. nomatch integer(1), difference value x table larger tolerance nomatch returned. .check logical(1) turn checks increasingly sorted x y. just done ensured methods x y sorted, see also closest(). y numeric, values joined. sorted. type character(1), defines x y joined. See details join. ... ignored.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Relaxed Value Matching — closest","text":"closest returns integer vector length x giving closest position table first match nomatch match. common returns logical vector length x TRUE element x found table. similar %%. join returns matrix two columns, namely x y, representing index values x matching corresponding value y (NA value match).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Relaxed Value Matching — closest","text":"closest/common tolerance argument set 0 get results match()/%%. set Inf (default) index closest values returned without restriction. guaranteed one--one matching neither x table table x matching. multiple elements x match single element table corresponding indices returned duplicates=\"keep\" set (default). behaviour identical match(). duplicates=\"closest\" just closest element x gets corresponding index table duplicates=\"remove\" elements x match element table set nomatch. single element x matches multiple elements table closest returned duplicates=\"keep\" duplicates=\"closest\" (keeping multiple matches possible case return value length x). differences x corresponding matches table identical lower index (smaller element table) returned. one exception: lower index already returned another x smaller difference index higher one returned duplicates = \"closer\" (x closer higher one). duplicates=\"remove\" multiple matches returned nomatch . .checks = TRUE tests among input validation checks increasingly sorted x table arguments mandatory assumptions closest algorithm. checks require loop vectors compare element precursor. Depending length distribution x table checks take equal/time whole closest algorithm. ensured methods arguments x table sorted tests skipped .check = FALSE. case .check = FALSE used one x table sorted (decreasingly sorted) output incorrect best case result infinity loop average worst case. join: joins two numeric vectors mapping values x values y vice versa similar enough (provided tolerance ppm specified). function returns matrix indices mapped values x y. Parameter type allows define vectors joined: type = \"left\": values x mapped values y, elements y matching value x discarded. type = \"right\": type = \"left\" y. type = \"outer\": return matches values x y. type = \"inner\": report indices values mapped.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Relaxed Value Matching — closest","text":"join based closest(x, y, tolerance, duplicates = \"closest\"). means multiple matches just closest one reported.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Relaxed Value Matching — closest","text":"Sebastian Gibb, Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/matching.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Relaxed Value Matching — closest","text":"","code":"## Define two vectors to match x <- c(1, 3, 5) y <- 1:10 ## Compare match and closest match(x, y) #> [1] 1 3 5 closest(x, y) #> [1] 1 3 5 ## If there is no exact match x <- x + 0.1 match(x, y) # no match #> [1] NA NA NA closest(x, y) #> [1] 1 3 5 ## Some new values x <- c(1.11, 45.02, 556.45) y <- c(3.01, 34.12, 45.021, 46.1, 556.449) ## Using a single tolerance value closest(x, y, tolerance = 0.01) #> [1] NA 3 5 ## Using a value-specific tolerance accepting differences of 20 ppm closest(x, y, ppm = 20) #> [1] 1 3 5 ## Same using 50 ppm closest(x, y, ppm = 50) #> [1] 1 3 5 ## Sometimes multiple elements in `x` match to `table` x <- c(1.6, 1.75, 1.8) y <- 1:2 closest(x, y, tolerance = 0.5) #> [1] 2 2 2 closest(x, y, tolerance = 0.5, duplicates = \"closest\") #> [1] NA NA 2 closest(x, y, tolerance = 0.5, duplicates = \"remove\") #> [1] NA NA NA ## Are there any common values? x <- c(1.6, 1.75, 1.8) y <- 1:2 common(x, y, tolerance = 0.5) #> [1] TRUE TRUE TRUE common(x, y, tolerance = 0.5, duplicates = \"closest\") #> [1] FALSE FALSE TRUE common(x, y, tolerance = 0.5, duplicates = \"remove\") #> [1] FALSE FALSE FALSE ## Join two vectors x <- c(1, 2, 3, 6) y <- c(3, 4, 5, 6, 7) jo <- join(x, y, type = \"outer\") jo #> $x #> [1] 1 2 3 NA NA 4 NA #> #> $y #> [1] NA NA 1 2 3 4 5 #> x[jo$x] #> [1] 1 2 3 NA NA 6 NA y[jo$y] #> [1] NA NA 3 4 5 6 7 jl <- join(x, y, type = \"left\") jl #> $x #> [1] 1 2 3 4 #> #> $y #> [1] NA NA 1 4 #> x[jl$x] #> [1] 1 2 3 6 y[jl$y] #> [1] NA NA 3 6 jr <- join(x, y, type = \"right\") jr #> $x #> [1] 3 NA NA 4 NA #> #> $y #> [1] 1 2 3 4 5 #> x[jr$x] #> [1] 3 NA NA 6 NA y[jr$y] #> [1] 3 4 5 6 7 ji <- join(x, y, type = \"inner\") ji #> $x #> [1] 3 4 #> #> $y #> [1] 1 4 #> x[ji$x] #> [1] 3 6 y[ji$y] #> [1] 3 6"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":null,"dir":"Reference","previous_headings":"","what":"Maximum MS Intensity Value — maxi","title":"Maximum MS Intensity Value — maxi","text":"maxi determines maximum mass spectrometry intensity values, e.g. spectrum chromatogram. contrast base R max() function function returns NA_real_ intensity values NA length(x) 0 (base R max function returns -Inf cases).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Maximum MS Intensity Value — maxi","text":"","code":"maxi(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Maximum MS Intensity Value — maxi","text":"x numeric intensity values maximum reported. coerced numeric.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Maximum MS Intensity Value — maxi","text":"numeric(1) representing maximum values x. Returns always numeric (double) even x integer.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Maximum MS Intensity Value — maxi","text":"Johannes Rainer, Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/maxi.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Maximum MS Intensity Value — maxi","text":"","code":"x <- c(3.2, 34.4, 1.3, NA) maxi(x) #> [1] 34.4 ## Compared to base R max: max(x) #> [1] NA max(x, na.rm = TRUE) #> [1] 34.4 max(numeric(), na.rm = TRUE) #> Warning: no non-missing arguments to max; returning -Inf #> [1] -Inf maxi(numeric()) #> [1] NA max(c(NA, NA), na.rm = TRUE) #> Warning: no non-missing arguments to max; returning -Inf #> [1] -Inf maxi(c(NA, NA)) #> [1] NA"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"Fits additive model (two way decomposition) using Tukey's median polish procedure using stats::medpolish().","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"","code":"medianPolish(x, verbose = FALSE, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"x matrix mode numeric. verbose Default FALSE. ... Additional arguments passed stats::medpolish().","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"numeric vector length identical ncol(x).","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/medianPolish.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the Median Polish (Robust Twoway Decomposition) of a matrix — medianPolish","text":"","code":"x <- matrix(rnorm(30), nrow = 3) medianPolish(x) #> [1] -0.26776266 -0.15710481 -0.75996920 -0.33338980 0.45164953 0.38219408 #> [7] -0.55997060 -1.49835829 0.00120463 -0.03864196"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":null,"dir":"Reference","previous_headings":"","what":"Noise Estimation — noise","title":"Noise Estimation — noise","text":"functions estimate noise data.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Noise Estimation — noise","text":"","code":"noise(x, y, method = c(\"MAD\", \"SuperSmoother\"), ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Noise Estimation — noise","text":"x numeric, x values noise estimation (e.g. mz) y numeric, y values noise estimation (e.g. intensity) method character(1) used method. Currently MAD (median absolute deviation) Friedman's SuperSmoother supported. ... arguments passed method.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Noise Estimation — noise","text":"numeric length x estimated noise.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Noise Estimation — noise","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/noise.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Noise Estimation — noise","text":"","code":"x <- 1:20 y <- c(1:10, 10:1) noise(x, y) #> [1] 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 #> [11] 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 3.7065 noise(x, y, method = \"SuperSmoother\", span = 1 / 3) #> [1] 1.000000 2.000000 3.000000 4.000000 5.000000 6.000000 7.000000 7.857143 #> [9] 8.428571 8.714286 8.714286 8.428571 7.857143 7.000000 6.000000 5.000000 #> [17] 4.000000 3.000000 2.000000 1.000000"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":null,"dir":"Reference","previous_headings":"","what":"Quantitative data normalisation — normalizeMethods","title":"Quantitative data normalisation — normalizeMethods","text":"Function normalise matrix quantitative omics data. nature normalisation controlled method argument, described .","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Quantitative data normalisation — normalizeMethods","text":"","code":"normalizeMethods() normalize_matrix(x, method, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Quantitative data normalisation — normalizeMethods","text":"x matrix HDF5Matrix object normalised. method character(1) defining normalisation method. See normalizeMethods() available ones. ... Additional parameters passed inner normalisation function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Quantitative data normalisation — normalizeMethods","text":"matrix class x dimensions dim(x).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Quantitative data normalisation — normalizeMethods","text":"method parameter can one \"sum\", \"max\", \"center.mean\", \"center.median\", \"div.mean\", \"div.median\", \"diff.meda\", \"quantiles\", \"quantiles.robust\" \"vsn\". normalizeMethods() function returns vector available normalisation methods. \"sum\" \"max\", feature's intensity divided maximum sum feature respectively. two methods applied along features (rows). \"center.mean\" \"center.median\" center respective sample (column) intensities subtracting respective column means medians. \"div.mean\" \"div.median\" divide column means medians. \"diff.median\" centers samples (columns) match grand median subtracting respective columns medians differences grand median. Using \"quantiles\" \"quantiles.robust\" applies (robust) quantile normalisation, implemented preprocessCore::normalize.quantiles() preprocessCore::normalize.quantiles.robust(). \"vsn\" uses vsn::vsn2() function. Note latter also glog-transforms intensities. See respective manuals details function arguments.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Quantitative data normalisation — normalizeMethods","text":"Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/normalize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Quantitative data normalisation — normalizeMethods","text":"","code":"normalizeMethods() #> [1] \"sum\" \"max\" \"center.mean\" \"center.median\" #> [5] \"div.mean\" \"div.median\" \"diff.median\" \"quantiles\" #> [9] \"quantiles.robust\" \"vsn\" ## test data set.seed(42) m <- matrix(rlnorm(60), 10) normalize_matrix(m, method = \"sum\") #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 0.31393285 0.293856133 0.05864968 0.125671426 0.09792670 0.109963217 #> [2,] 0.04132996 0.715463967 0.01224328 0.147101553 0.05066466 0.033196581 #> [3,] 0.11677032 0.020251317 0.06838566 0.228648076 0.17333805 0.392606576 #> [4,] 0.21066540 0.084658010 0.37693894 0.060854278 0.05409294 0.212790434 #> [5,] 0.12451231 0.072734432 0.55298434 0.137701921 0.02115455 0.090912443 #> [6,] 0.13882341 0.291569272 0.10036947 0.027724557 0.23797015 0.203543139 #> [7,] 0.50754608 0.084252023 0.08655639 0.051090905 0.04973318 0.220821420 #> [8,] 0.13163892 0.010158049 0.02481774 0.061794488 0.61328088 0.158309924 #> [9,] 0.75362945 0.008723409 0.15863000 0.008955514 0.06504185 0.005019784 #> [10,] 0.09883183 0.393959126 0.05548646 0.109099076 0.20271108 0.139912436 normalize_matrix(m, method = \"max\") #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 1.00000000 0.93604775 0.18682236 0.40031309 0.31193519 0.350276239 #> [2,] 0.05776666 1.00000000 0.01711237 0.20560302 0.07081371 0.046398677 #> [3,] 0.29742324 0.05158171 0.17418369 0.58238473 0.44150573 1.000000000 #> [4,] 0.55888470 0.22459344 1.00000000 0.16144333 0.14350584 0.564522299 #> [5,] 0.22516425 0.13153073 1.00000000 0.24901595 0.03825525 0.164403285 #> [6,] 0.47612497 1.00000000 0.34423885 0.09508737 0.81617020 0.698095301 #> [7,] 1.00000000 0.16599877 0.17053898 0.10066259 0.09798752 0.435076596 #> [8,] 0.21464703 0.01656345 0.04046717 0.10076050 1.00000000 0.258136084 #> [9,] 1.00000000 0.01157520 0.21048806 0.01188318 0.08630481 0.006660813 #> [10,] 0.25086823 1.00000000 0.14084318 0.27692994 0.51454850 0.355144549 normalize_matrix(m, method = \"quantiles\") #> Loading required namespace: preprocessCore #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 2.4493083 2.4493083 0.9149807 1.5186864 1.1236151 1.5186864 #> [2,] 0.2002101 5.9849751 0.2002101 2.9628356 0.9149807 0.3730709 #> [3,] 0.9149807 0.6151294 1.5186864 5.9849751 2.9628356 5.9849751 #> [4,] 1.5186864 0.9149807 2.9628356 0.9149807 0.6151294 2.4493083 #> [5,] 1.1236151 1.1236151 5.9849751 2.4493083 0.2002101 0.6151294 #> [6,] 0.3730709 1.5186864 0.7569865 0.3730709 1.5186864 0.9149807 #> [7,] 2.9628356 0.7569865 1.1236151 0.7569865 0.3730709 2.9628356 #> [8,] 0.6151294 0.2002101 0.3730709 0.6151294 5.9849751 0.7569865 #> [9,] 5.9849751 0.3730709 2.4493083 0.2002101 0.7569865 0.2002101 #> [10,] 0.7569865 2.9628356 0.6151294 1.1236151 2.4493083 1.1236151 normalize_matrix(m, method = \"center.mean\") #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 1.5256283 1.4919211 -0.8116640 0.49629688 -0.1310407 -0.1633550 #> [2,] -1.8449643 7.6465793 -1.3791629 0.94293137 -0.6628531 -1.0864871 #> [3,] -0.9756756 -1.9459281 -0.7055318 1.73481154 0.7745601 3.2911207 #> [4,] -0.5305029 -1.4385876 1.8216174 -0.53665160 -0.8762926 0.3588507 #> [5,] -0.9152902 -1.3201035 5.1062550 0.57632503 -1.1052480 -0.4492243 #> [6,] -1.5141834 -0.3064709 -0.8973765 -0.90098354 0.1818035 -0.2245628 #> [7,] 2.1201296 -1.4427110 -0.7744206 -0.62421961 -0.9155534 0.4293378 #> [8,] -1.5038130 -2.1250907 -1.3760790 -0.65355895 2.8782494 -0.4491452 #> [9,] 5.1129557 -2.1081671 0.0366477 -0.99114796 -0.7102232 -1.4930044 #> [10,] -1.4742841 1.5485584 -1.0202854 -0.04380318 0.5665980 -0.2135303"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":null,"dir":"Reference","previous_headings":"","what":"Peak Region Mask — .peakRegionMask","title":"Peak Region Mask — .peakRegionMask","text":"function finds mz region spanning peak. creates 0/1 matrix used multiplications functions.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Peak Region Mask — .peakRegionMask","text":"","code":".peakRegionMask(x, p, k = 30L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Peak Region Mask — .peakRegionMask","text":"x numeric, e.g. intensity values. p integer, indices identified peaks/local maxima. k integer(1): maximum number values left right peak looked valleys.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Peak Region Mask — .peakRegionMask","text":"matrix column peak p 2 * k + 1 rows middle row k + 1 peak centroid. values 1 index belongs peak region.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Peak Region Mask — .peakRegionMask","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/peakRegionMask.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Peak Region Mask — .peakRegionMask","text":"","code":"ints <- c(5, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 2, 9, 12, 14, 13, 8, 3) mzs <- seq_along(ints) peaks <- which(localMaxima(ints, hws = 3L)) m <- MsCoreUtils:::.peakRegionMask(ints, peaks, k = 5L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":null,"dir":"Reference","previous_headings":"","what":"PPM - Parts per Million — ppm","title":"PPM - Parts per Million — ppm","text":"ppm small helper function determine parts-per-million user-provided value ppm.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PPM - Parts per Million — ppm","text":"","code":"ppm(x, ppm)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"PPM - Parts per Million — ppm","text":"x numeric, value(s) used ppm calculation, e.g. mz value(s). ppm numeric, parts-per-million (ppm) value(s).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"PPM - Parts per Million — ppm","text":"numeric: parts-per-million x (always positive value).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"PPM - Parts per Million — ppm","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/ppm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"PPM - Parts per Million — ppm","text":"","code":"ppm(c(1000, 2000), 5) #> [1] 0.005 0.010 ppm(c(-300, 200), 5) #> [1] 0.0015 0.0010"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":null,"dir":"Reference","previous_headings":"","what":"Range helper functions — between","title":"Range helper functions — between","text":"functions help work numeric ranges.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Range helper functions — between","text":"","code":"between(x, range) x %between% range"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Range helper functions — between","text":"x numeric, input values. range numeric(2), range compare .","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Range helper functions — between","text":"logical vector length length(x).","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Range helper functions — between","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/range.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Range helper functions — between","text":"","code":"between(1:4, 2:3) #> [1] FALSE TRUE TRUE FALSE 1:4 %between% 2:3 #> [1] FALSE TRUE TRUE FALSE"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine R Objects by Row — rbindFill","title":"Combine R Objects by Row — rbindFill","text":"function combines instances matrix, data.frame DataFrame objects single instance adding eventually missing columns (filling NAs).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine R Objects by Row — rbindFill","text":"","code":"rbindFill(...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine R Objects by Row — rbindFill","text":"... 2 : matrix, data.frame DataFrame.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine R Objects by Row — rbindFill","text":"Depending input single matrix, data.frame DataFrame.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Combine R Objects by Row — rbindFill","text":"rbindFill might work one columns contains S4 classes.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Combine R Objects by Row — rbindFill","text":"Johannes Rainer, Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rbindFill.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine R Objects by Row — rbindFill","text":"","code":"## Combine matrices a <- matrix(1:9, nrow = 3, ncol = 3) colnames(a) <- c(\"a\", \"b\", \"c\") b <- matrix(1:12, nrow = 3, ncol = 4) colnames(b) <- c(\"b\", \"a\", \"d\", \"e\") rbindFill(a, b) #> a b c d e #> [1,] 1 4 7 NA NA #> [2,] 2 5 8 NA NA #> [3,] 3 6 9 NA NA #> [4,] 4 1 NA 7 10 #> [5,] 5 2 NA 8 11 #> [6,] 6 3 NA 9 12 rbindFill(b, a, b) #> b a d e c #> [1,] 1 4 7 10 NA #> [2,] 2 5 8 11 NA #> [3,] 3 6 9 12 NA #> [4,] 4 1 NA NA 7 #> [5,] 5 2 NA NA 8 #> [6,] 6 3 NA NA 9 #> [7,] 1 4 7 10 NA #> [8,] 2 5 8 11 NA #> [9,] 3 6 9 12 NA"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":null,"dir":"Reference","previous_headings":"","what":"Refine Peak Centroids — refineCentroids","title":"Refine Peak Centroids — refineCentroids","text":"function refines centroided values peak weighting y values neighbourhood belong likely peak.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Refine Peak Centroids — refineCentroids","text":"","code":"refineCentroids(x, y, p, k = 2L, threshold = 0.33, descending = FALSE)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Refine Peak Centroids — refineCentroids","text":"x numeric, .e. m/z values. y numeric, .e. intensity values. p integer, indices identified peaks/local maxima. k integer(1), number values left right peak considered weighted mean calculation. threshold double(1), proportion maximal peak intensity. Just values used weighted mean calclulation. descending logical, TRUE just values nearest valleys around peak centroids used.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Refine Peak Centroids — refineCentroids","text":"descending = FALSE function looks k nearest neighbouring data points use x weighted mean corresponding y values weights calculation new peak centroid. k chosen large result skewed peak centroids, see example . descending = TRUE used k general larger trimmed automatically nearest valleys sides peak problem skewed centroids rare.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Refine Peak Centroids — refineCentroids","text":"Sebastian Gibb, Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/refineCentroids.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Refine Peak Centroids — refineCentroids","text":"","code":"ints <- c(5, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 9, 12, 14, 13, 8, 3) mzs <- seq_along(ints) plot(mzs, ints, type = \"h\") pidx <- as.integer(c(3, 8, 16)) points(mzs[pidx], ints[pidx], pch = 16) ## Use the weighted average considering the adjacent mz mzs1 <- refineCentroids(mzs, ints, pidx, k = 2L, descending = FALSE, threshold = 0) mzs2 <- refineCentroids(mzs, ints, pidx, k = 5L, descending = FALSE, threshold = 0) mzs3 <- refineCentroids(mzs, ints, pidx, k = 5L, descending = TRUE, threshold = 0) points(mzs1, ints[pidx], col = \"red\", type = \"h\") ## please recognize the artificial moved centroids of the first peak caused ## by a too large k, here points(mzs2, ints[pidx], col = \"blue\", type = \"h\") points(mzs3, ints[pidx], col = \"green\", type = \"h\") legend(\"topright\", legend = paste0(\"k = \", c(2, 5, 5), \", descending =\", c(\"FALSE\", \"FALSE\", \"TRUE\")), col = c(\"red\", \"blue\", \"green\"), lwd = 1)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate relative log abundances — rla","title":"Calculate relative log abundances — rla","text":"rla calculates relative log abundances (RLA, see reference) numeric vector. rowRla performs row-wise RLA calculations numeric matrix.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate relative log abundances — rla","text":"","code":"rla( x, f = rep_len(1, length(x)), transform = c(\"log2\", \"log10\", \"identity\"), na.rm = TRUE ) rowRla(x, f = rep_len(1, ncol(x)), transform = c(\"log2\", \"log10\", \"identity\"))"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate relative log abundances — rla","text":"x numeric (rla) matrix (rowRla) abundances (natural scale) RLA calculated. f factor, numeric character length x (, rowRla equal number columns x) allowing define grouping values x. omitted values considered group. transform character(1) defining function transform x. Defaults transform = \"log2\" log2 transforms x prior calculation. x already log scale use transform = \"identity\" avoid transformation values. na.rm logical(1) whether NA values removed prior calculation group-wise medians.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate relative log abundances — rla","text":"numeric relative log abundances (log2 scale) length x (rla) matrix dimensions x (rowRla).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate relative log abundances — rla","text":"RLA defined (log2) abundance analyte relative median across abundances analyte samples group. grouping values can defined parameter f.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate relative log abundances — rla","text":"De Livera , Dias DA, De Souza D, Rupasinghe T, Pyke J, Tull D, Roessner U, McConville M, Speed TP. Normalizing integrating metabolomics data. Anal Chem 2012 Dec 18;84(24):10768-76.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Calculate relative log abundances — rla","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/rla.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate relative log abundances — rla","text":"","code":"x <- c(3, 4, 5, 1, 2, 3, 7, 8, 9) grp <- c(1, 1, 1, 2, 2, 2, 3, 3, 3) rla(x, grp) #> [1] -0.4150375 0.0000000 0.3219281 -1.0000000 0.0000000 0.5849625 -0.1926451 #> [8] 0.0000000 0.1699250 x <- rbind(c(324, 4542, 3422, 3232, 5432, 6535, 3321, 1121), c(12, 3341, 3034, 6540, 34, 4532, 56, 1221)) grp <- c(\"a\", \"b\", \"b\", \"b\", \"a\", \"b\", \"a\", \"b\") ## row-wise RLA values rowRla(x, grp) #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] -3.357552 0.4084879 0.0000000 -0.08241256 0.7098658 0.9333475 0.0000000 #> [2,] -1.502500 0.0000000 -0.1390589 0.96901065 0.0000000 0.4398679 0.7198921 #> [,8] #> [1,] -1.610053 #> [2,] -1.452217"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":null,"dir":"Reference","previous_headings":"","what":"Return the Robust Expression Summary of a matrix — robustSummary","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"function calculates robust summarisation feature (protein). Note function assumes intensities input e already log-transformed.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"","code":"robustSummary(x, ...)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"x feature sample matrix containing quantitative data mandatory colnames rownames. ... Additional arguments passed MASS::rlm().","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"numeric() vector length ncol(x) robust summarised values.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"Adriaan Sticker, Sebastian Gibb Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/robustSummary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Return the Robust Expression Summary of a matrix — robustSummary","text":"","code":"x <- matrix(rnorm(30), nrow = 3) colnames(x) <- letters[1:10] rownames(x) <- LETTERS[1:3] robustSummary(x) #> a b c d e f #> 0.13327322 0.91145468 0.76502760 -0.23239400 -0.41392131 0.60431427 #> g h i j #> -0.51182415 0.07515504 -0.39439300 0.52412091"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":null,"dir":"Reference","previous_headings":"","what":"Smoothing — smooth","title":"Smoothing — smooth","text":"function smoothes numeric vector.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Smoothing — smooth","text":"","code":"smooth(x, cf) coefMA(hws) coefWMA(hws) coefSG(hws, k = 3L)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Smoothing — smooth","text":"x numeric, .e. m/z values. cf matrix, coefficient matrix generated coefMA, coefWMA coefSG. hws integer(1), half window size, resulting window reaches (- hws):(+ hws). k integer(1), set order polynomial used calculate coefficients.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Smoothing — smooth","text":"smooth: numeric length x. coefMA: matrix coefficients simple moving average. coefWMA: matrix coefficients weighted moving average. coefSG: matrix Savitzky-Golay-Filter coefficients.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Smoothing — smooth","text":"Savitzky-Golay-Filter hws smaller FWHM peaks (full width half maximum; please find details Bromba Ziegler 1981). general hws (weighted) moving average (coefMA/coefWMA) bemuch smaller Savitzky-Golay-Filter conserve peak shape.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Smoothing — smooth","text":"coefMA(): Simple Moving Average function calculates coefficients simple moving average. coefWMA(): Weighted Moving Average function calculates coefficients weighted moving average weights depending distance center calculated 1/2^abs(-hws:hws) sum weigths normalized 1. coefSG(): Savitzky-Golay-Filter function calculates Savitzky-Golay-Coefficients. additional argument k controls order used polynomial. k set zero yield simple moving average.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Smoothing — smooth","text":"hws depends used method ((weighted) moving average/Savitzky-Golay).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Smoothing — smooth","text":". Savitzky M. J. Golay. 1964. Smoothing differentiation data simplified least squares procedures. Analytical chemistry, 36(8), 1627-1639. M. U. Bromba H. Ziegler. 1981. Application hints Savitzky-Golay digital smoothing filters. Analytical Chemistry, 53(11), 1583-1586. Implementation based : Steinier, J., Termonia, Y., & Deltour, J. (1972). Comments Smoothing differentiation data simplified least square procedure. Analytical Chemistry, 44(11), 1906-1909.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Smoothing — smooth","text":"Sebastian Gibb, Sigurdur Smarason (weighted moving average)","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/smooth.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Smoothing — smooth","text":"","code":"x <- c(1:10, 9:1) plot(x, type = \"b\", pch = 20) cf <- list(MovingAverage = coefMA(2), WeightedMovingAverage = coefWMA(2), SavitzkyGolay = coefSG(2)) for (i in seq_along(cf)) { lines(smooth(x, cf[[i]]), col = i + 1, pch = 20, type = \"b\") } legend(\"bottom\", legend = c(\"x\", names(cf)), pch = 20, col = seq_len(length(cf) + 1))"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":null,"dir":"Reference","previous_headings":"","what":"Summing MS Intensity Values — sumi","title":"Summing MS Intensity Values — sumi","text":"sumi sums mass spectrometry intensity values, e.g. spectrum chromatogram. contrast base R sum() function function returns NA_real_ intensity values NA length(x) 0.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summing MS Intensity Values — sumi","text":"","code":"sumi(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summing MS Intensity Values — sumi","text":"x numeric intensity values summed . coerced numeric using .double.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summing MS Intensity Values — sumi","text":"numeric(1) representing sum values x. Always returns numeric (double) even x integer.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Summing MS Intensity Values — sumi","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/sumi.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summing MS Intensity Values — sumi","text":"","code":"x <- c(3.2, 34.4, 1.3, NA) sumi(x) #> [1] 38.9 ## Compared to base R sum: sum(x) #> [1] NA sum(x, na.rm = TRUE) #> [1] 38.9 sum(numeric(), na.rm = TRUE) #> [1] 0 sumi(numeric()) #> [1] NA sum(c(NA, NA), na.rm = TRUE) #> [1] 0 sumi(c(NA, NA)) #> [1] NA"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":null,"dir":"Reference","previous_headings":"","what":"Validation functions — validPeaksMatrix","title":"Validation functions — validPeaksMatrix","text":"functions used validate input arguments. general just wrapper around corresponding * function error message.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validation functions — validPeaksMatrix","text":"","code":"validPeaksMatrix(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validation functions — validPeaksMatrix","text":"x object test.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validation functions — validPeaksMatrix","text":"logical(1), TRUE validation successful otherwise error thrown.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validation functions — validPeaksMatrix","text":"validPeaksMatrix: see isPeaksMatrix.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Validation functions — validPeaksMatrix","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/validation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validation functions — validPeaksMatrix","text":"","code":"try(validPeaksMatrix(1:2)) #> Error in validPeaksMatrix(1:2) : #> 'x' has to be a 'numeric' matrix with two columns named 'mz' and 'intensity'. The 'mz' column has to be sorted increasingly. validPeaksMatrix(cbind(mz = 1:2, intensity = 1:2)) #> [1] TRUE"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":null,"dir":"Reference","previous_headings":"","what":"Find Peak Valleys — valleys","title":"Find Peak Valleys — valleys","text":"function finds valleys around peaks.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find Peak Valleys — valleys","text":"","code":"valleys(x, p)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find Peak Valleys — valleys","text":"x numeric, e.g. intensity values. p integer, indices identified peaks/local maxima.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find Peak Valleys — valleys","text":"matrix three columns representing index left valley, peak centroid, right valley.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Find Peak Valleys — valleys","text":"detection valleys based localMaxima. returns first occurence local maximum (specific case minimum). plateaus, e.g. c(0, 0, 0, 1:3, 2:1, 0) results wrongly reported left valley index 1 (instead 3, see example section well). real data real problem. x[x == min(x)] <- Inf used running valleys circumvent specific problem really tested cause different problems.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Find Peak Valleys — valleys","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/valleys.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find Peak Valleys — valleys","text":"","code":"ints <- c(5, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 2, 9, 12, 14, 13, 8, 3) mzs <- seq_along(ints) peaks <- which(localMaxima(ints, hws = 3)) cols <- seq_along(peaks) + 1 plot(mzs, ints, type = \"h\", ylim = c(0, 16)) points(mzs[peaks], ints[peaks], col = cols, pch = 20) v <- valleys(ints, peaks) segments(mzs[v[, \"left\"]], 0, mzs[v[, \"right\"]], col = cols, lwd = 2) ## Known limitations for plateaus y <- c(0, 0, 0, 0, 0, 1:5, 4:1, 0) valleys(y, 10L) # left should be 5 here but is 1 #> left centroid right #> [1,] 1 10 15 ## a possible workaround that may cause other problems y[min(y) == y] <- Inf valleys(y, 10L) #> left centroid right #> [1,] 6 10 14"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":null,"dir":"Reference","previous_headings":"","what":"vapply wrappers — vapply1c","title":"vapply wrappers — vapply1c","text":"functions short wrappers around typical vapply calls easier development.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"vapply wrappers — vapply1c","text":"","code":"vapply1c(X, FUN, ..., USE.NAMES = FALSE) vapply1d(X, FUN, ..., USE.NAMES = FALSE) vapply1l(X, FUN, ..., USE.NAMES = FALSE)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"vapply wrappers — vapply1c","text":"X vector (atomic list). FUN function applied element X. ... optional arguments FUN. USE.NAMES logical, return value named.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"vapply wrappers — vapply1c","text":"vapply1c returns vector characters length X. vapply1d returns vector doubles length X. vapply1l returns vector logicals length X.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"vapply wrappers — vapply1c","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/vapply.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"vapply wrappers — vapply1c","text":"","code":"l <- list(a=1:3, b=4:6) vapply1d(l, sum) #> [1] 6 15"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":null,"dir":"Reference","previous_headings":"","what":"Which is the first/last TRUE value. — which.first","title":"Which is the first/last TRUE value. — which.first","text":"Determines location, .e., index first last TRUE value logical vector.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Which is the first/last TRUE value. — which.first","text":"","code":"which.first(x) which.last(x)"},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Which is the first/last TRUE value. — which.first","text":"x logical, vector.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Which is the first/last TRUE value. — which.first","text":"integer, index first/last TRUE value. integer(0) TRUE (everything FALSE NA) found.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Which is the first/last TRUE value. — which.first","text":"Sebastian Gibb","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/reference/which.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Which is the first/last TRUE value. — which.first","text":"","code":"l <- 2 <= 1:3 which.first(l) #> [1] 2 which.last(l) #> [1] 3"},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-15","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.15.2","title":"MsCoreUtils 1.15","text":"Porting baseline baseline estimation function (see issue 119).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-15-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.15.1","title":"MsCoreUtils 1.15","text":"Remove impute_mle2() since norm2 removed CRAN (see issue 117).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-15-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.15.0","title":"MsCoreUtils 1.15","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-13","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.13.1","title":"MsCoreUtils 1.13","text":"Add functions entropy nentropy.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.6","title":"MsCoreUtils 1.11","text":"Fix bug impute_MinDet(MARGIN = 1) add unit test. Check package available namespace loaded adding stopifnot() calling requireNamespace().","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.5","title":"MsCoreUtils 1.11","text":"Add function maxi determine maximal intensity value. function returns NA_real_ instead -Inf values missing length input parameter 0.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.4","title":"MsCoreUtils 1.11","text":"Check parameter y increasingly ordered bin: issue #108.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-3","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.3","title":"MsCoreUtils 1.11","text":"Add function sumi sum intensity values correct NA handling.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-4","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.2","title":"MsCoreUtils 1.11","text":"Reimplement C (see issue #105). Use symbols call registered C methods faster lookup (see PR #106 Writing R extensions: Converting package use registration). Documentation improvement: explicitly mention impute_mle2() MLE imputation paragraph.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-5","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.1","title":"MsCoreUtils 1.11","text":"Add MARGIN argument (relevant) imputation functions support (make explicit) along dimensions (row columns) imputation performed. New impute_mle2() function uses norm2 (see issue #100).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-11-6","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.11.0","title":"MsCoreUtils 1.11","text":"New Bioconductor 3.17 (devel) release","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-10","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.10.0","title":"MsCoreUtils 1.10","text":"New Bioconductor 3.16 (stable) release","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-9","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.9.2","title":"MsCoreUtils 1.9","text":"feat: imputation compatible HDF5Matrix objects feat: normalization compatible HDF5Matrix objects feat: matrix aggregation compatible HDF5Matrix objects fix+feat: aggregate_by_matrix now correctly handles missing data implements ‘na.rm’ Fix rla/rowRla man page.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-9-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.9.1","title":"MsCoreUtils 1.9","text":"Random forest imputation (using missForest) now available (`method = “RF”)","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-9-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.9.0","title":"MsCoreUtils 1.9","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.5","title":"MsCoreUtils 1.7","text":"Function bin gains parameter returnMids choose whether bin mid-points returned result list.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.4","title":"MsCoreUtils 1.7","text":"Fix ppm always return positive value (issue #94).","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.3","title":"MsCoreUtils 1.7","text":"Add citation.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-3","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.2","title":"MsCoreUtils 1.7","text":"Use Matrix::colSums() default handle sparce ‘Matrix’ ‘matrix’ adjacency matrices.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-4","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.1","title":"MsCoreUtils 1.7","text":"New aggregate_by_matrix() uses adjacency matrix aggregate quantitative features. Set colnames outputs aggregate_by_matrix() aggregate_by_vector() make sure always set reply underlying function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-1-7-5","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 1.7.0","title":"MsCoreUtils 1.7","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-5","dir":"Changelog","previous_headings":"","what":"Changes in 1.5.1","title":"MsCoreUtils 1.5","text":"Add .first .last.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-5-1","dir":"Changelog","previous_headings":"","what":"Changes in 1.5.0","title":"MsCoreUtils 1.5","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-3","dir":"Changelog","previous_headings":"","what":"Changes in 1.3.3","title":"MsCoreUtils 1.3","text":"Add join_gnps gnps allow calculation GNPS spectra similarity scores.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-3-1","dir":"Changelog","previous_headings":"","what":"Changes in 1.3.2","title":"MsCoreUtils 1.3","text":"Add rt2numeric(), rt2character() formatRt(). New impute_fun() function user-provide imputation function.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-3-2","dir":"Changelog","previous_headings":"","what":"Changes in 1.3.1","title":"MsCoreUtils 1.3","text":"Add Josep Badia Aparicio contributor","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-3-3","dir":"Changelog","previous_headings":"","what":"Changes in 1.3.0","title":"MsCoreUtils 1.3","text":"New Bioc devel version","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.7","title":"MsCoreUtils 1.1","text":"Rewrite c(\"left\", \"right\", \"inner\", \"outer\") join C <2020-10-06 Tue>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-1","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.6","title":"MsCoreUtils 1.1","text":"Rewrite closest C <2020-09-24 Thu>. Fix #65 #66.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-2","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.5","title":"MsCoreUtils 1.1","text":"Add ... functions join compare peaks; see also #131.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-3","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.4","title":"MsCoreUtils 1.1","text":"Change references Feature QFeatures <2020-07-14 Tue> Ensure closest accept just argument tolerance length 1 length(x); see also #61, PR #62 <2020-08-07 Thu>. tolerance argument closest now length 1 length(x) (length(table) ) <2020-08-20 Thu>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-4","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.3","title":"MsCoreUtils 1.1","text":"empty table closest common return vector length x NA FALSE, respectively (instead 1 TRUE). Fixes #55 <2020-06-18 Thu>. closest common ignore NA table <2020-06-19 Fri>. Fix rbindFill single data.frame DataFrame input <2020-06-23 Tue>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-5","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.2","title":"MsCoreUtils 1.1","text":"New colCounts() aggregation function <2020-05-27 Wed>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-6","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.1","title":"MsCoreUtils 1.1","text":"Add popular distance/similarity metrices: ndotproduct neuclidean navdist nspectraangle; see also PR #33. Add deprecation note dotproduct <2020-05-22 Fri>.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-1-7","dir":"Changelog","previous_headings":"","what":"Changes in 1.1.0","title":"MsCoreUtils 1.1","text":"Bioconductor devel version (Bioc 3.12)","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"changes-in-1-0","dir":"Changelog","previous_headings":"","what":"Changes in 1.0.0.","title":"MsCoreUtils 1.0","text":"Bioconductor release version (Bioc 3.11)","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-0-99","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 0.99.3","title":"MsCoreUtils 0.99","text":"Trigger build.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-0-99-1","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 0.99.2","title":"MsCoreUtils 0.99","text":"Provide comprehensive description. Add vignette.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-0-99-2","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 0.99.1","title":"MsCoreUtils 0.99","text":"Additional functions, using Author@R specify (unique) RforMassSpectrometry Package Maintainer.","code":""},{"path":"https://rformassspectrometry.github.io/MsCoreUtils/news/index.html","id":"mscoreutils-0-99-3","dir":"Changelog","previous_headings":"","what":"MsCoreUtils 0.99.0","title":"MsCoreUtils 0.99","text":"First release MsCoreUtils core function get extreme values, grouping/matching, noise/smoothing, similarity measurements, various helper function, function process (impute normalise) quantitative features.","code":""}]