This function generates random motif based on a given alphabet. The maximum range of a motif equals `n + d`.

generate_motif(alphabet, n, d, motifProbs = NULL)

Arguments

alphabet

elements used to generate a motif

n

maximum number of alphabet elements

d

number of possible gaps

motifProbs

alphabet elements' probabilites

Value

motif built on a given alphabet

Examples

generate_motif(1:4, n = 2, d = 0)
#> [1] 1
generate_motif(c("a", "b", "c"), n = 6, d = 1)
#> [1] "b" "a" "_" "c"
generate_motif(1:4, n = 6, d = 2, motifProbs = c(0.7, 0.1, 0.1, 0.1))
#> [1] "1" "1" "1" "1" "_" "3" "_" "2"