plot_PVCA.df: plot PVCA, when the analysis is completed

View source: R/proteome_wide_diagnostics.R

plot_PVCA.dfR Documentation

plot PVCA, when the analysis is completed

Description

plot PVCA, when the analysis is completed

Usage

plot_PVCA.df(pvca_res, colors_for_bars = NULL, filename = NULL,
  width = NA, height = NA, units = c("cm", "in", "mm"),
  plot_title = NULL, theme = "classic", base_size = 20)

Arguments

pvca_res

data frame of weights of Principal Variance Components, result of calculate_PVCA

colors_for_bars

four-item color vector, specifying colors for the following categories: c('residual', 'biological', 'biol:techn', 'technical')

filename

path where the results are saved. If null the object is returned to the active window; otherwise, the object is save into the file. Currently only pdf and png format is supported

width

option determining the output image width

height

option determining the output image width

units

units: 'cm', 'in' or 'mm'

plot_title

title of the plot (e.g., processing step + representation level (fragments, transitions, proteins) + purpose (meanplot/corrplot etc))

theme

ggplot theme, by default classic. Can be easily overriden

Value

ggplot object with bars as weights, colored by bio/tech factors

Examples

matrix_test <- example_proteome_matrix[1:150, ]
pvca_df_res <- prepare_PVCA_df(matrix_test, example_sample_annotation, 
technical_factors = c('MS_batch', 'digestion_batch'),
biological_factors = c("Diet", "Sex", "Strain"), 
pca_threshold = .6, variance_threshold = .01, fill_the_missing = -1)
colors_for_bars = c('grey', 'green','blue','red')
names(colors_for_bars) = c('residual', 'biological','biol:techn','technical')

pvca_plot <- plot_PVCA.df(pvca_df_res, colors_for_bars)

symbioticMe/proBatch documentation built on April 9, 2023, 11:59 a.m.