plot_barIdentGroup: Generate barplot of identity group composition

Description Usage Arguments Value

View source: R/plot_results.R View source: R/plot.R

Description

Generate a percentage barplot that shows the composition of each identity (e.g. sample)in terms of groups (e.g. cell types)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
plot_barIdentGroup(
  seurat_obj,
  var_ident,
  var_group,
  vec_group_colors = NULL,
  f_color = colorRampPalette(brewer.pal(n = 11, name = "RdYlBu")),
  do_plot = F,
  title = NULL,
  fontsize_title = 24,
  fontsize_axistitle_x = 18,
  fontsize_axistitle_y = 18,
  fontsize_axistext_x = 12,
  fontsize_axistext_y = 12,
  fontsize_legendtitle = 12,
  fontsize_legendtext = 10,
  aspect.ratio = 1.2
)

Arguments

seurat_obj

Seurat object (Seurat ^3.0)

var_ident

the identify variable, character

var_group

the group variable, character

vec_group_colors

a vector of colors, named by corresponding group. Length must match number of groups. Character

f_color

if vec_group_colors is not provided, the user may instead provide a function f_color() that takes as its only argument the number of colors to generate

do_plot

Whether to plot, logical

title

NULL to leave out

fontsize_title

NULL to leave out

fontsize_axistitle_x

NULL to leave out

fontsize_axistitle_y

NULL to leave out

fontsize_axistext_x

NULL to leave out

fontsize_axistext_y

NULL to leave out

fontsize_legendtitle

NULL to leave out

fontsize_legendtext

NULL to leave out

aspect.ratio

passed to ggplot2

Value

a ggplot2 object


CBMR-Single-Cell-Omics-Platform/SCOPfunctions documentation built on May 29, 2021, 3:52 p.m.