3D PCA for counts dataframe
Usage
plot_pca_3d(
moo_counts,
count_type = NULL,
sub_count_type = NULL,
sample_metadata = NULL,
feature_id_colname = NULL,
sample_id_colname = NULL,
samples_to_rename = NULL,
group_colname = "Group",
label_colname = "Label",
principal_components = c(1, 2, 3),
point_size = 8,
label_font_size = 24,
color_values = c("#5954d6", "#e1562c", "#b80058", "#00c6f8", "#d163e6", "#00a76c",
"#ff9287", "#008cf9", "#006e00", "#796880", "#FFA500", "#878500"),
plot_title = "PCA 3D",
plot_filename = "pca_3D.html",
print_plots = options::opt("print_plots"),
save_plots = options::opt("save_plots"),
plots_subdir = "pca"
)Arguments
- moo_counts
counts dataframe or
multiOmicDataSetcontainingcount_type&sub_count_typein the counts slot- count_type
the type of counts to use – must be a name in the counts slot (
moo@counts)- sub_count_type
used if
count_typeis a list in the counts slot: specify the sub count type within the list. Must be a name innames(moo@counts[[count_type]]).- sample_metadata
sample metadata as a data frame or tibble.
- feature_id_colname
The column from the counts dataa containing the Feature IDs (Usually Gene or Protein ID). This is usually the first column of your input Counts Matrix. Only columns of Text type from your input Counts Matrix will be available to select for this parameter. (Default:
NULL- first column in the counts matrix will be used.)- sample_id_colname
The column from the sample metadata containing the sample names. The names in this column must exactly match the names used as the sample column names of your input Counts Matrix. (Default:
NULL- first column in the sample metadata will be used.)- samples_to_rename
If you do not have a Plot Labels Column in your sample metadata table, you can use this parameter to rename samples manually for display on the PCA plot. Use "Add item" to add each additional sample for renaming. Use the following format to describe which old name (in your sample metadata table) you want to rename to which new name: old_name: new_name
- group_colname
The column from the sample metadata containing the sample group information. This is usually a column showing to which experimental treatments each sample belongs (e.g. WildType, Knockout, Tumor, Normal, Before, After, etc.).
- label_colname
The column from the sample metadata containing the sample labels as you wish them to appear in the plots produced by this template. This can be the same Sample Names Column. However, you may desire different labels to display on your figure (e.g. shorter labels are sometimes preferred on plots). In that case, select the column with your preferred Labels here. The selected column should contain unique names for each sample. (Default:
NULL–sample_id_colnamewill be used.)- principal_components
vector with numbered principal components to plot
- point_size
size for
ggplot2::geom_point()- label_font_size
label font size for the PCA plot
- color_values
vector of colors as hex values or names recognized by R
- plot_title
title for the plot
- plot_filename
plot output filename - only used if save_plots is TRUE
- print_plots
Whether to print plots during analysis (Defaults to
FALSE, overwritable using option 'moo_print_plots' or environment variable 'MOO_PRINT_PLOTS')- save_plots
Whether to save plots to files during analysis (Defaults to
TRUE, overwritable using option 'moo_save_plots' or environment variable 'MOO_SAVE_PLOTS')- plots_subdir
subdirectory in
figures/where plots will be saved ifsave_plotsisTRUE
Value
plotly::plot_ly figure
See also
Other PCA functions:
calc_pca(),
plot_pca(),
plot_pca_2d()