Chapters and reference
Complete canonical API text; task articles explain the workflows. Usage guide

Map exact alignment columns and source positions
Source:R/data-alignment.R
map_alignment_position.RdLooks up existing cells within one alignment row. Never interpolates across gaps or discarded columns. Filter an alignment with ordinary data operations before looking up positions to restrict the available window.
Arguments
- data
Long alignment frame from
as_ggchord_alignment().- accver
One alignment-row ID, even if its
source_accverdiffers.- position
Numeric positions, positive integral or NA.
- inverse
FALSE maps alignment columns to source positions; TRUE maps source positions to alignment columns.
Value
A frame with input_position, accver, alignment_column, source_accver, source_position, is_gap and matched. A known gap column has matched TRUE and source_position NA; an unavailable position has matched FALSE.
Examples
R · Example code
# Explicit synthetic format example.
aligned <- as_ggchord_alignment(c(A = "AC-G", B = "ACTG"), "DNA")
map_alignment_position(aligned, "A", c(2, 3))
#> input_position accver alignment_column source_accver source_position is_gap
#> 1 2 A 2 A 2 FALSE
#> 2 3 A 3 A NA TRUE
#> matched
#> 1 TRUE
#> 2 TRUE
map_alignment_position(aligned, "A", 3, inverse = TRUE)
#> input_position accver alignment_column source_accver source_position is_gap
#> 1 3 A 4 A 3 FALSE
#> matched
#> 1 TRUE