Skip to contents

This function obtains GradCAM heatmap values for each cell in the original flow cytometric space, mapping the `Angle` and `Intensity` image dimensions (pixels) back to the corresponding cells.

Usage

plotInverseGradCAM(
  x,
  feature_matrix,
  xaxis = "Red_log",
  yaxis = "Blue_log",
  xlim = NULL,
  ylim = NULL,
  title = "GradCAM",
  color_bar = TRUE,
  n_resolution = 100,
  transpose = TRUE
)

Arguments

x

A `TockyPrepData` object containing the original flow cytometry data.

feature_matrix

A 100 x 100 matrix representing the GradCAM output.

xaxis

The name of the dataframe column to be used as x-axis in the plot (default 'Red_log').

yaxis

The name of the dataframe column to be used as y-axis in the plot (default 'Blue_log').

xlim

Optional vector of length 2 defining the x-axis limits.

ylim

Optional vector of length 2 defining the y-axis limits.

title

Character string specifying the title of the plot.

color_bar

Logical indicating whether to include a color bar in the plot (default TRUE).

n_resolution

Binning resolution. The default is 100.

transpose

Logical Whether to tranpose feature_matrix input. Note that TockyConvNetPy output Grad-CAM matrix for feature_matrix typically needs to be transposed. The default is TRUE.

Value

Invisibly returns the unmodified `TockyPrepData` object.

Examples

if (FALSE) { # \dontrun{
  feature_matrix <- read.csv('heatmap.csv')
  par(mfrow= c(1,2))
  plotInverseGradCAM(x, feature_matrix, color_bar = TRUE)
} # }