codon.variants: Functions for working with aminoacid sequences.

Description Usage Arguments Value Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
5
6
7
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')

tcR documentation built on July 2, 2020, 3:18 a.m.