seq_to_codons
converts a coding sequence to a vector of codons
Examples
# convert a CDS sequence to a sequence of codons
seq_to_codons('ATGTGGTAG')
#> [1] "ATG" "TGG" "TAG"
seq_to_codons(yeast_cds[[1]])
#> [1] "ATG" "AGT" "TCC" "CGG" "TTT" "GCA" "AGA" "AGT" "AAT" "GGC" "AAT" "CCC"
#> [13] "AAC" "CAC" "ATT" "AGG" "AAA" "AGA" "AAT" "CAT" "TCT" "CCA" "GAC" "CCA"
#> [25] "ATA" "GGA" "ATT" "GAT" "AAT" "TAT" "AAA" "AGA" "AAA" "AGA" "CTA" "ATT"
#> [37] "ATA" "GAT" "TTA" "GAG" "AAT" "TTA" "TCC" "TTA" "AAT" "GAT" "AAA" "GGG"
#> [49] "CCC" "AAG" "AAC" "GGA" "CAT" "GCA" "GAT" "GAT" "AAC" "AAT" "CTT" "ATT"
#> [61] "CAT" "AAC" "AAT" "ATA" "GTA" "TTC" "ACA" "GAC" "GCT" "ATT" "GAT" "GAT"
#> [73] "AAG" "GTC" "CTG" "AAA" "GAG" "ATC" "ATC" "AAG" "TGT" "TCC" "ACA" "AGT"
#> [85] "AAA" "CGC" "GGC" "GAC" "AAT" "GAC" "TTG" "TTT" "TAT" "GAC" "AAA" "ATA"
#> [97] "TGG" "GAA" "CGT" "TTG" "AGA" "GAA" "AAA" "AGG" "CTA" "CAA" "ATA" "ATA"
#> [109] "AAA" "TGG" "GTA" "GAT" "TAT" "AAG" "GAA" "ATT" "GCT" "TAT" "CTA" "AGC"
#> [121] "TGG" "TGG" "AAG" "TGG" "TTC" "CAT" "AAT" "CAA" "ATG" "ACT" "TCG" "AAA"
#> [133] "TAC" "ACT" "TAT" "GAT" "GGA" "GAG" "GCT" "GAT" "ACC" "GAT" "GTT" "GAA"
#> [145] "ATG" "ATG" "GCA" "GTG" "GAT" "ACT" "GAT" "GTG" "GAT" "ATG" "GAT" "GCG"
#> [157] "TAA"