This script allows you to perform PCA plot visualization using the results of the MetaProViz analysis PCA plot visualization
Source:R/VizPCA.R
VizPCA.Rd
This script allows you to perform PCA plot visualization using the results of the MetaProViz analysis PCA plot visualization
Usage
VizPCA(
InputData,
SettingsInfo = NULL,
SettingsFile_Sample = NULL,
ColorPalette = NULL,
ColorScale = "discrete",
ShapePalette = NULL,
ShowLoadings = FALSE,
Scaling = TRUE,
Theme = NULL,
PlotName = "",
SaveAs_Plot = "svg",
PrintPlot = TRUE,
FolderPath = NULL
)
Arguments
- SettingsInfo
Optional: NULL or Named vector including at least one of those three information : c(color="ColumnName_Plot_SettingsFile", shape= "ColumnName_Plot_SettingsFile"). Default = NULL
- SettingsFile_Sample
Optional: 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".Default = NULL
- ColorPalette
Optional: Provide customiced color-palette in vector format. For continuous scale use e.g. scale_color_gradient(low = "#88CCEE", high = "red") and for discrete scale c("#88CCEE", "#DDCC77","#661100", "#332288")Default = NULL
- ColorScale
Optional: Either "continuous" or "discrete" colour scale. For numeric or integer you can choose either, for character you have to choose discrete. Default = NULL
- ShapePalette
Optional: Provide customiced shape-palette in vector format. Default = NULL
- ShowLoadings
Optional: TRUE or FALSE for whether PCA loadings are also plotted on the PCA (biplot) Default = FALSE
- Scaling
Optional: TRUE or FALSE for whether a data scaling is used Default = TRUE
- 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. If default=NULL we use theme_classic(). Default = "discrete"
- PlotName
Optional: String which is added to the output files of the PCA Default = ""
- SaveAs_Plot
Optional: Select the file type of output plots. Options are svg, png, pdf or NULL. Default = svg
- PrintPlot
Optional: TRUE or FALSE, if TRUE Volcano plot is saved as an overview of the results. Default = TRUE
- FolderPath
Optional: Path to the folder the results should be saved at. default: NULL
- Input_data
DF with unique sample identifiers as row names and metabolite numerical values in columns with metabolite identifiers as column names. Use NA for metabolites that were not detected. includes experimental design and outlier column.
Examples
Intra <- ToyData("IntraCells_Raw")[,-c(1:3)]
Res <- VizPCA(Intra)
#> Error in ggplot2::autoplot(stats::prcomp(as.matrix(InputData), scale. = as.logical(Scaling)), data = InputPCA, colour = Param_Col, fill = Param_Col, shape = Param_Sha, size = 3, alpha = 0.8, label = T, label.size = 2.5, label.repel = TRUE, loadings = as.logical(ShowLoadings), loadings.label = as.logical(ShowLoadings), loadings.label.vjust = 1.2, loadings.label.size = 2.5, loadings.colour = "grey10", loadings.label.colour = "grey10"): Objects of class <prcomp> are not supported by autoplot.
#> ℹ Have you loaded the required package?