Skip to contents

A tales object plus an alignment_position column. Gaps are implicit: a gap is simply the absence of a row at that (array_id, alignment_position).

Usage

tales_msa(x, alignment_width = NULL, dom_code_namespace = NULL)

Arguments

x

A data frame with the tales columns plus alignment_position.

alignment_width

Integer alignment width; defaults to max(alignment_position).

dom_code_namespace

Optional scalar string, see tales_namespace.

Value

A validated tales_msa object.

Details

Normally produced by tales_align rather than called directly.

Examples

# A hand-built alignment: A2 has a gap at position 2 relative to A1.
aligned <- data.frame(
  array_id = c("A1", "A1", "A1", "A2", "A2"),
  position_in_array = c(1L, 2L, 3L, 1L, 2L),
  alignment_position = c(1L, 2L, 3L, 1L, 3L),
  rvd = c("NTERM", "HD", "CTERM", "NTERM", "CTERM")
)
msa <- tales_msa(aligned)
tales_msa_width(msa)
#> [1] 3
as.matrix(msa)
#>    1       2    3      
#> A1 "NTERM" "HD" "CTERM"
#> A2 "NTERM" NA   "CTERM"