plot_comp: Plot compensation analysis

View source: R/plot_comp.R

plot_compR Documentation

Plot compensation analysis

Description

Plots the effect of varying compensation from 0 to 1 for each cell subclass, examining the minimum subclass output result following a call to deconvolute(). For this function to work, the argument check_comp must be set to TRUE during the call to deconvolute().

Usage

plot_comp(x, overlay = TRUE, type = c("counts", "percent"), mfrow = NULL, ...)

plot_path(
  x,
  subclass = 1L,
  sample = NULL,
  type = c("counts", "percent"),
  add_points = FALSE,
  labs = TRUE,
  ...
)

Arguments

x

An object of class 'deconv' generated by deconvolute().

overlay

Logical whether to overlay compensation curves onto a single plot. If FALSE, multiple plots (one per subclass) are generated on one or more pages.

type

Either "counts" or "percent", to specify whether deconvoluted cell counts or cell percentages are shown.

mfrow

Optional vector of length 2 for organising plot layout. See par(). Only used when overlay = FALSE.

...

Optional graphical arguments passed to plot().

subclass

Either an index number or character value specifying which cell subclass to plot.

sample

Either an index number or character value specifying which sample to plot. Both subclass and sample cannot be specified together.

add_points

Logical whether to add points showing the final cell count values. Not available if type = "percent".

labs

Either logical, whether to show labels for each line. Or a vector of label names for each line.

Value

No return value. plot_comp() plots the effect of varying compensation on the minimum subclass output for every cell subclass. plot_path() plots the coefficient paths for either each bulk sample for the subclass specified by subclass, or all subclasses for a single sample specified by sample.


cellGeometry documentation built on April 20, 2026, 1:06 a.m.