find_cluster_markers: Find and plot top n DEGs per cluster

View source: R/cluster.R

find_cluster_markersR Documentation

Find and plot top n DEGs per cluster

Description

This function uses Seurat's marker finding capability to find DEGs of each cluster

Usage

find_cluster_markers(
  so_clone,
  type,
  logfc.threshold = 0.2,
  min.pct = 0,
  only.pos = TRUE,
  n_markers = 5,
  value = "log2_expr",
  text_size = 16,
  title_size = 18,
  legend_size_pt = 4,
  p_val_thresh = 0.05,
  bin = TRUE,
  plot_directory = None
)

Arguments

so_clone

seurat object with 'clone' (SlideCNA-designated cluster) and bin annotations

type

character string that is 'all' if using malignant and normal clusters and 'malig' if just using malignant clusters

logfc.threshold

numeric float that is seurat parameter, representing the minimum log2 fold change for DEGs to be significant

min.pct

numeric Seurat function parameter

only.pos

TRUE if only using DEGs with positive log2 fold change

n_markers

integer of number of top DEGs to plot/use

value

expression value of DEGs; one of ("log2_expr", "avg_expr", and "avg_log2FC") for log2-normalized aerage epxression, average expression, or log2 fold change

text_size

Ggplot2 text size

title_size

Ggplot2 title size

legend_size_pt

Ggplot2 legend_size_pt

p_val_thresh

value for p value cutoff for DEGs

bin

TRUE if using binned beads

plot_directory

output plot directory path

Value

A list object with cluster marker information markers_clone = data.table of all cluster markers top_markers_clone = data.table of just top cluster markers top_clone_vis = data.frame formatted for plot visualization of top cluster markers


dkzhang777/SlideCNA documentation built on Jan. 25, 2025, 5:53 p.m.