fitVarPart: Variance Partition analysis for each assay

fitVarPartR Documentation

Variance Partition analysis for each assay

Description

Perform Variance Partition analysis for each assay

Usage

fitVarPart(
  x,
  formula,
  data = colData(x),
  assays = assayNames(x),
  quiet = FALSE,
  BPPARAM = SerialParam(),
  ...
)

## S4 method for signature 'dreamletProcessedData'
fitVarPart(
  x,
  formula,
  data = colData(x),
  assays = assayNames(x),
  quiet = FALSE,
  BPPARAM = SerialParam(),
  ...
)

Arguments

x

SingleCellExperiment or dreamletProcessedData object

formula

regression formula for differential expression analysis

data

metadata used in regression formula

assays

array of assay names to include in analysis. Defaults to assayNames(x)

quiet

show messages

BPPARAM

parameters for parallel evaluation

...

other arguments passed to dream

Value

Object of class vpDF inheriting from DataFrame storing the variance fractions for each gene and cell type.

Examples


library(muscat)
library(SingleCellExperiment)

data(example_sce)

# create pseudobulk for each sample and cell cluster
pb <- aggregateToPseudoBulk(example_sce,
  assay = "counts",
  cluster_id = "cluster_id",
  sample_id = "sample_id",
  verbose = FALSE
)

# voom-style normalization
res.proc <- processAssays(pb, ~group_id)

# variance partitioning analysis
vp <- fitVarPart(res.proc, ~group_id)

# Show variance fractions at the gene-level for each cell type
genes <- vp$gene[2:4]
plotPercentBars(vp[vp$gene %in% genes, ])

# Summarize variance fractions genome-wide for each cell type
plotVarPart(vp)


GabrielHoffman/dreamlet documentation built on Oct. 29, 2024, 4:04 a.m.