Learn R Programming

cellGeometry (version 0.5.7)

plot_residuals: Residuals plot

Description

Plots residuals from a deconvolution result object against bulk gene expression (on semi-log axis). Normal residuals, weighted residuals or Studentized residuals can be visualised to check for heteroscedasticity and genes with extreme errors.

Usage

plot_residuals(
  fit,
  test,
  type = c("reg", "student", "weight"),
  show_outliers = TRUE,
  show_plot = TRUE,
  ...
)

ggplot_residuals( fit, test, type = c("reg", "student", "weight"), show_outliers = TRUE )

Value

Produces a scatter plot in base graphics. Returns invisibly a dataframe of the coordinates of the points. The ggplot version returns a ggplot2 plotting object.

Arguments

fit

'deconv' class deconvolution object

test

bulk gene expression matrix assumed to be in raw counts

type

Specifies type of residuals to be plotted

show_outliers

Logical whether to show any remaining outlying extreme genes in red

show_plot

Logical whether to show plot using base graphics (used to allow return of dataframe of points without plotting)

...

Optional arguments passed to plot()