Split sequences into k-mers

seq_split_kmer(x, k)

Arguments

x

A DNA, RNA or AA vector.

k

an integer giving the size of the k-mer.

Value

a list of k-mer vectors of same class as x.

Examples


x <- dna(a ="ACGTTAGTGTAGCCGT", b = "CTCGAAATGA")
seq_split_kmer(x, k = 5)
#> $a
#> DNA vector of 12 sequences
#> >   ACGTT
#> >   CGTTA
#> >   GTTAG
#> >   TTAGT
#> >   TAGTG
#> >   AGTGT
#> >   GTGTA
#> >   TGTAG
#> >   GTAGC
#> >   TAGCC
#> >   AGCCG
#> >   GCCGT
#> 
#> $b
#> DNA vector of 6 sequences
#> >   CTCGA
#> >   TCGAA
#> >   CGAAA
#> >   GAAAT
#> >   AAATG
#> >   AATGA
#>