This function spells out nucleotides and amino acids in sequences.

seq_spellout(x, short = FALSE, collapse = " - ")

Arguments

x

a DNA, RNA or AA vector

short

logical. If TRUE, the function will return 3-letters short names for amino acids (ignored for DNA and RNA).

collapse

a character vector to separate the results. Set to NULL to avoid collapsing the results.

Value

A character vector if collapse is not NULL. A list of character vectors otherwise.

See also

Examples

x <- dna("ACGT")
seq_spellout(x)
#> [1] "adenine - cytosine - guanine - thymine"

x <- rna("ACGU")
seq_spellout(x)
#> [1] "adenine - cytosine - guanine - uracil"

x <- aa("ACGBTX")
seq_spellout(x)
#> [1] "alanine - cysteine - glycine - asparagine or aspartic acid - threonine - any"