plot_marker_express: Plot gene expression violin plots for top marker genes for...

View source: R/plot_marker_express.R

plot_marker_expressR Documentation

Plot gene expression violin plots for top marker genes for one cell type

Description

This function plots the top n marker genes for a specified cell type based off of the stats table from get_mean_ratio2(). The gene expression is plotted as violin plot with plot_gene_express and adds annotations to each plot.

Usage

plot_marker_express(
  sce,
  stats,
  cell_type,
  n_genes = 4,
  rank_col = "rank_ratio",
  anno_col = "anno_ratio",
  gene_col = "gene",
  cellType_col = "cellType",
  color_pal = NULL,
  plot_points = FALSE,
  ncol = 2
)

Arguments

sce

SummarizedExperiment-class object

stats

A data.frame() generated by get_mean_ratio and/or findMarkers_1vAll

cell_type

A character() target cell type to plot markers for

n_genes

An integer() of number of markers you'd like to plot

rank_col

The character() name of column to rank genes by in stats

anno_col

The character() name of column containing annotation in stats

gene_col

The character() name of column containing gene name in stats should be the same syntax as rownames(sce)

cellType_col

The character() name of colData column containing cell type for sce data, matches cellType.target in stats

color_pal

A named character(1) vector that contains a color pallet matching the cell_type values

plot_points

A logical indicating whether to plot points over the violin, defaults to FALSE as these often become overplotted and quite large (especially when saved as PDF)

ncol

= Number of columns for the facet in the final plot. Defaults to 2.

Value

plotExpression style violin plot for selected marker genes

See Also

Other expression plotting functions: plot_gene_express(), plot_marker_express_ALL(), plot_marker_express_List()

Examples

#plot_marker_express(sce = sce.test, stat = marker_test, cell_type = "Astro", gene_col = "Symbol")
#plot_marker_express(sce = sce.test, stat = marker_test, cell_type = "Micro", gene_col = "Symbol", n_genes = 1, rank_col = "rank_ratio", anno_col = "anno_ratio", plot_points = TRUE)
#plot_marker_express(sce = sce.test, stat = marker_test, cell_type = "Oligo", gene_col = "Symbol", n_genes = 10, rank_col = "rank_ratio", anno_col = "anno_ratio")
#plot_marker_express(sce = sce.test, stat = marker_test, cell_type = "Excit.1", gene_col = "Symbol", n_genes = 5, rank_col = "rank_ratio", anno_col = "anno_ratio")

lahuuki/DeconvoBuddies documentation built on May 5, 2024, 9:35 a.m.