Skip to contents

As format.tales, plus the alignment width, and a preview of aligned rows: gaps are drawn and every cell padded to a common width, so the columns line up down the page.

Usage

# S3 method for class 'tales_msa'
format(x, n = 2L, gap = "-", ...)

Arguments

x

A tales_msa object.

n

Number of arrays to show at each end.

gap

What to draw where an array has no residue at a position.

...

Unused, present for compatibility with the format generic.

Value

A character vector, one element per line.

Examples

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)
format(msa)
#> [1] "\033[34m<tales_msa>\033[39m 2 arrays, 3 alignment positions"
#> [2] "  layers: rvd"                                              
#> [3] "      rvd"                                                  
#> [4] "  A1  NTERM    HD CTERM"                                    
#> [5] "  A2  NTERM     - CTERM"