Skip to contents

Checks every validate_tales invariant, then those specific to an alignment. As for tales, only properties that still hold on any subset of rows are checked here; grid completeness is a precondition of the functions that need it.

Usage

validate_tales_msa(x)

Arguments

x

A tales_msa object.

Value

x, invisibly, if valid; otherwise an error.

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")
)
validate_tales_msa(tales_msa(aligned))

# Two parts of A1 placed in the same alignment column
aligned$alignment_position[2] <- 1L
try(tales_msa(aligned))
#> Error in validate_tales_msa(new_tales_msa(x, alignment_width = alignment_width)) : 
#>   alignment_position must be unique within an array.