plot_PCA {proBatch}R Documentation

plot PCA plot

Description

plot PCA plot

Usage

plot_PCA(data_matrix, sample_annotation,
  feature_id_col = "peptide_group_label", color_by = "MS_batch",
  PC_to_plot = c(1, 2), fill_the_missing = 0,
  colors_for_factor = NULL, theme = "classic", plot_title = NULL)

Arguments

data_matrix

features (in rows) vs samples (in columns) matrix, with feature IDs in rownames and file/sample names as colnames. in most function, it is assumed that this is the log transformed version of the original data

sample_annotation

data matrix with 1) sample_id_col (this can be repeated as row names) 2) biological and 3) technical covariates (batches etc)

feature_id_col

name of the column with feature/gene/peptide/protein ID used in the long format representation df_long. In the wide formatted representation data_matrix this corresponds to the row names.

color_by

column name (as in sample_annotation) to color by

PC_to_plot

principal component numbers for x and y axis

fill_the_missing

boolean value determining if missing values should be substituted with -1 (and colored with black)

colors_for_factor

named vector of colors for the color_by variable

theme

ggplot theme, by default classic. Can be easily overriden (see examples)

plot_title

Title of the plot (usually, processing step + representation level (fragments, transitions, proteins))

Value

ggplot scatterplot colored by factor levels of column specified in factor_to_color

See Also

autoplot.pca_common, ggplot

Examples

pca_plot <- plot_PCA(example_proteome_matrix, example_sample_annotation, 
color_by = 'MS_batch', plot_title = "PCA colored by MS batch")


[Package proBatch version 1.0.0 Index]