make_ligand_receptor_violin_plot: make_ligand_receptor_violin_plot

View source: R/plotting.R

make_ligand_receptor_violin_plotR Documentation

make_ligand_receptor_violin_plot

Description

make_ligand_receptor_violin_plot Plot combining a violin plot of of the ligand of interest in the sender cell type of interest, and a violin plot of the receptor of interest in the receiver cell type of interest.

Usage

make_ligand_receptor_violin_plot(sce, ligand_oi, receptor_oi, sender_oi, receiver_oi, group_oi, group_id, sample_id, celltype_id, batch_oi = NA, background_groups = NULL)

Arguments

sce

SingleCellExperiment object

ligand_oi

Character vector of name of the ligand of interest

receptor_oi

Character vector of name of the receptor of interest

sender_oi

Character vector with the names of the sender cell type of interest

receiver_oi

Character vector with the names of the receiver cell type of interest

group_oi

Character vector of name of the group of interest

group_id

Name of the meta data column that indicates from which group/condition a cell comes from

sample_id

Name of the colData(sce) column in which the id of the sample is defined

celltype_id

Name of the meta data column that indicates the cell type of a cell

batch_oi

Name of a batch of interest based on which the visualization will be split. Default: NA: no batch.

background_groups

Default NULL: all groups in the group_id metadata column will be chosen. But user can fill in a character vector with the names of all gruops of interest.

Value

Plot combining a violin plot of of the ligand of interest in the sender cell type of interest, and a violin plot of the receptor of interest in the receiver cell type of interest.

Examples

## Not run: 
library(dplyr)
lr_network = readRDS(url("https://zenodo.org/record/3260758/files/lr_network.rds"))
lr_network = lr_network %>% dplyr::rename(ligand = from, receptor = to) %>% dplyr::distinct(ligand, receptor)
ligand_target_matrix = readRDS(url("https://zenodo.org/record/3260758/files/ligand_target_matrix.rds"))
sample_id = "tumor"
group_id = "pEMT"
celltype_id = "celltype"
batches = NA
contrasts_oi = c("'High-Low','Low-High'")
contrast_tbl = tibble(contrast = c("High-Low","Low-High"), group = c("High","Low"))
output = multi_nichenet_analysis(
     sce = sce, 
     celltype_id = celltype_id, 
     sample_id = sample_id, 
     group_id = group_id,
     batches = batches,
     lr_network = lr_network, 
     ligand_target_matrix = ligand_target_matrix, 
     contrasts_oi = contrasts_oi, 
     contrast_tbl = contrast_tbl
     )
ligand_oi = "DLL1"
receptor_oi = "NOTCH3"
group_oi = "High"
sender_oi = "Malignant"
receiver_oi = "myofibroblast"
p_violin = make_ligand_receptor_violin_plot(sce = sce, ligand_oi = ligand_oi, receptor_oi = receptor_oi, group_oi = group_oi, group_id = group_id, sender_oi = sender_oi, receiver_oi = receiver_oi, sample_id = sample_id, celltype_id = celltype_id)


## End(Not run)


saeyslab/multinichenetr documentation built on Jan. 15, 2025, 7:55 p.m.