plot_gene_express: Plot the gene expression of a list of genes in a SCE object

View source: R/plot_gene_express.R

plot_gene_expressR Documentation

Plot the gene expression of a list of genes in a SCE object

Description

This function plots the expression of one or more genes as a violin plot, over a user defined category, typically a cell type annotation.

Usage

plot_gene_express(
  sce,
  genes,
  assay_name = "logcounts",
  cat = "cellType",
  color_pal = NULL,
  title = NULL,
  plot_points = FALSE,
  ncol = 2
)

Arguments

sce

SummarizedExperiment-class object

genes

A list() of character(1) specifying the genes to plot, this should match the format of rownames(sce)

assay_name

A character(1) specifying the name of the assay() in the sce object to use to rank expression values. Defaults to logcounts since it typically contains the normalized expression values.

cat

A character(1) specifying the name of the categorical variable to group the cells or nuclei by. Defaults to cellType.

color_pal

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

title

A character(1) to title the plot

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

A ggplot() violin plot for selected genes

See Also

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

Examples

## Using Symbol as rownames makes this more human readable
#rownames(sce.test) <- SummarizedExperiment::rowData(sce.test)$Symbol
plot_gene_express(sce = sce_ab, genes = c("G-D1_A"))
#plot_gene_express(sce = sce.test, genes = c("RNF220", "CSF3R"))
#plot_gene_express(sce = sce.test, genes = c("RNF220", "CSF3R"), plot_points = TRUE)
#plot_gene_express(sce = sce.test, assay_name = "counts", genes = c("RNF220", "CSF3R"))
#plot_gene_express(sce = sce.test, assay_name = "counts", genes = c("RNF220", "CSF3R"), title = "Inhib Markers")


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