Skip to contents

This script allows you to perform different visualizations (bar, box, violin plots) using the results of the MetaProViz analysis Bar, Box or Violin plot in Superplot style visualization

Usage

VizSuperplot(
  InputData,
  SettingsFile_Sample,
  SettingsInfo = c(Conditions = "Conditions", Superplot = NULL),
  PlotType = "Box",
  PlotName = "",
  PlotConditions = NULL,
  StatComparisons = NULL,
  StatPval = NULL,
  StatPadj = NULL,
  xlab = NULL,
  ylab = NULL,
  Theme = NULL,
  ColorPalette = NULL,
  ColorPalette_Dot = NULL,
  SaveAs_Plot = "svg",
  PrintPlot = TRUE,
  FolderPath = NULL
)

Arguments

InputData

DF with unique sample identifiers as row names and metabolite numerical values in columns with metabolite identifiers as column names. Includes experimental design and outlier column.

SettingsFile_Sample

DF which contains information about the samples, which will be combined with your input data based on the unique sample identifiers used as rownames. Column "Conditions" with information about the sample conditions (e.g. "N" and "T" or "Normal" and "Tumor"), can be used for feature filtering and colour coding in the PCA. Column "AnalyticalReplicate" including numerical values, defines technical repetitions of measurements, which will be summarised. Column "BiologicalReplicates" including numerical values. Please use the following names: "Conditions", "Biological_Replicates", "Analytical_Replicates".

SettingsInfo

Named vector including at least information on the conditions column: c(Conditions="ColumnName_SettingsFile_Sample"). Additionally Superplots can be made by adding Superplot ="ColumnName_SettingsFile_Sample", which are usually biological replicates or patient IDs. Default = c(Conditions="Conditions", Superplot = NULL)

PlotType

String with the information of the Graph style. Available options are Bar. Box and Violin Default = Box

PlotName

Optional: String which is added to the output files of the plot.

PlotConditions

Vector with names of selected Conditions for the plot. Can also be used to order the Conditions in the way they should be displayed on the x-axis of the plot. Default = NULL

StatComparisons

List of numeric vectors containing Condition pairs to compare based on the order of the PlotConditions vector. Default = NULL

StatPval

Optional: String which contains an abbreviation of the selected test to calculate p.value. For one-vs-one comparisons choose t.test or wilcox.test , for one-vs-all or all-vs-all comparison choose aov (=anova) or kruskal.test Default = NULL

StatPadj

Optional: String which contains an abbreviation of the selected p.adjusted test for p.value correction for multiple Hypothesis testing. Search: ?p.adjust for more methods:"BH", "fdr", "bonferroni", "holm", etc.Default = NULL

xlab

Optional: String to replace x-axis label in plot. Default = NULL

ylab

Optional: String to replace y-axis label in plot. Default = NULL

Theme

Optional: Selection of theme for plot, e.g. theme_grey(). You can check for complete themes here: https://ggplot2.tidyverse.org/reference/ggtheme.html. Default = NULL

ColorPalette

Optional: Provide customized ColorPalette in vector format. Default = NULL

ColorPalette_Dot

Optional: Provide customized ColorPalette in vector format. Default = NULL

SaveAs_Plot

Optional: Select the file type of output plots. Options are svg, pdf, png or NULL. Default = svg

PrintPlot

Optional: TRUE or FALSE, if TRUE plots are saved as an overview of the results. Default = TRUE

FolderPath

Optional: Path to the folder the results should be saved at. Default = NULL

Value

List with two elements: Plot and Plot_Sized

Examples

Intra <- ToyData("IntraCells_Raw")[,c(1:6)]
Res <- VizSuperplot(InputData=Intra[,-c(1:3)], SettingsFile_Sample=Intra[,c(1:3)], SettingsInfo = c(Conditions="Conditions", Superplot = NULL))