plot_pred: Scatter plot to compare deconvoluted subclasses

plot_predR Documentation

Scatter plot to compare deconvoluted subclasses

Description

Produces a single scatter plot using base graphics to compare actual cell counts against deconvoluted cell counts from bulk (or pseudo-bulk) RNA-Seq Cell subclasses are shown in different colours. Designed for use if ground truth is available, e.g. for simulated pseudo-bulk RNA-Seq data.

Usage

plot_pred(
  obs,
  pred,
  mk = NULL,
  scheme = NULL,
  ellipse = NULL,
  labels = TRUE,
  main = ""
)

Arguments

obs

Observed matrix of cell amounts with subclasses in columns and samples in rows.

pred

Predicted (deconvoluted) matrix of cell amounts with rows and columns matching obs. Alternatively a 'deconv' class fitted model can be supplied and its ⁠$subclass$output⁠ cell counts element will be used.

mk

Optional matching cellMarkers object. This is used for its cell_table element to try to colour subclasses by group.

scheme

Vector of colours, one for each cell subclass.

ellipse

Either a single number for the number of ellipses to plot, in which case ellipses are shown for cell subclasses with the lowest R^2; or a character vector of cell subclasses to be outlined with ellipses. Requires the ggforce package to be installed.

labels

Logical whether to add labels to ellipses.

main

Title to add to plot.

Value

A ggplot2 scatter plot. An overall R^2 (coefficient of determination) comparing all observed and predicted results is shown.


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