heatmap_sample {PopComm}R Documentation

Generate Heatmap of Ligand-Receptor Interaction Scores

Description

This function generates a heatmap to visualize the ligand-receptor (LR) interaction scores across samples. Rows represent LR pairs and columns represent samples. Optionally, sample metadata can be used to annotate the columns.

Usage

heatmap_sample(
  lr_scores,
  metadata,
  score = c("normalized", "raw"),
  selected_sender = NULL,
  selected_receiver = NULL,
  selected_metadata = NULL
)

Arguments

lr_scores

Data frame containing LR interaction scores per sample (data frame).

metadata

Data frame containing sample metadata (data frame).

score

Character string indicating which score to use: "normalized" (default) or "raw" .

selected_sender

Specific sender cell type to filter, default is None (use all) (character).

selected_receiver

Specific receiver cell type to filter, default is None (use all) (character).

selected_metadata

List of column names in metadata to annotate samples (default: None, use all)(character vector).

Value

Heatmap of average LR interaction scores per sample.

Examples

# Heatmap of LR Interaction Scores
data(lr_scores_eg)
data(metadata_eg)
p <- heatmap_sample(lr_scores_eg, metadata_eg, score = "normalized", selected_sender = "Cardiac",
  selected_receiver = "Perivascular", selected_metadata = c("Sex", "Age_group", "IFN_type"))
print(p)

[Package PopComm version 0.1.0.1 Index]