AutoLabelTop.logFC: AutoLabelTop.logFC

View source: R/Seurat.Utils.R

AutoLabelTop.logFCR Documentation

AutoLabelTop.logFC

Description

Create a new "named identity" column in the metadata of a Seurat object, with Ident set to a clustering output matching the res parameter of the function. It requires the output table of FindAllMarkers(). If you used StoreAllMarkers() is stored under ⁠@misc$df.markers$res...⁠, which location is assumed by default.

Usage

AutoLabelTop.logFC(
  obj = combined.obj,
  group.by,
  res = stringr::str_extract(group.by, "\\d+\\.\\d+"),
  plot.top.genes = TRUE,
  suffix = res,
  order.by = c("combined.score", "avg_log2FC", "p_val_adj")[2],
  exclude = c("^A[CFLP][0-9]{6}", "^Z[0-9]{5}", "^LINC0[0-9]{4}", "^C[1-9]+orf[1-9]+",
    "[-|\\.]AS[1-9]*$", "[-|\\.]DT[1-9]*$", "^MIR[1-9]", "^SNHG[1-9]"),
  df_markers = obj@misc$df.markers[[paste0("res.", res)]],
  plotEnrichment = TRUE
)

Arguments

obj

A Seurat object, with default value combined.obj.

group.by

The clustering group to be used, defaults to the first entry by GetClusteringRuns().

res

Clustering resolution tag. Default: extracted from group.by.

plot.top.genes

Logical indicating whether to show a plot, default is TRUE.

suffix

Suffix for the naming, defaults to the value of res.

order.by

Sorting criterion for the output tibble, defaults to the second element of c("combined.score", "avg_log2FC", "p_val_adj").

exclude

A vector of regular expressions to specify genes to exclude, with default value c("^AL*|^AC*|^LINC*|^C[0-9]+orf[0-9]*").

df_markers

Data frame resulting from DGEA analysis (FindAllMarkers). The default is combined.obj@misc$df.markers[[paste0("res.", res)]].

plotEnrichment

Logical indicating whether to plot enrichment, default is TRUE.

Examples

## Not run: 
if (interactive()) {
  combined.obj <- AutoLabelTop.logFC()
  combined.obj$"cl.names.top.gene.res.0.5"
}

## End(Not run)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.