seq_to_codons: Convert a coding sequence to a codon vector

View source: R/sequences.R

seq_to_codonsR Documentation

Convert a coding sequence to a codon vector

Description

seq_to_codons converts a coding sequence (CDS) into a vector of codons by splitting the sequence into non-overlapping triplets starting from the first position.

Usage

seq_to_codons(seq)

Arguments

seq

A coding sequence as a DNAString object, or any object that can be coerced to a DNAString (e.g., character string).

Value

A character vector where each element represents a codon (3-nucleotide sequence).

Examples

# Convert a CDS sequence to a sequence of codons
seq_to_codons('ATGTGGTAG')
seq_to_codons(yeast_cds[[1]])


cubar documentation built on Aug. 21, 2025, 5:40 p.m.