perform_muscat_de_analysis: perform_muscat_de_analysis

View source: R/muscat_de.R

perform_muscat_de_analysisR Documentation

perform_muscat_de_analysis

Description

perform_muscat_de_analysis Perform differential expression analysis via Muscat - Pseudobulking approach.

Usage

perform_muscat_de_analysis(sce, sample_id, celltype_id, group_id, covariates, contrasts, assay_oi_pb = "counts", fun_oi_pb = "sum", de_method_oi = "edgeR", min_cells = 10)

Arguments

sce

SingleCellExperiment object of the scRNAseq data of interest.

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.

group_id

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

covariates

NA if no covariates should be corrected for. If there should be corrected for covariates, this argument should be the name(s) of the columns in the meta data that indicate the covariate(s).

contrasts

String indicating the contrasts of interest (= which groups/conditions will be compared) for the differential expression and MultiNicheNet analysis. We will demonstrate here a few examples to indicate how to write this. Check the limma package manuals for more information about defining design matrices and contrasts for differential expression analysis. If wanting to compare group A vs B: ‘contrasts_oi = c("’A-B'")' If wanting to compare group A vs B & B vs A: ‘contrasts_oi = c("’A-B','B-A'")' If wanting to compare group A vs B & A vs C & A vs D: ‘contrasts_oi = c("’A-B','A-C', 'A-D'")' If wanting to compare group A vs B and C: ‘contrasts_oi = c("’A-(B+C)/2'")' If wanting to compare group A vs B, C and D: ‘contrasts_oi = c("’A-(B+C+D)/3'")' If wanting to compare group A vs B, C and D & B vs A,C,D: ‘contrasts_oi = c("’A-(B+C+D)/3', 'B-(A+C+D)/3'")' Note that the groups A, B, ... should be present in the meta data column 'group_id'.

assay_oi_pb

Indicates which information of the assay of interest should be used (counts, scaled data,...). Default: "counts". See 'muscat::aggregateData'.

fun_oi_pb

Indicates way of doing the pseudobulking. Default: "sum". See 'muscat::aggregateData'.

de_method_oi

Indicates the DE method that will be used after pseudobulking. Default: "edgeR". See 'muscat::pbDS'.

min_cells

Indicates the minimal number of cells that a sample should have to be considered in the DE analysis. Default: 10. See 'muscat::pbDS'.

Value

List with output of the differential expression analysis in 1) default format('muscat::pbDS()'), and 2) in a tidy table format ('muscat::resDS()').

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)
sample_id = "tumor"
group_id = "pEMT"
celltype_id = "celltype"
covariates = NA
contrasts_oi = c("'High-Low','Low-High'")
celltype_de = perform_muscat_de_analysis(
   sce = sce,
   sample_id = sample_id,
   celltype_id = celltype_id,
   group_id = group_id,
   covariates = covariates,
   contrasts = contrasts_oi)

## End(Not run)


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