Description Usage Arguments Details Value See Also Examples
View source: R/create_encoding.R
Checks the structure of an encoding.
1 | validate_encoding(x, u)
|
x |
encoding. |
u |
|
The encoding is a list of groups to which elements of an alphabet should be reduced. All elements of the alphabet (all amino acids or all nucleotides) should appear in the encoding.
TRUE
if the x
is a correctly reduced u
,
FALSE
in any other cases.
calc_ed
: calculate the encoding distance between two encodings.
encoding2df
: converts an encoding to a data frame.
1 2 3 4 5 6 7 8 9 10 11 12 | enc1 = list(`1` = c("a", "t"),
`2` = c("g", "c"))
# see if enc1 is the correctly reduced nucleotide (DNA) alphabet
validate_encoding(enc1, c("a", "c", "g", "t"))
# enc1 is not the RNA alphabet, so the results is FALSE
validate_encoding(enc1, c("a", "c", "g", "u"))
# validate_encoding works also on other notations
enc2 = list(a = c(1, 4),
b = c(2, 3))
validate_encoding(enc2, 1L:4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.