DNAToNumerical: Convert DNAStringSet object into one-hot encoding

View source: R/DNAToNumerical.R

DNAToNumericalR Documentation

Convert DNAStringSet object into one-hot encoding

Description

Convert DNAStringSet object into one-hot encoding

Usage

DNAToNumerical(
  x,
  tabv = c(T = 4, G = 3, C = 2, A = 1),
  lower.case = F,
  seq.size = 201
)

Arguments

x

DNAStringSet object

tabv

named vector list of numerical values which indicate the numerical value of a nucleotide.

lower.case

Set to TRUE if the DNA in your sequence is encoded in lower.case i.e. "acgt", default set to FALSE.

seq.size

Set the sequence maximal length value authorized by our model (default to 201).

Value

An array of dimension nrow(x),ncol(x),length(tabv)

Examples

x <- Biostrings::DNAStringSet(c("ACGT"))
x_onehot <- DNAToNumerical(x)
x_onehot

morphos30/DeepG4 documentation built on June 11, 2022, 10:38 p.m.