plot_genes_violin: Plot expression for one or more genes as a violin plot

plot_genes_violinR Documentation

Plot expression for one or more genes as a violin plot

Description

Accepts a subset of a cell_data_set and an attribute to group cells by, and produces a ggplot2 object that plots the level of expression for each group of cells.

Usage

plot_genes_violin(
  cds_subset,
  group_cells_by = NULL,
  min_expr = 0,
  nrow = NULL,
  ncol = 1,
  panel_order = NULL,
  label_by_short_name = TRUE,
  normalize = TRUE,
  log_scale = TRUE,
  pseudocount = 0
)

Arguments

cds_subset

Subset cell_data_set to be plotted.

group_cells_by

NULL of the cell attribute (e.g. the column of colData(cds)) to group cells by on the horizontal axis. If NULL, all cells are plotted together.

min_expr

the minimum (untransformed) expression level to be plotted. Default is 0.

nrow

the number of panels per row in the figure.

ncol

the number of panels per column in the figure.

panel_order

the order in which genes should be laid out (left-to-right, top-to-bottom). Should be gene_short_name if label_by_short_name = TRUE or feature ID if label_by_short_name = FALSE.

label_by_short_name

label figure panels by gene_short_name (TRUE) or feature id (FALSE). Default is TRUE.

normalize

Logical, whether or not to normalize expression by size factor. Default is TRUE.

log_scale

Logical, whether or not to scale data logarithmically. Default is TRUE.

pseudocount

A pseudo-count added to the gene expression. Default is 0.

Value

a ggplot2 plot object

Examples

  
    cds <- load_a549()
    cds_subset <- cds[row.names(subset(rowData(cds),
                     gene_short_name %in% c("ACTA1", "ID1", "CCNB2"))),]
    plot_genes_violin(cds_subset, group_cells_by="culture_plate", ncol=2,
                      min_expr=0.1)
  


cole-trapnell-lab/monocle3 documentation built on April 7, 2024, 9:24 p.m.