[1c0e03]: / man / one_hot_to_seq.Rd

Download this file

37 lines (31 with data), 970 Bytes

 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocess.R
\name{one_hot_to_seq}
\alias{one_hot_to_seq}
\title{Char sequence corresponding to one-hot matrix.}
\usage{
one_hot_to_seq(
m,
vocabulary = c("A", "C", "G", "T"),
amb_enc = "zero",
amb_char = "N",
paste_chars = TRUE
)
}
\arguments{
\item{m}{One-hot encoding matrix or 3d array where each element of first axis is one-hot matrix.}
\item{vocabulary}{Vector of allowed characters. Characters outside vocabulary get encoded as specified in \code{ambiguous_nuc}.}
\item{amb_enc}{Either \code{"zero"} or \code{"equal"}. How oov tokens where treated for one-hot encoding.}
\item{amb_char}{Char to use for oov positions.}
\item{paste_chars}{Whether to return vector or single sequence.}
}
\value{
A string.
}
\description{
Return character sequence corresponding to one-hot elements in matrix or tensor.
}
\examples{
m <- matrix(c(1,0,0,0,0,1,0,0), 2)
one_hot_to_seq(m)
}