cell_bar_plot: Visualize the results as a stacked bar chart with...

View source: R/cell_bar_plot.R

cell_bar_plotR Documentation

Visualize the results as a stacked bar chart with tidyverse/ggplot2.

Description

cell_bar_plot() provides batch visualization of tumor microenvironment (TME) cell fractions. It supports input from deconvolution results generated by methodologies such as 'CIBERSORT', 'EPIC', and 'quanTIseq'. The function enables comparison of TME cell distributions within one sample or among different samples.

Usage

cell_bar_plot(
  input,
  id = "ID",
  title = "Cell Fraction",
  features = NULL,
  pattern = NULL,
  legend.position = "bottom",
  coord_filp = TRUE,
  palette = 3,
  show_col = F,
  cols = NULL
)

Arguments

input

input result of 'CIBERSORT' or 'quantiseq'

id

patient identifier of input

title

plot title

features

default is NULL, user can define which column to draw

pattern

patterns of features

legend.position

legend position

coord_filp

logical variables, 'coord_filp' of ggplot2

palette

default is palette3

show_col

default is FALSE

cols

default is NULL, user can define colors manually

Value

A ggplot2 object representing the bar plot of cell fractions.

Examples

# Loading TCGA-STAD microenvironment data
data("sig_stad", package = "IOBR")
# showing 20 tumor microenvironment cell proportion deconvoluted by CIBERSORT algorithm
cell_bar_plot(input = sig_stad[1:20, ], id = "ID", features = colnames(sig_stad)[25:46])

IOBR/IOBR documentation built on Sept. 9, 2024, 8:36 p.m.