Skip to contents

Visualize cluster-cluster communication as a network graph.

Usage

plot_cluster_communication(
  seurat_obj,
  database_name,
  clustering,
  key = "total",
  layout = c("circle", "spatial", "fr"),
  edge_width_range = c(0.5, 3),
  edge_color_by = "weight",
  node_size_by = "n_cells",
  node_size_range = c(5, 15),
  show_self_loops = FALSE,
  p_threshold = 0.05,
  min_weight = NULL,
  edge_color_palette = NULL,
  node_color = NULL,
  title = NULL
)

Arguments

seurat_obj

Seurat object with cluster communication results.

database_name

Database name.

clustering

Clustering name.

key

LR pair or pathway name.

layout

Network layout: "spatial" (uses cluster positions), "circle", "fr" (Fruchterman-Reingold).

edge_width_range

Range for edge widths (default: c(0.5, 3)).

edge_color_by

Color edges by: "weight", "pvalue", or fixed color.

node_size_by

Size nodes by: "n_cells", "total_signal", or fixed.

node_size_range

Range for node sizes (default: c(3, 10)).

show_self_loops

Show self-communication (default: FALSE).

p_threshold

P-value threshold for showing edges (default: 0.05).

min_weight

Minimum edge weight to show.

edge_color_palette

Color palette for edges.

node_color

Color or palette for nodes.

title

Plot title.

Value

A ggplot2 object.