NMFDoubletsPlotModuleCombos: Plot NMF module combinations and dual-expressing cells

Description Usage Arguments Value

View source: R/NMFDoublets.R

Description

This function creates dimensionality reduction plots that show the expression of pairs of NMF modules and the cells that are selected as doublets, given the chosen set of parameters. It can used to inspect how cells are chosen and refine thresholds to ensure that pairs of modules are not being chosen that might remove legitimate transitions from the data. It produces a plot that shows the expression of each pair of modules (one in red, one in green, overlap in yellow) and a second plot that highlights which cells would be chosen as doublets, given the current parameters. A series of these plots (chosen by boundary, sort, and n.plots parameters) are saved for further inspection.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
NMFDoubletsPlotModuleCombos(
  object,
  path,
  module.combos,
  module.expressed.thresh,
  frac.overlap.max,
  frac.overlap.diff.max,
  boundary = c("pass", "discarded"),
  sort = c("near", "random"),
  only.combos.with.doublets = T,
  n.plots = 50,
  width = 1400,
  height = 600,
  ...
)

Arguments

object

An URD object

path

(Character) Path to a directory to save plots

module.combos

(List) Output from NMFDoubletsDefineModules

module.expressed.thresh

(Numeric) Threshold for calling a cell as an expresser of a module

frac.overlap.max

(Numeric) Threshold to determine which NMF module pairs to use for doublet detecction – only pairs of NMF modules where the maximum portion of cells that express both is less than frac.overlap.max are used.

frac.overlap.diff.max

(Numeric) Threshold to determine which NMF module pairs to use for doublet detecction – only pairs of NMF modules where the portion of co-expressing cells increases less than frac.overlap.diff.max when the detection threshold is lowered are used.

boundary

(Character) Should plots be made for module combinations that "pass" the thresholds or that would be "discarded"

sort

(Character) Should plots be for those module combinations "near" the boundary or chosen at "random"

only.combos.with.doublets

(Logical) Should plots be limited to those module combinations that identify doublet cells?

n.plots

(Numeric) What is the maximum number of plots that should be generated?

width

(Numeric) Width of each plot (in pixels)

height

(Numeric) Height of each plot (in pixels)

...

Additional parameters to pass to plotDimDual and plotDimHighlight – for instance to control which dimensionality reduction is plotted.

Value

Nothing. A series of plots are generated using ggplot2 and saved to the directory specified in path.


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