View source: R/proteome_wide_diagnostics.R
plot_PCA | R Documentation |
plot PCA plot
plot_PCA(data_matrix, sample_annotation,
feature_id_col = "peptide_group_label",
sample_id_col = "FullRunName", color_by = "MS_batch",
PC_to_plot = c(1, 2), fill_the_missing = -1,
color_scheme = "brewer", filename = NULL, width = NA,
height = NA, units = c("cm", "in", "mm"), plot_title = NULL,
theme = "classic", base_size = 20)
data_matrix |
features (in rows) vs samples (in columns) matrix, with
feature IDs in rownames and file/sample names as colnames.
See "example_proteome_matrix" for more details (to call the description,
use |
sample_annotation |
data frame with:
.
See |
feature_id_col |
name of the column with feature/gene/peptide/protein
ID used in the long format representation |
sample_id_col |
name of the column in |
color_by |
column name (as in |
PC_to_plot |
principal component numbers for x and y axis |
fill_the_missing |
numeric value determining how missing values
should be substituted. If |
color_scheme |
a named vector of colors to map to |
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 |
ggplot scatterplot colored by factor levels of column specified in
factor_to_color
autoplot.pca_common
,
ggplot
pca_plot <- plot_PCA(example_proteome_matrix, example_sample_annotation,
color_by = 'MS_batch', plot_title = "PCA colored by MS batch")
pca_plot <- plot_PCA(example_proteome_matrix, example_sample_annotation,
color_by = 'DateTime', plot_title = "PCA colored by DateTime")
color_list <- sample_annotation_to_colors (example_sample_annotation,
factor_columns = c('MS_batch', 'digestion_batch'),
numeric_columns = c('DateTime','order'))
pca_plot <- plot_PCA(example_proteome_matrix, example_sample_annotation,
color_by = 'DateTime', color_scheme = color_list[['DateTime']])
## Not run:
pca_plot <- plot_PCA(example_proteome_matrix, example_sample_annotation,
color_by = 'DateTime', plot_title = "PCA colored by DateTime",
filename = 'test_PCA.png', width = 14, height = 9, units = 'cm')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.