Combine the differential expression information of ligands in the sender celltypes with the differential expression information of their cognate receptors in the receiver cell types
Source:R/differential_nichenet.R
combine_sender_receiver_de.Rdcombine_sender_receiver_de Combine the differential expression information of ligands in the sender celltypes with the differential expression information of their cognate receptors in the receiver cell types.
Usage
combine_sender_receiver_de(DE_sender_processed, DE_receiver_processed, lr_network, specificity_score = "min_lfc")Arguments
- DE_sender_processed
Output of `process_niche_de` with `type = receiver`
- DE_receiver_processed
Output of `process_niche_de` with `type = receiver`
- lr_network
Ligand-Receptor Network in tibble format: ligand, receptor as columns
- specificity_score
Defines which score will be used to prioritze ligand-receptor pairs and consider their differential expression. Default and recommended: "min_lfc". "min_lfc" looks at the minimal logFC of the ligand/receptor between the celltype of interest and all the other celltypes. Alternatives: "mean_lfc", "min_score", and "mean_score". Mean uses the average/mean instead of minimum. score is the product of the logFC and the ratio of fraction of expressing cells.
Value
A tibble giving the differential expression information of ligands in the sender celltypes and their cognate receptors in the receiver cell types.
Examples
if (FALSE) { # \dontrun{
seurat_obj <- readRDS(url("https://zenodo.org/record/5840787/files/seurat_obj_subset_integrated_zonation.rds"))
niches <- list(
"KC_niche" = list(
"sender" = c("LSECs_portal", "Hepatocytes_portal", "Stellate cells_portal"),
"receiver" = c("KCs")
),
"MoMac2_niche" = list(
"sender" = c("Cholangiocytes", "Fibroblast 2"),
"receiver" = c("MoMac2")
),
"MoMac1_niche" = list(
"sender" = c("Capsule fibroblasts", "Mesothelial cells"),
"receiver" = c("MoMac1")
)
)
DE_sender <- calculate_niche_de(seurat_obj, niches, "sender")
DE_receiver <- calculate_niche_de(seurat_obj, niches, "receiver")
expression_pct <- 0.10
DE_sender_processed <- process_niche_de(DE_table = DE_sender, niches = niches, expression_pct = expression_pct, type = "sender")
DE_receiver_processed <- process_niche_de(DE_table = DE_receiver, niches = niches, expression_pct = expression_pct, type = "receiver")
specificity_score_LR_pairs <- "min_lfc"
DE_sender_receiver <- combine_sender_receiver_de(DE_sender_processed, DE_receiver_processed, lr_network, specificity_score = specificity_score_LR_pairs)
} # }