a b/man/heatmaps_integrated_grad.Rd
1
% Generated by roxygen2: do not edit by hand
2
% Please edit documentation in R/visualization.R
3
\name{heatmaps_integrated_grad}
4
\alias{heatmaps_integrated_grad}
5
\title{Heatmap of integrated gradient scores}
6
\usage{
7
heatmaps_integrated_grad(integrated_grads, input_seq)
8
}
9
\arguments{
10
\item{integrated_grads}{Matrix of integrated gradient scores (output of \code{\link{integrated_gradients}} function).}
11
12
\item{input_seq}{Input sequence for model. Should be the same as \code{input_seq} input for corresponding
13
\code{\link{integrated_gradients}} call that computed input for \code{integrated_grads} argument.}
14
}
15
\value{
16
A list of heatmaps.
17
}
18
\description{
19
Creates a heatmap from output of \code{\link{integrated_gradients}} function. The first row contains
20
the column-wise absolute sums of IG scores and the second row the sums. Rows 3 to 6 contain the IG scores for each
21
position and each nucleotide. The last row contains nucleotide information.
22
}
23
\examples{
24
\dontshow{if (reticulate::py_module_available("tensorflow")  && requireNamespace("ComplexHeatmap", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
25
library(reticulate)
26
model <- create_model_lstm_cnn(layer_lstm = 8, layer_dense = 3, maxlen = 20, verbose = FALSE)
27
random_seq <- sample(0:3, 20, replace = TRUE)
28
input_seq <- array(keras::to_categorical(random_seq), dim = c(1, 20, 4))
29
ig <- integrated_gradients(
30
  input_seq = input_seq,
31
  target_class_idx = 3,
32
  model = model)
33
heatmaps_integrated_grad(integrated_grads = ig,
34
                         input_seq = input_seq)
35
 
36
\dontshow{\}) # examplesIf}
37
}