make_DEgene_violin_plot: make_DEgene_violin_plot

View source: R/plotting.R

make_DEgene_violin_plotR Documentation

make_DEgene_violin_plot

Description

make_DEgene_violin_plot Violin plot of a gene gene of interest: per sample, and samples are grouped per group

Usage

make_DEgene_violin_plot(sce, gene_oi, celltype_oi, group_id, sample_id, celltype_id, covariate_oi = NA, groups_oi = NA)

Arguments

sce

SingleCellExperiment object of the scRNAseq data of interest.

gene_oi

Name of the gene of interest

celltype_oi

Character vector with the names of the cell type of interest

group_id

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

sample_id

Name of the meta data column that indicates from which sample/patient a cell comes from (in sce)

celltype_id

Name of the column in the meta data of sce that indicates the cell type of a cell.

covariate_oi

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

groups_oi

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

Value

ggplot object: Violin plot of a gene gene of interest: per sample, and samples are grouped per group

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"
group_oi = "High"
gene_oi = "RAB31"
p_violin_gene = make_DEgene_violin_plot(sce = sce, gene_oi = gene_oi, celltype_oi = celltype_oi, group_id = group_id, sample_id, celltype_id = celltype_id)

## End(Not run)

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