Compute a logical matrix corresponding to the input align
input with TRUE where an element matches the consensus at that
position and FALSE where it does not. Columns with no consensus –
see tales_consensus – are NA throughout, since
there is nothing there to match.
Arguments
- align
A TALE alignment as a character matrix, one row per array and one column per alignment position, with
NAfor gaps.as.matrix()on atales_msareturns one (seeas.matrix.tales_msa), filled with RVDs or domain codes.- long
Set to
TRUE(default) to return a long tibble, orFALSEto return a logical matrix with the same shape asalign.
Value
A multiple Tal sequences alignment in the form of a
matrix filled with logical values if long is FALSE and
a long tibble representing the original alignment otherwise (default).
See also
Other TALE alignment:
as.matrix.tales_msa(),
is_tales_msa(),
tales_align(),
tales_consensus(),
tales_msa(),
tales_msa_params(),
tales_msa_width(),
validate_tales_msa()
Examples
aln <- matrix(c("HD", "HD", "NI",
"NG", "NI", "HD"),
nrow = 3, dimnames = list(c("A1", "A2", "A3"), NULL))
tales_consensus_match(aln, long = FALSE)
#> [,1] [,2]
#> A1 TRUE NA
#> A2 TRUE NA
#> A3 FALSE NA
tales_consensus_match(aln)
#> # A tibble: 6 × 3
#> array_id alignment_position tales_consensus_match
#> <fct> <fct> <lgl>
#> 1 A1 A TRUE
#> 2 A2 A TRUE
#> 3 A3 A FALSE
#> 4 A1 B NA
#> 5 A2 B NA
#> 6 A3 B NA