Compiled date: 2020-10-27
Last edited: 2020-08-01
License: GPL-3
Run the following code to install the Bioconductor version of package.
# install.packages("BiocManager")
BiocManager::install("POMA")
library(POMA)
library(Biobase)
library(ggplot2)
library(patchwork)
Let’s create a cleaned MSnSet
object from example st000336
data to explore the normalization effects.
# load example data
data("st000336")
# imputation using the default method KNN
example_data <- st000336 %>% PomaImpute()
example_data
> MSnSet (storageMode: lockedEnvironment)
> assayData: 30 features, 57 samples
> element names: exprs
> protocolData: none
> phenoData
> sampleNames: DMD004.1.U02 DMD005.1.U02 ... DMD173.1.U02 (57 total)
> varLabels: Group steroids
> varMetadata: labelDescription
> featureData: none
> experimentData: use 'experimentData(object)'
> Annotation:
> - - - Processing information - - -
> Imputed (knn): Tue Oct 27 22:28:53 2020
> MSnbase version: 2.16.0
Here we will evaluate ALL normalization methods that POMA offers on the same MSnSet
object to compare them (Berg et al. 2006).
none <- PomaNorm(example_data, method = "none")
auto_scaling <- PomaNorm(example_data, method = "auto_scaling")
level_scaling <- PomaNorm(example_data, method = "level_scaling")
log_scaling <- PomaNorm(example_data, method = "log_scaling")
log_transformation <- PomaNorm(example_data, method = "log_transformation")
vast_scaling <- PomaNorm(example_data, method = "vast_scaling")
log_pareto <- PomaNorm(example_data, method = "log_pareto")
When we check for the dimension of the data after normalization we can see that ALL methods have the same effect on data dimension. PomaNorm
only change the data dimension when the data have features that only have zeros and when the data have features with 0 variance. Only in these two cases PomaNorm
will remove features of the data, changing the data dimensions.
dim(Biobase::exprs(none))
> [1] 30 57
dim(Biobase::exprs(auto_scaling))
> [1] 30 57
dim(Biobase::exprs(level_scaling))
> [1] 30 57
dim(Biobase::exprs(log_scaling))
> [1] 30 57
dim(Biobase::exprs(log_transformation))
> [1] 30 57
dim(Biobase::exprs(vast_scaling))
> [1] 30 57
dim(Biobase::exprs(log_pareto))
> [1] 30 57
Here we can evaluate the different normalization effects on samples (Berg et al. 2006).
a <- PomaBoxplots(none, group = "samples", jitter = FALSE) +
ggtitle("Not Normalized")
b <- PomaBoxplots(auto_scaling, group = "samples", jitter = FALSE) +
ggtitle("Auto Scaling") +
theme(axis.text.x = element_blank(),
legend.position = "none")
c <- PomaBoxplots(level_scaling, group = "samples", jitter = FALSE) +
ggtitle("Level Scaling") +
theme(axis.text.x = element_blank(),
legend.position = "none")
d <- PomaBoxplots(log_scaling, group = "samples", jitter = FALSE) +
ggtitle("Log Scaling") +
theme(axis.text.x = element_blank(),
legend.position = "none")
e <- PomaBoxplots(log_transformation, group = "samples", jitter = FALSE) +
ggtitle("Log Transformation") +
theme(axis.text.x = element_blank(),
legend.position = "none")
f <- PomaBoxplots(vast_scaling, group = "samples", jitter = FALSE) +
ggtitle("Vast Scaling") +
theme(axis.text.x = element_blank(),
legend.position = "none")
g <- PomaBoxplots(log_pareto, group = "samples", jitter = FALSE) +
ggtitle("Log Pareto") +
theme(axis.text.x = element_blank(),
legend.position = "none")
a
(b + c + d) / (e + f + g)
Here we can evaluate the different normalization effects on features.
h <- PomaDensity(none, group = "features") +
ggtitle("Not Normalized")
i <- PomaDensity(auto_scaling, group = "features") +
ggtitle("Auto Scaling") +
theme(axis.title.x = element_blank(),
axis.title.y = element_blank())
j <- PomaDensity(level_scaling, group = "features") +
ggtitle("Level Scaling") +
theme(axis.title.x = element_blank(),
axis.title.y = element_blank())
k <- PomaDensity(log_scaling, group = "features") +
ggtitle("Log Scaling") +
theme(axis.title.x = element_blank(),
axis.title.y = element_blank())
l <- PomaDensity(log_transformation, group = "features") +
ggtitle("Log Transformation") +
theme(axis.title.x = element_blank(),
axis.title.y = element_blank())
m <- PomaDensity(vast_scaling, group = "features") +
ggtitle("Vast Scaling") +
theme(axis.title.x = element_blank(),
axis.title.y = element_blank())
n <- PomaDensity(log_pareto, group = "features") +
ggtitle("Log Pareto") +
theme(axis.title.x = element_blank(),
axis.title.y = element_blank())
h
(i + j + k) / (l + m + n)
sessionInfo()
> R version 4.0.3 (2020-10-10)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 18.04.5 LTS
>
> Matrix products: default
> BLAS: /home/biocbuild/bbs-3.12-bioc/R/lib/libRblas.so
> LAPACK: /home/biocbuild/bbs-3.12-bioc/R/lib/libRlapack.so
>
> locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C
> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] parallel stats graphics grDevices utils datasets methods
> [8] base
>
> other attached packages:
> [1] Biobase_2.50.0 BiocGenerics_0.36.0 reshape2_1.4.4
> [4] tibble_3.0.4 dplyr_1.0.2 knitr_1.30
> [7] patchwork_1.0.1 ggraph_2.0.3 ggplot2_3.3.2
> [10] POMA_1.0.0 BiocStyle_2.18.0
>
> loaded via a namespace (and not attached):
> [1] backports_1.1.10 circlize_0.4.10 plyr_1.8.6
> [4] igraph_1.2.6 lazyeval_0.2.2 splines_4.0.3
> [7] gmp_0.6-1 BiocParallel_1.24.0 digest_0.6.27
> [10] foreach_1.5.1 htmltools_0.5.0 magick_2.5.0
> [13] viridis_0.5.1 magrittr_1.5 cluster_2.1.0
> [16] doParallel_1.0.16 limma_3.46.0 recipes_0.1.14
> [19] ComplexHeatmap_2.6.0 graphlayouts_0.7.1 gower_0.2.2
> [22] matrixStats_0.57.0 rARPACK_0.11-0 colorspace_1.4-1
> [25] ggrepel_0.8.2 xfun_0.18 crayon_1.3.4
> [28] jsonlite_1.7.1 impute_1.64.0 survival_3.2-7
> [31] iterators_1.0.13 glue_1.4.2 polyclip_1.10-0
> [34] gtable_0.3.0 ipred_0.9-9 zlibbioc_1.36.0
> [37] GetoptLong_1.0.4 RankProd_3.16.0 shape_1.4.5
> [40] Rmpfr_0.8-1 scales_1.1.1 vsn_3.58.0
> [43] Rcpp_1.0.5 mzR_2.24.0 viridisLite_0.3.0
> [46] clue_0.3-57 preprocessCore_1.52.0 clisymbols_1.2.0
> [49] stats4_4.0.3 lava_1.6.8 prodlim_2019.11.13
> [52] glmnet_4.0-2 htmlwidgets_1.5.2 httr_1.4.2
> [55] RColorBrewer_1.1-2 ellipsis_0.3.1 pkgconfig_2.0.3
> [58] XML_3.99-0.5 farver_2.0.3 nnet_7.3-14
> [61] caret_6.0-86 labeling_0.4.2 tidyselect_1.1.0
> [64] rlang_0.4.8 ggcorrplot_0.1.3 munsell_0.5.0
> [67] tools_4.0.3 generics_0.0.2 broom_0.7.2
> [70] evaluate_0.14 stringr_1.4.0 mzID_1.28.0
> [73] yaml_2.2.1 ModelMetrics_1.2.2.2 tidygraph_1.2.0
> [76] purrr_0.3.4 randomForest_4.6-14 ncdf4_1.17
> [79] glasso_1.11 nlme_3.1-150 compiler_4.0.3
> [82] plotly_4.9.2.1 png_0.1-7 e1071_1.7-4
> [85] affyio_1.60.0 tweenr_1.0.1 stringi_1.5.3
> [88] highr_0.8 RSpectra_0.16-0 MSnbase_2.16.0
> [91] lattice_0.20-41 ProtGenerics_1.22.0 Matrix_1.2-18
> [94] vegan_2.5-6 permute_0.9-5 vctrs_0.3.4
> [97] pillar_1.4.6 lifecycle_0.2.0 BiocManager_1.30.10
> [100] MALDIquant_1.19.3 GlobalOptions_0.1.2 data.table_1.13.2
> [103] corpcor_1.6.9 R6_2.4.1 pcaMethods_1.82.0
> [106] affy_1.68.0 bookdown_0.21 gridExtra_2.3
> [109] IRanges_2.24.0 codetools_0.2-16 MASS_7.3-53
> [112] rjson_0.2.20 withr_2.3.0 S4Vectors_0.28.0
> [115] mgcv_1.8-33 mixOmics_6.14.0 grid_4.0.3
> [118] rpart_4.1-15 timeDate_3043.102 tidyr_1.1.2
> [121] class_7.3-17 rmarkdown_2.5 Cairo_1.5-12.2
> [124] ggforce_0.3.2 pROC_1.16.2 lubridate_1.7.9
> [127] ellipse_0.4.2
Berg, Robert A van den, Huub CJ Hoefsloot, Johan A Westerhuis, Age K Smilde, and Mariët J van der Werf. 2006. “Centering, Scaling, and Transformations: Improving the Biological Information Content of Metabolomics Data.” BMC Genomics 7 (1). Springer:142.