| slide_codon | R Documentation |
slide_codon creates sliding window intervals specifically designed
for codon-based analysis of DNA sequences. This function automatically
handles codon boundaries and is useful for studying positional effects
in codon usage within genes.
slide_codon(seq, step = 1, before = 0, after = 0)
seq |
A DNA sequence as a DNAString object, or any object that can be coerced to DNAString. |
step |
Integer specifying the step size between consecutive window centers in codons (default: 1). A step of 3 creates non-overlapping windows. |
before |
Integer specifying the number of codons to include before the window center (default: 0). |
after |
Integer specifying the number of codons to include after the window center (default: 0). |
A data.table with three columns containing nucleotide positions:
start: Start nucleotide position of each window
center: Center nucleotide position of each window
end: End nucleotide position of each window
# Create sliding windows for codon analysis
x <- Biostrings::DNAString('ATCTACATAGCTACGTAGCTCGATGCTAGCATGCATCGTACGATCGTCGATCGTAG')
slide_codon(x, step = 3, before = 1, after = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.