one_hot_vector: One-hot encoding of DNA nucleotide string

Description Usage Arguments Value Author(s) See Also Examples

Description

Inputs a string composed of nucleotides and outputs a zero-padded vector of encodings.

Usage

1
one_hot_vector(dnastr, zeros_len, max_len)

Arguments

dnastr

Character string composed of nucleotides A, C, G, T.

zeros_len

Integer value denoting number of zeros to pad vector with. Commonly the convolutional filter length - 1.

max_len

Integer value denoting the maximum sequence length. Used in the padding calculation to account for shorter sequences.

Value

Zero-padded vector of one-hot encodings. If the input is of length L and with padding of length Z the output is of length 4(L+2Z).

Author(s)

Matthew Ploenzke, ploenzke@g.harvard.edu

See Also

one_hot

Examples

1
one_hot(paste(sample(c('A','C','G','T'),100,replace=TRUE),collapse=''),10)

mPloenzke/learnMotifs documentation built on May 27, 2019, 11:55 a.m.