[1c0e03]: / man / heatmaps_integrated_grad.Rd

Download this file

38 lines (35 with data), 1.6 kB

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