make_DEgene_dotplot_pseudobulk | R Documentation |
make_DEgene_dotplot_pseudobulk
Visualize the scaled pseudobulk expression of DE genes per sample, and compare the different groups. Genes in rows, samples in columns
make_DEgene_dotplot_pseudobulk(genes_oi, celltype_info, prioritization_tables, celltype_oi, grouping_tbl, groups_oi = NULL)
genes_oi |
Character vector with names of genes to visualize |
celltype_info |
'celltype_info' or 'receiver_info' slot of the output of the 'multi_nichenet_analysis' function |
prioritization_tables |
'prioritization_tables' slot of the output of the 'generate_prioritization_tables' or 'multi_nichenet_analysis' function |
celltype_oi |
Character vector with names of celltype of interest |
grouping_tbl |
'grouping_tbl' slot of the output of the 'multi_nichenet_analysis' function |
groups_oi |
Which groups to show? Default: NULL – will show all groups. |
Gene expression dotplot list: pseudobulk version and single-cell version
## 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
)
group_oi = "High"
receiver_oi = "Malignant"
targets_oi = output$ligand_activities_targets_DEgenes$de_genes_df %>% inner_join(contrast_tbl) %>% filter(group == group_oi) %>% arrange(p_val) %>% filter(receiver == receiver_oi) %>% pull(gene) %>% unique()
p_target = make_DEgene_dotplot_pseudobulk(genes_oi = targets_oi, celltype_info = output$celltype_info, prioritization_tables = output$prioritization_tables, celltype_oi = receiver_oi, output$grouping_tbl)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.