Skip to contents

slide_codon generates a data.table with start, center, and end columns for a sliding window analysis of codons.

Usage

slide_codon(seq, step = 1, before = 0, after = 0)

Arguments

seq

DNAString, the sequence

step

integer, the step size

before

integer, the number of codons before the center of a window

after

integer, the number of codons after the center of a window

Value

data.table with start, center, and end columns

Examples

x <- Biostrings::DNAString('ATCTACATAGCTACGTAGCTCGATGCTAGCATGCATCGTACGATCGTCGATCGTAG')
slide_codon(x, step = 3, before = 1, after = 1)
#>    start center   end
#>    <num>  <num> <num>
#> 1:     1      4     9
#> 2:    10     13    18
#> 3:    19     22    27
#> 4:    28     31    36
#> 5:    37     40    45
#> 6:    46     49    54