plotGenesRank: Plot the genes ranked by expression

View source: R/seurat_plot.R

plotGenesRankR Documentation

Plot the genes ranked by expression

Description

Genes will be ranked by expression, and then plotted, with x axis being the rank and y axis the average expression in the cells, for each ident in group.by. Some genes will then be highlighted.

Usage

plotGenesRank(
  seur,
  genes_highlight = c(),
  group.by = "All cells",
  assay = "RNA",
  slot = "data",
  cols = NULL,
  nudge_x = "middle",
  ncol = 2,
  write_name = TRUE,
  point_size = 2,
  return_table = FALSE
)

Arguments

seur

Seurat object to use.

genes_highlight

List of genes to highlight. If some genes are not found in the dataset, they will just not be plotted.

group.by

Which ident to group the data by. Default to "orig.ident". Can also be "All cells" to get every cells in the same plot.

assay

Assay to use. Default to "RNA"

slot

slot to take the data from. Using data will assume that the data are log1p normalized, and thus will exp1p them before getting the average expression. Default to "data"

nudge_x

either a number or "middle". Will nudge the gene name on the right if positive and left if negative. Middle will try to align the gene names in the middle. Default to 2

ncol

number of column to plot, only useful if more than 1 ident. Default to 2

write_name

Whether to write the gene names or not

point_size

The size of the points. Default to 2

return_table

return a data frame containing the data used for the plot. Only works with group.by = "All cells"

colmap

colmap to use for each ident. Default to hue_pal()

Value

a ggplot object if only one ident, or a gridExtra object if more than one ident.


LabexCortexBioinformatics/LxCxUtils documentation built on Aug. 2, 2022, 6:23 a.m.