make_DEgene_dotplot_pseudobulk: make_DEgene_dotplot_pseudobulk

View source: R/plotting.R

make_DEgene_dotplot_pseudobulkR Documentation

make_DEgene_dotplot_pseudobulk

Description

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

Usage

make_DEgene_dotplot_pseudobulk(genes_oi, celltype_info, abundance_data, celltype_oi, groups_oi = NA)

Arguments

genes_oi

Character vector with names of genes to visualize

celltype_info

'celltype_info' slot of the output of the 'muscat_analysis()' function

abundance_data

'abundance_data' slot of the output of the 'get_abundance_info()' function

celltype_oi

Character vector with names of celltype of interest

groups_oi

Which groups to show? Default: NULL – will show all groups.

Value

Gene expression dotplot list: pseudobulk version and single-cell version

Examples

## Not run: 
library(dplyr)
sample_id = "tumor"
group_id = "pEMT"
celltype_id = "celltype"
covariates = NA
contrasts_oi = c("'High-Low','Low-High'")
contrast_tbl = tibble(contrast = c("High-Low","Low-High"), group = c("High","Low"))
min_cells = 10
abundance_output = get_abundance_info(sce, sample_id, group_id, celltype_id, min_cells, covariates = NA)
muscat_output = muscat_analysis(
     sce = sce,
     celltype_id = celltype_id,
     sample_id = sample_id,
     group_id = group_id,
     covariates = covariates,
     contrasts_oi = contrasts_oi,
     contrast_tbl = contrast_tbl)
celltype_oi = "Malignant"
DE_table = filter(muscat_output$celltype_de$celltype_de$de_output_tidy,
                 cluster_id == celltype_oi &
                   p_adj <= 0.05 & logFC >= 1)
DE_genes = unique(DE_table$gene)
dotplots = make_DEgene_dotplot_pseudobulk(genes_oi = DE_genes, celltype_info = muscat_output$celltype_info, abundance_data = abundance_output$abundance_data, celltype_oi = celltype_oi)

## End(Not run)


saeyslab/muscatWrapper documentation built on March 11, 2023, 6:14 p.m.