codon_to_aa: Convert codons to amino acids

Description Usage Arguments Value Examples

View source: R/codon_to_aa.R

Description

Takes a character vector of codons and converts them to their amino acids. Useful for creating an amino acid column from a column of codons, in order to facet a plot for example.

Usage

1
codon_to_aa(x, seq_type = c("DNA", "RNA"))

Arguments

x

Character vector of three nucleotide codons

seq_type

Character value of either "DNA" or "RNA" depending on whether "T" or "U" is used in the sequence.

Value

Character vector of amino acids

Examples

1
2
3
4
codon_to_aa(c('CAT', 'GAC', 'TTT', 'ATG'), seq_type = 'DNA')
codon_to_aa('GAT', seq_type = 'DNA')
codon_to_aa(c('CAU', 'GAC', 'UUU', 'AUG'), seq_type = 'RNA')
codon_to_aa('GAU', seq_type = 'RNA')

ryanmcnamara4/myPackage documentation built on Dec. 22, 2021, 8:18 p.m.