This function generates sequence of elements from alphabet with replacement

generate_negative_sequence(
  sequence_length,
  alphabet,
  motifs,
  seqProbs = NULL,
  attempts = 100
)

Arguments

sequence_length

sequence length

alphabet

elements used to build sequence

motifs

list of motifs

seqProbs

alphabet probabilities for sequences

Value

randomly generated sequences

Examples

set.seed(2)
alph <- 1:4
motifs <- generate_motifs(alph, 3, 3, 3, 2)
generate_negative_sequence(5, alph, motifs)
#> [1] 3 1 1 4 2
generate_negative_sequence(10, c("a", "b", "c"), motifs)
#>  [1] "b" "c" "c" "a" "c" "a" "a" "c" "a" "b"
generate_negative_sequence(10, c("a", "b", "c"), c(0.6, 0.2, 0.2), motifs)
#> Error in sample.int(length(x), size, replace, prob): 'list' object cannot be coerced to type 'double'