Skip to contents
Chapters and reference

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

Looks 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.

Usage

R · Example code
map_alignment_position(data, accver, position, inverse = FALSE)

Arguments

data

Long alignment frame from as_ggchord_alignment().

accver

One alignment-row ID, even if its source_accver differs.

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

Search documentation

↑ ↓ select · Enter open · Esc close; or browse by task. API and functions