regenerate: Regenerate n-grams

Description Usage Arguments Value Note See Also Examples

View source: R/regenerate.R

Description

'Regenerates' amino acid or nucleic sequence written in a simplified alphabet by converting groups to regular expression.

Usage

1
regenerate(x, element_groups)

Arguments

x

character string representing single n-gram.

element_groups

encoding of elements: list of groups to which elements of sequence should be aggregated. Must have unique names.

Value

A character string representing a POSIX regular expression.

Note

Gaps (_) will be converted to any possible character from the alphabet (nucleotides or amino acids).

See Also

degenerate to easily convert information stored in biological sequences from letters to numbers. calc_ed to calculate distance between simplified alphabets.

Examples

1
regenerate("ssw", list(w = c(1, 4), s = c(2, 3)))

biogram documentation built on March 31, 2020, 5:14 p.m.