Learn R Programming

cubar (version 1.2.0)

seq_to_codons: 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)

Value

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

Arguments

seq

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

Examples

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

Run the code above in your browser using DataLab