The function perform reverse translation of amino acid sequences. Such operation does not exist in nature but is provided for completeness. Because of codon degeneracy it is expected to produce many ambiguous nucleotides.

seq_rev_translate(x, code = 1)

Arguments

x

an amino acid sequence (bioseq_aa)

code

an integer indicating the genetic code to use for reverse translation (default 1 uses the Standard genetic code). See Details.

Value

a vector of DNA sequences.

Details

Gaps (-) are interpreted as unknown amino acids (X) but can be removed prior to the translation with the function seq_remove_gap.

See also

Other biological operations: rev_complement, seq_translate(), transcription

Examples


x <- dna("ACTTTGGCTAAG")
y <- seq_translate(x)
z <- seq_rev_translate(y)
z
#> DNA vector of 1 sequences
#> >   ACNYTNGCNAAR
# There is a loss of information during the reverse translation
all.equal(x, z)
#> [1] "1 string mismatch"