|
a |
|
b/man/load_prediction.Rd |
|
|
1 |
% Generated by roxygen2: do not edit by hand |
|
|
2 |
% Please edit documentation in R/predict.R |
|
|
3 |
\name{load_prediction} |
|
|
4 |
\alias{load_prediction} |
|
|
5 |
\title{Read states from h5 file} |
|
|
6 |
\usage{ |
|
|
7 |
load_prediction( |
|
|
8 |
h5_path, |
|
|
9 |
rows = NULL, |
|
|
10 |
verbose = FALSE, |
|
|
11 |
get_sample_position = FALSE, |
|
|
12 |
get_seq = FALSE |
|
|
13 |
) |
|
|
14 |
} |
|
|
15 |
\arguments{ |
|
|
16 |
\item{h5_path}{Path to h5 file.} |
|
|
17 |
|
|
|
18 |
\item{rows}{Range of rows to read. If \code{NULL} read everything.} |
|
|
19 |
|
|
|
20 |
\item{verbose}{Boolean.} |
|
|
21 |
|
|
|
22 |
\item{get_sample_position}{Return position of sample corresponding to state if \code{TRUE}.} |
|
|
23 |
|
|
|
24 |
\item{get_seq}{Return nucleotide sequence if \code{TRUE}.} |
|
|
25 |
} |
|
|
26 |
\value{ |
|
|
27 |
A list of data frames, containing model predictions and sequence positions. |
|
|
28 |
} |
|
|
29 |
\description{ |
|
|
30 |
Reads h5 file created by \code{\link{predict_model}} function. |
|
|
31 |
} |
|
|
32 |
\examples{ |
|
|
33 |
\dontshow{if (reticulate::py_module_available("tensorflow")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} |
|
|
34 |
# make prediction for single sequence and write to h5 file |
|
|
35 |
model <- create_model_lstm_cnn(maxlen = 20, layer_lstm = 8, layer_dense = 2, verbose = FALSE) |
|
|
36 |
vocabulary <- c("a", "c", "g", "t") |
|
|
37 |
sequence <- paste(sample(vocabulary, 200, replace = TRUE), collapse = "") |
|
|
38 |
output_file <- tempfile(fileext = ".h5") |
|
|
39 |
predict_model(output_format = "one_seq", model = model, step = 10, |
|
|
40 |
sequence = sequence, filename = output_file, mode = "label") |
|
|
41 |
load_prediction(h5_path = output_file) |
|
|
42 |
\dontshow{\}) # examplesIf} |
|
|
43 |
} |