Generate random bstr sequences of desired lengths.

bstr_rand_seq(n, length, pattern = "[A-Za-z]", seed)

dstr_rand_seq(n, length, pattern = "[ATGC]", seed)

astr_rand_seq(n, length, pattern = "[ARNDCQEGHILKMFPSTWYVX]", seed)

Arguments

n

single integer, nubmer of sequences

length

integer vector, desired sequence lengths

pattern

character vector specifying character classes

seed

a single integer. specify seeds.

Examples

bstr_rand_seq(3, 20, seed = 1)
#> class: bstr,character #> number of sequences: 3 #> [1] no name 1 : NTdvKuxigDKJjToZlzTo 20 #> [2] no name 2 : wLhGNUATtRZfZJripFlV 20 #> [3] no name 3 : qhocbpBYmkYsWMDFQaiV 20
bstr_rand_seq(3, 5:7, c("[a-c]", "[A-C]", "[1-3]"), seed = 1)
#> class: bstr,character #> number of sequences: 3 #> [1] no name 1 : abbca 5 #> [2] no name 2 : CCBBAA 6 #> [3] no name 3 : 1323233 7
dstr_rand_seq(3, 20, seed = 1)
#> class: dstr,bstr,character #> number of sequences: 3 #> [1] no name 1 : CCGTATTGGAAAGCTCGTCT 20 #> [2] no name 2 : TAGACCACTCCGCATGTAGC 20 #> [3] no name 3 : TGTGGTACGGCTCAAACGGC 20
dstr_rand_seq(3, 5:7, c("[atcg]", "[ATCG]", "[N.]"), seed = 1)
#> class: dstr,bstr,character #> number of sequences: 3 #> [1] no name 1 : ccgta 5 #> [2] no name 2 : TTGGAA 6 #> [3] no name 3 : .N.N.NN 7
astr_rand_seq(3, 20, seed = 1)
#> class: astr,bstr,character #> number of sequences: 3 #> [1] no name 1 : GIPXFWXQQCFERKTMSYIT 20 #> [2] no name 2 : XFQDGKAKWIMPMEVRTDSK 20 #> [3] no name 3 : VQTNNTAMSRMWLGCDHMQK 20
astr_rand_seq(3, 5:7, c("[arnd]", "[ARND]", "[X.]"), seed = 1)
#> class: astr,bstr,character #> number of sequences: 3 #> [1] no name 1 : ddnra 5 #> [2] no name 2 : RRNNAA 6 #> [3] no name 3 : .X.X.XX 7