self_plot_pca: Generate a PCA plot from a sleuth object with user-selected...

View source: R/plotting_functions.R

self_plot_pcaR Documentation

Generate a PCA plot from a sleuth object with user-selected colour_by and title.

Description

Generate a PCA plot from a sleuth object with user-selected colour_by and title.

Usage

self_plot_pca(
  obj,
  pc_x = 1L,
  pc_y = 2L,
  units = "est_counts",
  color_by = NULL,
  show_legend = TRUE,
  graph_name = "Sample Plot Name",
  auto_save = FALSE,
  scaled = TRUE
)

Arguments

obj

A sleuth object.

pc_x

Integer denoting the principle component to use for the x-axis.

pc_y

Integer denoting the principle component to use for the y-axis.

units

Either 'est_counts' ('scaled_reads_per_base' for gene_mode) or 'tpm'.

color_by

Column name to colour the samples by. Default is NULL.

show_legend

Boolean value if the legend should be shown in the figure out not.

graph_name

Name of the graph. Default is "Sample Plot Name".

auto_save

If TRUE, the plot will be saved automatically. Defaults to FALSE.

scaled

Only works if auto_save is TRUE. The plot will be automatically saved and scaled to the amount of variation per axis. Scale factor is 1:5.

Examples

# Create a PCA plot from a sleuth object.
self_plot_pca(so, colour_by = "tissue", graph_name = "All Samples")

nodrogluap/gumshoe documentation built on Feb. 28, 2023, 6:15 p.m.