This function generates sequences (both positive & negative).

generate_sequence_data(
  n_seq,
  sequence_length,
  alphabet,
  motifs,
  n_injections,
  fraction = 0.5,
  seqProbs = NULL
)

Arguments

n_seq

number of sequences to be generated

sequence_length

sequence length

alphabet

elements used to build sequence

motifs

list of motifs

n_injections

maximal number of motifs injected to each positive sequence (from 1 to n_injections will be injected)

fraction

fraction of positive sequences

seqProbs

alphabet probabilities for sequences

Value

generated sequences with motifs injected

Examples

n_seq <- 20
sequence_length <- 10
alph <- 1L:4
motifs <- generate_motifs(alph, 3, 3, 3, 2)
generate_sequence_data(n_seq, sequence_length, alph, motifs, 3)
#>       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#>  [1,] "2"  "3"  "2"  "1"  "2"  "1"  "3"  "1"  "1"  "2"  
#>  [2,] "4"  "1"  "4"  "3"  "4"  "3"  "1"  "4"  "4"  "4"  
#>  [3,] "3"  "4"  "2"  "4"  "1"  "3"  "1"  "4"  "2"  "4"  
#>  [4,] "2"  "4"  "1"  "1"  "4"  "4"  "1"  "1"  "1"  "3"  
#>  [5,] "4"  "4"  "4"  "4"  "1"  "3"  "4"  "4"  "2"  "3"  
#>  [6,] "1"  "3"  "2"  "1"  "3"  "1"  "4"  "2"  "4"  "4"  
#>  [7,] "4"  "1"  "3"  "1"  "4"  "2"  "4"  "3"  "4"  "2"  
#>  [8,] "3"  "4"  "3"  "2"  "3"  "2"  "2"  "4"  "2"  "4"  
#>  [9,] "1"  "3"  "4"  "4"  "2"  "4"  "1"  "1"  "2"  "4"  
#> [10,] "2"  "4"  "1"  "3"  "2"  "3"  "2"  "4"  "4"  "2"  
#> [11,] "2"  "2"  "4"  "2"  "1"  "3"  "1"  "4"  "2"  "1"  
#> [12,] "1"  "4"  "2"  "1"  "1"  "2"  "3"  "2"  "1"  "4"  
#> [13,] "1"  "1"  "3"  "2"  "2"  "4"  "2"  "4"  "1"  "2"  
#> [14,] "3"  "1"  "1"  "4"  "3"  "1"  "1"  "1"  "4"  "4"  
#> [15,] "4"  "2"  "2"  "2"  "2"  "4"  "1"  "2"  "4"  "2"  
#> [16,] "4"  "1"  "3"  "2"  "1"  "2"  "4"  "3"  "2"  "1"  
#> [17,] "1"  "3"  "2"  "1"  "2"  "2"  "4"  "1"  "3"  "1"  
#> [18,] "4"  "4"  "1"  "1"  "1"  "4"  "3"  "2"  "3"  "1"  
#> [19,] "4"  "2"  "2"  "3"  "2"  "4"  "3"  "1"  "3"  "4"  
#> [20,] "3"  "4"  "4"  "2"  "2"  "2"  "1"  "4"  "4"  "2"  
#> attr(,"max_injection")
#> [1] 3
#> attr(,"motifs_map")
#>       [,1] [,2] [,3]
#>  [1,]    0    0    1
#>  [2,]    1    0    0
#>  [3,]    1    1    1
#>  [4,]    1    0    0
#>  [5,]    1    0    1
#>  [6,]    0    0    1
#>  [7,]    1    1    1
#>  [8,]    0    1    0
#>  [9,]    1    1    1
#> [10,]    0    0    1
#> [11,]    0    0    0
#> [12,]    0    0    0
#> [13,]    0    0    0
#> [14,]    0    0    0
#> [15,]    0    0    0
#> [16,]    0    0    0
#> [17,]    0    0    0
#> [18,]    0    0    0
#> [19,]    0    0    0
#> [20,]    0    0    0
#> attr(,"masks")
#> attr(,"masks")[[1]]
#> attr(,"masks")[[1]][[1]]
#>  [1] FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE
#> 
#> 
#> attr(,"masks")[[2]]
#> attr(,"masks")[[2]][[1]]
#>  [1]  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE
#> 
#> 
#> attr(,"masks")[[3]]
#> attr(,"masks")[[3]][[1]]
#>  [1] FALSE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> 
#> attr(,"masks")[[3]][[2]]
#>  [1] FALSE FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE
#> 
#> attr(,"masks")[[3]][[3]]
#>  [1] FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE
#> 
#> 
#> attr(,"masks")[[4]]
#> attr(,"masks")[[4]][[1]]
#>  [1] FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE
#> 
#> 
#> attr(,"masks")[[5]]
#> attr(,"masks")[[5]][[1]]
#>  [1] FALSE FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE
#> 
#> attr(,"masks")[[5]][[2]]
#>  [1] FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE
#> 
#> 
#> attr(,"masks")[[6]]
#> attr(,"masks")[[6]][[1]]
#>  [1] FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE
#> 
#> 
#> attr(,"masks")[[7]]
#> attr(,"masks")[[7]][[1]]
#>  [1] FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE
#> 
#> attr(,"masks")[[7]][[2]]
#>  [1]  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE
#> 
#> attr(,"masks")[[7]][[3]]
#>  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE
#> 
#> 
#> attr(,"masks")[[8]]
#> attr(,"masks")[[8]][[1]]
#>  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE FALSE
#> 
#> 
#> attr(,"masks")[[9]]
#> attr(,"masks")[[9]][[1]]
#>  [1] FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE
#> 
#> attr(,"masks")[[9]][[2]]
#>  [1] FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE
#> 
#> attr(,"masks")[[9]][[3]]
#>  [1]  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE
#> 
#> 
#> attr(,"masks")[[10]]
#> attr(,"masks")[[10]][[1]]
#>  [1] FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE FALSE FALSE
#> 
#> 
#> attr(,"target")
#>  [1]  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE FALSE FALSE
#> [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> attr(,"motifs_set")
#> attr(,"motifs_set")[[1]]
#> [1] "4" "1" "_" "_" "4"
#> 
#> attr(,"motifs_set")[[2]]
#> [1] "4" "2"
#> 
#> attr(,"motifs_set")[[3]]
#> [1] "1" "3" "_" "_" "2"
#>