dotplot_lr_continuous_group {PopComm} | R Documentation |
Dotplot of Ligand-Receptor Interaction Scores Against Continuous Group Variable
Description
Creates a dotplot (scatter plot) of LR interaction scores against a continuous variable with optional regression line.
Usage
dotplot_lr_continuous_group(
lr_scores,
metadata,
ligand,
receptor,
sender,
receiver,
group_by,
score = c("normalized", "raw"),
point_size = 3,
point_color = "dodgerblue4",
add_regression = TRUE,
title = NULL
)
Arguments
lr_scores |
Data frame containing LR interaction scores per sample (data frame). |
metadata |
Data frame containing sample metadata (data frame). |
ligand |
Ligand gene name to filter (character). |
receptor |
Receptor gene name to filter (character). |
sender |
Sender cell type to filter (character). |
receiver |
Receiver cell type to filter (character). |
group_by |
Continuous variable column in |
score |
Use 'normalized' or 'raw' score (default: "normalized") (character). |
point_size |
Size of the points in the plot (numeric, default: 3). |
point_color |
Color of the points in the plot (default: "dodgerblue4"). |
add_regression |
Whether to add regression line (logical, default: TRUE). |
title |
Custom plot title (optional). |
Value
A list containing:
plot - ggplot object of the dotplot
df - data frame used for plotting
Examples
# Dotplot of LR Score Against Continuous Group Variable
data(lr_scores_eg)
data(metadata_eg)
res <- dotplot_lr_continuous_group(
lr_scores_eg, metadata_eg,
ligand = "TAC4", receptor = "TACR1",
sender = "Perivascular", receiver = "Cardiac",
group_by = "IFNscore"
)
print(res$plot)
head(res$df)