Learn R Programming

tcR (version 2.3.2)

codon.variants: Functions for working with aminoacid sequences.

Description

codon.variants - get all codon variants for the given nucleotide sequence with known corresponding aminoacid sequence.

translated.nucl.variants - get number of nucleotide sequences which can be translated to the given aminoacid sequence.

reverse.translation - get all nucleotide sequences, which can be traslated to the given aminoacid sequence.

Usage

codon.variants(.aaseq, .nucseq = sapply(1:length(.aaseq), 
               function (i) paste0(rep('XXX', times = nchar(.aaseq[i])),
               collapse = '')))

translated.nucl.sequences(.aaseq, .nucseq = sapply(1:length(.aaseq), function (i) paste0(rep('XXX', times = nchar(.aaseq[i])), collapse = '')))

reverse.translation(.aaseq, .nucseq = paste0(rep('XXX', times = nchar(.aaseq)), collapse = ''))

Arguments

.aaseq

Amino acid sequence.

.nucseq

Nucleotide sequence with 'X' letter at non-fixed positions. Other positions will be fixed.

Value

List with all possible variants for every aminoacid in .aaseq, number of sequences or character vector of candidate sequences.

Examples

Run this code
# NOT RUN {
codon.variants('ACT')
translated.nucl.sequences(c('ACT', 'CASSLQ'))
reverse.translation('T')  # -> "ACA" "ACC" "ACG" "ACT"
reverse.translation('T', 'XXT')  # -> "ACT"
translated.nucl.sequences('ACT', 'XXXXXXXC')
codon.variants('ACT', 'XXXXXXXC')
reverse.translation('ACT', 'XXXXXXXC')
# }

Run the code above in your browser using DataLab