scBarplot.CellsPerCluster: Barplot of Fraction of Cells per Cluster

View source: R/Seurat.Utils.Visualization.R

scBarplot.CellsPerClusterR Documentation

Barplot of Fraction of Cells per Cluster

Description

Visualizes the fraction of cells within each cluster through a barplot.

Usage

scBarplot.CellsPerCluster(
  obj = combined.obj,
  ident = GetOrderedClusteringRuns(obj = obj)[1],
  sort = FALSE,
  plotname = "Cells per Identity Group",
  sub = ident,
  label = list(TRUE, "percent")[[1]],
  suffix = if (label == "percent") "percent" else NULL,
  palette = c("alphabet", "alphabet2", "glasbey", "polychrome", "stepped")[3],
  return_table = FALSE,
  ylab_adj = 1.1,
  min.cells = round(ncol(obj)/100),
  ...
)

Arguments

obj

Seurat object for analysis. Default: combined.obj.

ident

Cluster identity. Used to specify which clustering results to visualize. Default: First entry from ordered clustering runs.

sort

If TRUE, sorts clusters by size. Default: FALSE.

sub

Subtitle for the plot. Default: "identity".

label

If TRUE, shows cell count or percentage based on the label vector. Default: TRUE.

suffix

Optional suffix for file naming. Used in conjunction with kpp.

palette

Color palette for the barplot. Default: 'glasbey'.

return_table

If TRUE, returns the data used for plotting instead of the plot itself. Default: FALSE.

ylab_adj

Adjustment factor for y-axis label positioning. Default: 1.1.

min.cells

Minimum cell count threshold for categories. Adjusted by data size.

...

Additional parameters for internal function calls.

title

Title for the plot. Default: "Cells per Identity Group".

Examples

## Not run: 
scBarplot.CellsPerCluster()
scBarplot.CellsPerCluster(sort = TRUE)

## End(Not run)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.