NMFDoubletsDefineModules: NMF Doublets: Calculate module pair overlap

Description Usage Arguments Details Value

View source: R/NMFDoublets.R

Description

This considers NMF module expression within cells pairwise to determine how many cells have overlapping expression of that pair of modules. It generates a list that can be used as input into NMFDoubletsPlotModuleThresholds to choose which module pairs to use for selection and then NMFDoubletsDetermineCells to identify cells that express multiple NMF modules that should not overlap and thus seem to be doublets.

Usage

1
2
3
4
5
6
NMFDoubletsDefineModules(
  object,
  modules.use,
  module.thresh.high = 0.3,
  module.thresh.low = 0.15
)

Arguments

object

An URD object

modules.use

(Character vector) Modules to consider (i.e. column names of @nmf.c1)

module.thresh.high

(Numeric) High threshold to use for 'expression' of an NMF module

module.thresh.low

(Numeric) Lower threshold to use for 'expression' of an NMF module

Details

Two thresholds are used to determine whether a cell 'expresses' a module – this helps differentiate between totally distinct modules (in which case the number of co-expressing cells is similar with either threshold) from pairs of modules expressed in an overlapping gradient (in which case the number of cells that co-express them increases dramatically as the threshold is lowered).

Cells that express a pair of modules that are totally distinct are often useful for identifying doublets – where one detected cell contains cells that are highly expressing two cell type programs that don't usually occur together. Excluding module pairs that are expressed in an overlapping gradient is important, however, as these often identify cells that are participating in a developmental transition and should not be excluded.

This function requires that a matrix of NMF modules expression per cell is put into slot @nmf.c1. It should be a sparse matrix of class dgCMatrix (object@nmf.c1 <- as(as.matrix(nmf.modules), 'dgCMatrix')), where rows are cells and columns are modules. In general, we generally normalize each module from 0-1 across all cells.

Value

(List) For use in NMFDoubletsPlotModuleThresholds and NMFDoubletsDetermineCells


farrellja/URD documentation built on June 17, 2020, 4:48 a.m.