treecor_celldensityplot: Plot kernel density of cells in a UMAP embedding per group

View source: R/treecor_celldensityplot.R

treecor_celldensityplotR Documentation

Plot kernel density of cells in a UMAP embedding per group

Description

Plot kernel density of cells in a UMAP embedding per group

Usage

treecor_celldensityplot(
  cell_meta,
  sample_meta,
  row_variable,
  col_variable = NULL,
  row_combined = T,
  font_size = 15,
  point_size = 0.1,
  point_shape = ".",
  point_alpha = 0.5,
  breaks = seq(0, 1, 0.25)
)

Arguments

cell_meta

Cell-level metadata. Must contain 'sample','UMAP_1' and 'UMAP_2'columns.

sample_meta

Sample-level metadata. Must contain 'sample' and variables to be plotted (e.g. row_variable and col_variable).

row_variable

Specify variable for stratifying on the row. Must be categorical variable (e.g. 'factor' or 'character' class).

col_variable

Specify variable for stratifying on the column (optional). Must be categorical variable (e.g. 'factor' or 'character' class).

row_combined

An indicator for combining all subgroups on the rows and visualize the combined plot in the first row. Only works when both 'row_variable' and 'col_variable' exist.

font_size

Font size. Default is 15.

point_size

Set point size. Default is 0.1.

point_shape

Set point shape. Default is '.'.

point_alpha

Set point transparency. Default is 0.5.

breaks

A character vectors of breaks for color. Default is c(0,0.25,0.5,0.75,1).

Value

A kernel density plot in UMAP embedding.

Author(s)

Boyang Zhang <bzhang34@jhu.edu>, Hongkai Ji

Examples

treecor_celldensityplot(cell_meta, sample_meta, row_variable = 'severity')

byzhang23/TreeCorTreat documentation built on May 7, 2024, 8:37 a.m.