# Required packages to load if (!require("knitr")) install.packages("knitr") if (!require("tidyr")) install.packages("tidyr") if (!require("plotly")) install.packages("plotly") if (!require("plyr")) install.packages("plyr")
# IMPORT VARIABLES metabo_measures<-params$metabo_measures mort_score<-params$mort_score MetaboAge<-params$MetaboAge surrogates<-params$surrogates predictors<-params$predictors Nmax_miss_metaboAge<-params$Nmax_miss_metaboAge Nmax_zero_metaboAge<-params$Nmax_miss_metaboAge Nmax_miss_surrogates<-params$Nmax_miss_metaboAge Nmax_zero_surrogates<-params$Nmax_miss_metaboAge
Dimensions of the uploaded dataset:
cat(paste0("Metabolites file dimensions: \nRows= ", dim(metabo_measures)[1], ", Columns= ", dim(metabo_measures)[2]),"\nAll the necessary metabolites were found available!")
The following plot reports the missing values found in the features necessary to calculate the scores. This tab contains a heatmap indicating the available values in grey and missing in white. It also includes two bar plots on the sides: one to show the missingness per sample and the other to show the missing values per metabolite. Generally, Nightingale Health reports very low missing values in their quantification, but the missingness in the features can affect the values of the scores calculated. For instance, missing values in the 14 metabolites included in the mortality score will cause missingness in the mortality score, while this doesn't happen in MetaboAge thanks to the imputation techniques used
plot_na_heatmap(t(metabo_measures[,MiMIR::metabolites_subsets$MET57]))
Nightingale Health measures are mostly constituted by lipids and are often correlated to one another. Here we report the Pearson correlations of the metabolites needed to calculate each metabolomics-based score. High correlations are indicated in red and low correlations in blue. This plot can help the user to understand the relations between the metabolic features and divide the features in highly correlated groups.
res<-cor_assoc(metabo_measures,metabo_measures, MiMIR::metabolites_subsets$MET57, MiMIR::metabolites_subsets$MET57) plot_corply(res, main="Metabolites' Correlations", reorder.x=TRUE, abs=F, resort_on_p= TRUE,reorder_dend=F)
This interactive bar plot shows the distributions of the metabolic features used in the metabolomics-based scores within the uploaded data-set in three batches to allow visibility of the plots.
multi_hist(metabo_measures[,MiMIR::metabolites_subsets$MET63[1:20]]) multi_hist(metabo_measures[,MiMIR::metabolites_subsets$MET63[21:40]]) multi_hist(metabo_measures[,MiMIR::metabolites_subsets$MET63[41:63]])
In this section we include the results of the metabolomics-based scores in the uploaded data set.
The selected pre-processing settings for the MetaboAge and the surrogate models, brought to these sample selections:
cat("The quality control settings chosen for MetaboAge are:\n") a<-QCprep(as.matrix(metabo_measures[,MiMIR::metabolites_subsets$MET63]), MiMIR::PARAM_metaboAge,quiet=FALSE, Nmax_miss=Nmax_miss_metaboAge, Nmax_zero=Nmax_zero_metaboAge) cat("The quality control settings chosen for the Surrogates are:\n") b<- QCprep_surrogates(as.matrix(metabo_measures[,MiMIR::metabolites_subsets$MET63]), MiMIR::PARAM_surrogates,quiet=FALSE, Nmax_miss=Nmax_miss_surrogates, Nmax_zero=Nmax_zero_surrogates)
As for the other tables we report the missingness of the metabolomics-based scores. The missingness reported in this figure is closely related to the one seen in the metabolites features, because the metabolomics-scores are derived from those variables.
plot_na_heatmap(t(predictors[,-1]))
This interactive bar plot shows the distributions of the metabolomics-based scores within the uploaded data-set in two batches to allow better visibility of the plots.
multi_hist(predictors[,-1])
As for the other tables we report the Pearson's correlations of the metabolomics-based scores. This plot can be used to verify that the scores represent biological markers which correlate to each other accordingly to their original variables' correlations.
res<-cor_assoc(predictors, predictors, colnames(predictors)[-1],colnames(predictors)[-1]) plot_corply(res, main="Correlations of the Metabolic scores", reorder.x=TRUE, abs=F, resort_on_p= TRUE,reorder_dend=F)
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.