Iterate DimPlot by orig.ident column from Seurat object metadata

Iterate_DimPlot_bySample(
  seurat_object,
  sample_column = "orig.ident",
  file_path = NULL,
  file_name = NULL,
  file_type = NULL,
  single_pdf = FALSE,
  output_width = NULL,
  output_height = NULL,
  dpi = 600,
  color = "black",
  no_legend = TRUE,
  title_prefix = NULL,
  reduction = NULL,
  dims = c(1, 2),
  pt.size = NULL,
  raster = NULL,
  ...
)

Arguments

seurat_object

Seurat object name.

sample_column

name of meta.data column containing sample names/ids (default is "orig.ident").

file_path

directory file path and/or file name prefix. Defaults to current wd.

file_name

name suffix to append after sample name.

file_type

File type to save output as. Must be one of following: ".pdf", ".png", ".tiff", ".jpeg", or ".svg".

single_pdf

saves all plots to single PDF file (default = FALSE). `file_type`` must be .pdf

output_width

the width (in inches) for output page size. Default is NULL.

output_height

the height (in inches) for output page size. Default is NULL.

dpi

dpi for image saving.

color

color scheme to use.

no_legend

logical, whether or not to include plot legend, default is TRUE.

title_prefix

Value that should be used for plot title prefix if no_legend = TRUE. If NULL the value of meta_data_column will be used. Default is NULL.

reduction

Dimensionality Reduction to use (default is object default).

dims

Dimensions to plot.

pt.size

Adjust point size for plotting.

raster

Convert points to raster format. Default is NULL which will rasterize by default if greater than 200,000 cells.

...

Extra parameters passed to DimPlot.

Value

A ggplot object

Examples

if (FALSE) {
Iterate_DimPlot_bySample(seurat_object = object, file_path = "plots/", file_name = "tsne",
file_type = ".jpg", dpi = 600, color = "black")
}