Learn R Programming

MixviR (version 3.5.0)

get_codons: Get Codons From Gene Sequence

Description

Group a gene sequence into codons (triplets) that can be used for subsequent translation. If any elements of the character vector have length >1 (insertions in ALT column of VCF), they are trimmed to the first base. Used by id.snps, id.indels, and create_ref functions.

Usage

get_codons(gene.seq, rev = FALSE)

Value

A character vector containing translated amino acids associated with each nucleotide position in the input vector.

Arguments

gene.seq

Character vector containing gene sequence. The length of this vector should be equal to the length of sequence.

rev

Logical indicating whether the reverse complement of the gene.seq should be used.

Examples

Run this code
get_codons(gene.seq = c("A","U","G","C","A","T","T","T","A","C","A","G","T","A","A"))

Run the code above in your browser using DataLab