plot_PCA {proBatch} | R Documentation |
plot PCA plot
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)
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) |
feature_id_col |
name of the column with feature/gene/peptide/protein
ID used in the long format representation |
color_by |
column name (as in |
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 |
theme |
ggplot theme, by default |
plot_title |
Title of the plot (usually, processing step + representation level (fragments, transitions, proteins)) |
ggplot scatterplot colored by factor levels of column specified in
factor_to_color
pca_plot <- plot_PCA(example_proteome_matrix, example_sample_annotation, color_by = 'MS_batch', plot_title = "PCA colored by MS batch")