getExprGeneNames: Get list of expressed genes for each assay

View source: R/getExprGeneNames.R

getExprGeneNamesR Documentation

Get list of expressed genes for each assay

Description

Get list of expressed genes for each assay using same filters as processAssays().

Usage

getExprGeneNames(
  sceObj,
  assays = assayNames(sceObj),
  min.cells = 5,
  min.count = 5,
  min.samples = 4,
  min.prop = 0.4,
  min.total.count = 15,
  normalize.method = "TMM"
)

Arguments

sceObj

SingleCellExperiment object

assays

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

min.cells

minimum number of observed cells for a sample to be included in the analysis

min.count

minimum number of reads for a gene to be considered expressed in a sample. Passed to edgeR::filterByExpr

min.samples

minimum number of samples passing cutoffs for cell cluster to be retained

min.prop

minimum proportion of retained samples with non-zero counts for a gene to be retained

min.total.count

minimum total count required per gene for inclusion

normalize.method

normalization method to be used by calcNormFactors

Examples

library(muscat)

data(example_sce)

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

# Gene expressed genes for each cell type
geneList = getExprGeneNames(pb)

# Create precision weights for pseudobulk
# By default, weights are set to cell count,
# which is the default in processAssays()
# even when no weights are specified
weightsList <- pbWeights(example_sce,
  sample_id = "sample_id",
  cluster_id = "cluster_id",
  geneList = geneList
)

# voom-style normalization using initial weights
res.proc <- processAssays(pb, ~group_id, weightsList = weightsList)

GabrielHoffman/dreamlet documentation built on May 20, 2024, 2:05 p.m.